Tools, FAQ, Tutorials:
Instantiate PaperNet Chaincode (Smart Contract)
How to Instantiate the PaperNet Chaincode (Smart Contract), papercontract.js?
✍: FYIcenter.com
Now that papercontract chaincode containing the CommercialPaper chaincode is installed on the required PaperNet peers, you, as administrator, can make it available to different network channels, so that it can be invoked by applications connected to those channels. Because we’re using the basic network configuration for PaperNet, we’re only going to make papercontract available in a single network channel, mychannel.
1. Instantiate the chaincode:
(magnetocorp admin)$ cd ~/hyperledger-binaries/fabric-samples (magnetocorp admin)$ cd commercial-paper/organization/magnetocorp/contract (magnetocorp admin)$ docker exec cliMagnetoCorp peer chaincode instantiate -n papercontract \ -v 0 -l node -c '{"Args":["org.papernet.commercialpaper:instantiate"]}' \ -C mychannel -P "AND ('Org1MSP.member')" [chaincodeCmd] InitCmdFactory -> INFO 001 Retrieved channel (mychannel) \ orderer endpoint: orderer.example.com:7050 [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default escc [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default vscc ^C
You may need to press Ctrl-C to exit from the cliMagnetoCorp container.
Note that the orderer address orderer.example.com:7050 in the log message. This is because it additionally submits an instantiate transaction to the orderer, which will include the transaction in the next block and distribute it to all peers that have joined mychannel, enabling any peer to execute the chaincode in their own isolated chaincode container. Note that instantiate only needs to be issued once for papercontract even though typically it is installed on many peers.
2. Verify the instantiated chaincode:
(magnetocorp admin)$ docker exec cliMagnetoCorp peer chaincode list --instantiated -C mychannel Get instantiated chaincodes on channel mychannel: Name: papercontract, Version: 0, Path: /opt/gopath/src/github.com/contract, Escc: escc, Vscc: vscc
3. Verify the container that runs the instantiated chaincode:
(magnetocorp admin)$ docker ps | grep papercontract IMAGE STATUS NAMES dev-peer0.org1.example.com-papercontract-0-d96... Up 2 minutes dev-peer0.org1.example.com-papercontract-0
⇐ Install PaperNet Chaincode (Smart Contract)
2019-12-02, 1048🔥, 0💬
Popular Posts:
Where to find tutorials on PHP language? I want to know how to learn PHP. Here is a large collection...
How to attach console to a Running Container using the "docker container exec" command? I want to ge...
How to make application release build with Visual Studio 2017? If you want to make a final release b...
Where can I download the EPUB 2.0 sample book "The Metamorphosis" by Franz Kafka? You can following ...
How to use the "rewrite-uri" Policy Statement for an Azure API service operation? The "rewrite-uri" ...