手把手 教你搭建 Hyperledger fabric 的 APP
git clone https://github.com/BingHongLi/fabric-appication-tuna-system.git
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s 1.1.0
cd fabric-appication-tuna-system
git submodule update --init --recursive
cd fabric-samples/basic-network
./start.sh
docker ps
docker-compose up -d cli
docker ps
cp -r ../../lbh_tuna_demo ../chaincode/
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp" cli peer chaincode install -n lbh-tuna-demo -v 1.0 -p github.com/lbh_tuna_demo
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp" cli peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n lbh-tuna-demo -v 1.0 -c '{"Args":[""]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp" cli peer chaincode invoke -o orderer.example.com:7050 -C mychannel -n lbh-tuna-demo -c '{"function":"initLedger","Args":[""]}'
docker exec cli peer chaincode invoke -n lbh-tuna-demo -c '{"Args":["queryTuna","2"]}' -C mychannel
cd ../..
docker-compose up -d