first you need to install the fabric binaries and the docker images like (peer, orderer ..).
# change dir to the root and run this command
chmod +x scripts/install-fabric.sh && ./scripts/install.-fabricsh docker binarythis script will bring up a network with two orgs (org1 and org2) each org have one peer, the arg createChannel will create a channel between org1 and org2
cd test-network/
./network.sh up createChannelthis example is using chaincode-go basic transfer asset example
# cd to the chaincode folder and install the dependencies
GO111MODULE=on go mod vendor
# cd to test-network folder and deploy it to the channel
./network.sh deployCC -ccn test -ccp ../chaincode-go/ -ccl goto use peer CLI
# point the env vars to the bin and config folders
export PATH=${PWD}/../bin:$PATH
export FABRIC_CFG_PATH=$PWD/../config/
# to set peer CLI to org1 admin
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
export CORE_PEER_ADDRESS=localhost:7051invoke a transaction (InitLedger)
peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n test --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" --peerAddresses localhost:9051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" -c '{"function":"InitLedger","Args":[]}'quary the ledger
peer chaincode query -C mychannel -n test -c '{"Args":["GetAllAssets"]}'