Ключевой точкой является то место, куда вы должны в точности установить код цепи.
В исходном коде учебника, когда вы читаете файл docker-compose-cli.yaml
, вы увидите эту строку
volumes
- ./../chaincode/:/opt/gopath/src/github.com/chaincode
./../chaincode
- это путь к папке с цепочкой кодов
Еще одна вещь, если вы выберете golang для кода цепочки, путь при вызове install chaincode
будет короче ( читать дальше ):
# this installs the Go chaincode. For go chaincode -p takes the relative path from $GOPATH/src
peer chaincode install -n mycc -v 1.0 -p github.com/hyperledger/fabric-samples/chaincode/chaincode_example02/go/
Node.js версия:
# this installs the Node.js chaincode
# make note of the -l flag to indicate "node" chaincode
# for node chaincode -p takes the absolute path to the node.js chaincode
peer chaincode install -n mycc -v 1.0 -l node -p /opt/gopath/src/github.com/hyperledger/fabric-samples/chaincode/chaincode_example02/node/