fabric手动搭建的命令行


```python
./bin/cryptogen generate --config=./crypto-config.yaml
./bin/configtxgen -profile OneOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block

./bin/configtxgen -profile OneOrgsChannel -outputCreateChannelTx ./channel-artifacts/mychannel.tx -channelID mychannel
docker-compose -f docker-compose-cli.yaml up -d
docker exec -it cli bash
peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/mychannel.tx
peer chaincode install -n mycc -p github.com/hyperledger/fabric/singlepeer/chaincode/go/example02/cmd/ -v 1.0
peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n mycc -v1.0 -c '{"Args": ["init","a","100","b","200"]}' -P "AND ('Org1MSP.peer')" 
peer chaincode query -C mychannel -n mycc -c '{"Args": ["query","a"]}'
peer chaincode invoke -C mychannel -n mycc -c '{"Args": ["invoke","a","b","10"]}'
peer chaincode query -C mychannel -n mycc -c '{"Args": ["query","b"]}'



猜你喜欢

转载自blog.csdn.net/zhuiyunzhugang/article/details/118101129