I am trying to test my chaincode locally, for this I have a script to run, but whilst installation of chaincode(code below) getting error that chaincode path does not exists?
peer chaincode install -n mycc -v 1.0 -p ./bitbucket.org/Foldername/testBlockchain/folder_name_for_chaincode
in all of the examples I have seen following command is used
peer chaincode -n mycc -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
My question precisely is that how can I correct my path to point to chaincode?
You need to have your chaincode available in the GOPATH, then you should be able to install it. Just either add your bitbucket folder into GOPATH or move you chaincode into $GOPATH/src
.
Update
The following command
peer chaincode install -n mycc -v 1.0 -p ./bitbucket.org/Foldername/testBlockchain/folder_name_for_chaincode
need to be replaced with
peer chaincode install -n mycc -v 1.0 -p bitbucket.org/Foldername/testBlockchain/folder_name_for_chaincode
Thanks for your answer. My chain code is already in $GOPATH. Directory structure is as follows. Directory structure is as follows
$GOPATH ->src
--->bitbucket.org
------>FolderName
--------->chaincodefolder
------------->chaincodenamefolder
----------------chaincode.go
---------->Middleware
---------->localfabricfolder
Step a)
get the channel name using the following
peer channel list
step b)
get the chaincode version using this
peer chaincode list --installed
step c)
install the chaincode using this
CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n mycc -p github.com/lc/go -v v3
-n=name,
-v=version,
-p=path