Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.
James Taylor edited this page Jan 25, 2021 · 6 revisions

Initial notes for using the external service builder to run FabCar on the sample test network.

See also:

Org1: peer lifecycle chaincode install ./org1-fabcar-pkg.tgz

Org2: peer lifecycle chaincode install ./org2-fabcar-pkg.tgz

Org1 & Org2: Start chaincode

Org1 & Org2: export VERSION=1

Org1 & Org2: export CHANNEL_NAME=mychannel

Org1 & Org2: export ORDERER_CA=${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

Org1: export PACKAGE_ID=fabcar:b2994f645baa3dad00804179fd3678d0b049a9b0eca32b627d20914f1172df5f

Org1: peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls true --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name fabcar --version ${VERSION} --package-id ${PACKAGE_ID} --sequence ${VERSION}

Org2: export PACKAGE_ID=fabcar:1e99224e9b46fe081d794329f0cc033aa4429b04910fea46f66e16bbb30c6dab

Org2: peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls true --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name fabcar --version ${VERSION} --package-id ${PACKAGE_ID} --sequence ${VERSION}

Org1 & Org2: peer lifecycle chaincode checkcommitreadiness -o orderer.example.com:7050 --tls true --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name fabcar --version ${VERSION} --sequence ${VERSION} --output json

Org1: peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls true --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name fabcar --peerAddresses $CORE_PEER_ADDRESS --tlsRootCertFiles $CORE_PEER_TLS_ROOTCERT_FILE --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt --version ${VERSION} --sequence ${VERSION}

Org1: peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls true --cafile $ORDERER_CA -C $CHANNEL_NAME -n fabcar --peerAddresses $CORE_PEER_ADDRESS --tlsRootCertFiles $CORE_PEER_TLS_ROOTCERT_FILE --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"function":"initLedger","Args":[]}' --waitForEvent

Org1: peer chaincode query -C $CHANNEL_NAME -n fabcar -c '{"Args":["queryAllCars"]}'

Clone this wiki locally