What is the use case of fields?

gqqnb2005 <gqqnb2005@...>

As a contract in Hyperledger Fabric is a class with an annotation, how
should we use the class fields?

public final class AssetTransfer implements ContractInterface {
private Asset currentAsset;

public void setAsset(final Context ctx, final String assetID) {
currentAsset = loadAsset(assetId);

In this code snippet, contract AssetTransfer has a method setAsset
that changes its field currentAsset.

From my experiments, if I have peer1 and peer2 running the contract,
and peer2 somehow goes offline, the value of currentAsset in peer2 is

As a chaincode developer, should I avoid using fields? Are there any
documentations or code patterns on contract fields?

Join {fabric@lists.hyperledger.org to automatically receive all group messages.