Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

   CC_PACKAGE_ID=marbles_1:1a17ae87243ad78f0203ca921b733c52adbf7ad2816340ea876ef1b5cc56c0db

Approve chaincode definition on channel for SampleOrg:

   peer lifecycle chaincode approveformyorg --channelID mychannel --name marbles --version 1 --package-id $CC_PACKAGE_ID --sequence 1

Commit chaincode definition to channel:

   peer lifecycle chaincode commit -o 127.0.0.1:7050 --channelID mychannel --name marbles --version 1 --sequence 1

...

configtxgen -channelID mychannel -outputCreateChannelTx mychannel.tx -profile SampleSingleMSPChannel
peer channel create -c mychannel -o 127.0.0.1:7050 -f mychannel.tx
peer channel join -b mychannel.block
peer lifecycle chaincode package marbles.tar.gz --path github.com/hyperledger/fabric/integration/chaincode/marbles/cmd --lang golang --label marbles_1
peer lifecycle chaincode install marbles.tar.gz
CC_PACKAGE_ID=marbles_1:1a17ae87243ad78f0203ca921b733c52adbf7ad2816340ea876ef1b5cc56c0db
peer lifecycle chaincode approveformyorg --channelID mychannel --name marbles --version 1 --package-id $CC_PACKAGE_ID --sequence 1
peer lifecycle chaincode commit -o 127.0.0.1:7050 --channelID mychannel --name marbles --version 1 --sequence 1
peer chaincode invoke -o 127.0.0.1:7050 -C mychannel -n marbles -c '{"Args":["initMarble","marble1","blue","35","tom"]}' --waitForEvent
peer chaincode invoke -o 127.0.0.1:7050 -C mychannel -n marbles -c '{"Args":["transferMarble","marble1","jerry"]}' --waitForEvent
peer chaincode query -C mychannel -n marbles -c '{"Args":["readMarble","marble1"]}'


For legacy chaincode, replace the package/install/approve/commit chaincode with the following:

peer chaincode install -n marbles -p github.com/hyperledger/fabric/integration/chaincode/marbles/cmd-v 1
peer chaincode instantiate -C mychannel -n marbles -c '{"Args":["init"]}' -v 1 -o 127.0.0.1:7050

...