byte[] codePackage) { ChaincodeID.Builder chaincodeIDBuilder = ChaincodeID.newBuilder().setName(name).setVersion(chaincodeVersion); if (chaincodePath != null) { chaincodeIDBuilder = chaincodeIDBuilder.setPath(chaincodePath); ChaincodeID chaincodeID = chaincodeIDBuilder.build();
subBuilder.mergeFrom(chaincodeId_); chaincodeId_ = subBuilder.buildPartial();
/** * <pre> *user friendly version name for the chaincode * </pre> * * <code>optional string version = 3;</code> */ public Builder setVersionBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); version_ = value; onChanged(); return this; } public final Builder setUnknownFields(
byte[] codePackage) { ChaincodeID.Builder chaincodeIDBuilder = ChaincodeID.newBuilder().setName(name).setVersion(chaincodeVersion); if (chaincodePath != null) { chaincodeIDBuilder = chaincodeIDBuilder.setPath(chaincodePath); ChaincodeID chaincodeID = chaincodeIDBuilder.build();
byte[] codePackage) { ChaincodeID.Builder chaincodeIDBuilder = ChaincodeID.newBuilder().setName(name).setVersion(chaincodeVersion); if (chaincodePath != null) { chaincodeIDBuilder = chaincodeIDBuilder.setPath(chaincodePath); ChaincodeID chaincodeID = chaincodeIDBuilder.build();
subBuilder.mergeFrom(chaincodeId_); chaincodeId_ = subBuilder.buildPartial();
/** * <pre> * This field contains the ChaincodeID of executing this invocation. Endorser * will set it with the ChaincodeID called by endorser while simulating proposal. * Committer will validate the version matching with latest chaincode version. * Adding ChaincodeID to keep version opens up the possibility of multiple * ChaincodeAction per transaction. * </pre> * * <code>optional .protos.ChaincodeID chaincode_id = 4;</code> */ public Builder mergeChaincodeId(org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID value) { if (chaincodeIdBuilder_ == null) { if (chaincodeId_ != null) { chaincodeId_ = org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.newBuilder(chaincodeId_).mergeFrom(value).buildPartial(); } else { chaincodeId_ = value; } onChanged(); } else { chaincodeIdBuilder_.mergeFrom(value); } return this; } /**
/** * <pre> * This field contains the ChaincodeID of executing this invocation. Endorser * will set it with the ChaincodeID called by endorser while simulating proposal. * Committer will validate the version matching with latest chaincode version. * Adding ChaincodeID to keep version opens up the possibility of multiple * ChaincodeAction per transaction. * </pre> * * <code>optional .protos.ChaincodeID chaincode_id = 4;</code> */ public Builder mergeChaincodeId(org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID value) { if (chaincodeIdBuilder_ == null) { if (chaincodeId_ != null) { chaincodeId_ = org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.newBuilder(chaincodeId_).mergeFrom(value).buildPartial(); } else { chaincodeId_ = value; } onChanged(); } else { chaincodeIdBuilder_.mergeFrom(value); } return this; } /**
/** * <pre> * This field contains the ChaincodeID of executing this invocation. Endorser * will set it with the ChaincodeID called by endorser while simulating proposal. * Committer will validate the version matching with latest chaincode version. * Adding ChaincodeID to keep version opens up the possibility of multiple * ChaincodeAction per transaction. * </pre> * * <code>optional .protos.ChaincodeID chaincode_id = 4;</code> */ public Builder mergeChaincodeId(org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID value) { if (chaincodeIdBuilder_ == null) { if (chaincodeId_ != null) { chaincodeId_ = org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.newBuilder(chaincodeId_).mergeFrom(value).buildPartial(); } else { chaincodeId_ = value; } onChanged(); } else { chaincodeIdBuilder_.mergeFrom(value); } return this; } /**
/** * <pre> * This field contains the ChaincodeID of executing this invocation. Endorser * will set it with the ChaincodeID called by endorser while simulating proposal. * Committer will validate the version matching with latest chaincode version. * Adding ChaincodeID to keep version opens up the possibility of multiple * ChaincodeAction per transaction. * </pre> * * <code>optional .protos.ChaincodeID chaincode_id = 4;</code> */ public Builder setChaincodeId( org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.Builder builderForValue) { if (chaincodeIdBuilder_ == null) { chaincodeId_ = builderForValue.build(); onChanged(); } else { chaincodeIdBuilder_.setMessage(builderForValue.build()); } return this; } /**
/** * <pre> * The ID of the chaincode to target. * </pre> * * <code>optional .protos.ChaincodeID chaincode_id = 2;</code> */ public Builder mergeChaincodeId(org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID value) { if (chaincodeIdBuilder_ == null) { if (chaincodeId_ != null) { chaincodeId_ = org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.newBuilder(chaincodeId_).mergeFrom(value).buildPartial(); } else { chaincodeId_ = value; } onChanged(); } else { chaincodeIdBuilder_.mergeFrom(value); } return this; } /**
/** * <pre> * The ID of the chaincode to target. * </pre> * * <code>optional .protos.ChaincodeID chaincode_id = 2;</code> */ public Builder mergeChaincodeId(org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID value) { if (chaincodeIdBuilder_ == null) { if (chaincodeId_ != null) { chaincodeId_ = org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.newBuilder(chaincodeId_).mergeFrom(value).buildPartial(); } else { chaincodeId_ = value; } onChanged(); } else { chaincodeIdBuilder_.mergeFrom(value); } return this; } /**
/** * <pre> * This field contains the ChaincodeID of executing this invocation. Endorser * will set it with the ChaincodeID called by endorser while simulating proposal. * Committer will validate the version matching with latest chaincode version. * Adding ChaincodeID to keep version opens up the possibility of multiple * ChaincodeAction per transaction. * </pre> * * <code>optional .protos.ChaincodeID chaincode_id = 4;</code> */ public Builder setChaincodeId( org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.Builder builderForValue) { if (chaincodeIdBuilder_ == null) { chaincodeId_ = builderForValue.build(); onChanged(); } else { chaincodeIdBuilder_.setMessage(builderForValue.build()); } return this; } /**
/** * <pre> * This field contains the ChaincodeID of executing this invocation. Endorser * will set it with the ChaincodeID called by endorser while simulating proposal. * Committer will validate the version matching with latest chaincode version. * Adding ChaincodeID to keep version opens up the possibility of multiple * ChaincodeAction per transaction. * </pre> * * <code>optional .protos.ChaincodeID chaincode_id = 4;</code> */ public Builder setChaincodeId( org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.Builder builderForValue) { if (chaincodeIdBuilder_ == null) { chaincodeId_ = builderForValue.build(); onChanged(); } else { chaincodeIdBuilder_.setMessage(builderForValue.build()); } return this; } /**
/** * <pre> * The ID of the chaincode to target. * </pre> * * <code>optional .protos.ChaincodeID chaincode_id = 2;</code> */ public Builder mergeChaincodeId(org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID value) { if (chaincodeIdBuilder_ == null) { if (chaincodeId_ != null) { chaincodeId_ = org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.newBuilder(chaincodeId_).mergeFrom(value).buildPartial(); } else { chaincodeId_ = value; } onChanged(); } else { chaincodeIdBuilder_.mergeFrom(value); } return this; } /**
/** * Start chaincode * * @param args command line arguments */ public void start(String[] args) { try { processEnvironmentOptions(); processCommandLineOptions(args); initializeLogging(); validateOptions(); final ChaincodeID chaincodeId = ChaincodeID.newBuilder().setName(this.id).build(); final ManagedChannelBuilder<?> channelBuilder = newChannelBuilder(); final Handler handler = new Handler(chaincodeId, this); new ChaincodeSupportStream(channelBuilder, handler::onChaincodeMessage, handler::nextOutboundChaincodeMessage); } catch (Exception e) { logger.fatal("Chaincode could not start", e); } }
/** * <pre> * The ID of the chaincode to target. * </pre> * * <code>optional .protos.ChaincodeID chaincode_id = 2;</code> */ public Builder setChaincodeId( org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.Builder builderForValue) { if (chaincodeIdBuilder_ == null) { chaincodeId_ = builderForValue.build(); onChanged(); } else { chaincodeIdBuilder_.setMessage(builderForValue.build()); } return this; } /**
/** * <pre> * The ID of the chaincode to target. * </pre> * * <code>optional .protos.ChaincodeID chaincode_id = 2;</code> */ public Builder setChaincodeId( org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.Builder builderForValue) { if (chaincodeIdBuilder_ == null) { chaincodeId_ = builderForValue.build(); onChanged(); } else { chaincodeIdBuilder_.setMessage(builderForValue.build()); } return this; } /**