Skip to content

Commit abb96ab

Browse files
author
Srinivasan Muralidharan
committed
[FAB-3671] chaincodedev mode doc needs updating
Just a doc update for peer-chaincode mode. [ci skip] Change-Id: Id622e78ec5b871870f5599176a18fe4d335063d1 Signed-off-by: Srinivasan Muralidharan <[email protected]>
1 parent a48169d commit abb96ab

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

docs/source/peer-chaincode-devmode.rst

+27-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ of the box” - with one exception: we create two channels instead of
1111
using the default ``testchainid`` channel to show how the single running
1212
instance can be accessed from multiple channels.
1313

14+
All commands are executed from the ``fabric`` folder.
15+
1416
Start the orderer
1517
-----------------
1618

@@ -34,10 +36,18 @@ MSP. The ``--peer-chaincodedev=true`` puts it in “dev” mode.
3436
Create channels ch1 and ch2
3537
---------------------------
3638

39+
Generate the transactions for creating the channels using ``configtxgen`` tool.
40+
41+
::
42+
configtxgen -channelID ch1 -outputCreateChannelTx ch1.tx -profile SampleSingleMSPChannel
43+
configtxgen -channelID ch2 -outputCreateChannelTx ch2.tx -profile SampleSingleMSPChannel
44+
45+
where SampleSingleMSPChannel is a channel profile in ``sampleconfig/configtx.yaml``
46+
3747
::
3848

39-
peer channel create -o 127.0.0.1:7050 -c ch1
40-
peer channel create -o 127.0.0.1:7050 -c ch2
49+
peer channel create -o 127.0.0.1:7050 -c ch1 -f ch1.tx
50+
peer channel create -o 127.0.0.1:7050 -c ch2 -f ch2.tx
4151

4252
Above assumes orderer is reachable on ``127.0.0.1:7050``. The orderer
4353
now is tracking channels ch1 and ch2 for the default configuration.
@@ -58,12 +68,23 @@ Start the chaincode
5868
go build
5969
CORE_CHAINCODE_LOGLEVEL=debug CORE_PEER_ADDRESS=127.0.0.1:7051 CORE_CHAINCODE_ID_NAME=mycc:0 ./chaincode_example02
6070

61-
The chaincode is started with peer and chaincode logs showing it got
62-
registered successfully with the peer.
71+
The chaincode is started with peer and chaincode logs indicating successful registration with the peer.
72+
Note that at this stage the chaincode is not associated with any channel. This is done in subsequent steps
73+
using the ``instantiate`` command.
6374

6475
Use the chaincode
6576
-----------------
6677

78+
Even though you are in ``--peer-chaincodedev`` mode, you still have to install the chaincode so the life-cycle system
79+
chaincode can go through its checks normally. This requirement may be removed in future when in ``--peer-chaincodedev``
80+
mode.
81+
82+
::
83+
84+
peer chaincode install -n mycc -v 0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
85+
86+
Once installed, the chaincode is ready to be instantiated.
87+
6788
::
6889

6990
peer chaincode instantiate -n mycc -v 0 -c '{"Args":["init","a","100","b","200"]}' -o 127.0.0.1:7050 -C ch1
@@ -81,6 +102,8 @@ committed.
81102

82103
The above invoke the chaincode over the two channels.
83104

105+
Finally, query the chaincode on the two channels.
106+
84107
::
85108

86109
peer chaincode query -n mycc -c '{"Args":["query","a"]}' -o 127.0.0.1:7050 -C ch1

0 commit comments

Comments
 (0)