Retailer steps

The Retailer should execute the following steps from its Cloud9 terminal.

The retailer worker receives the product.

docker exec -e "CORE_PEER_MSPCONFIGPATH=/opt/home/rtworker-msp" cli peer chaincode invoke -C mainchannel -n supplychaincc -c '{"Args": ["updateProductState", "TEST1234", "receive"]}' -o $ORDERER --cafile /opt/home/managedblockchain-tls-chain.pem --tls

The retailer worker labels the product.

docker exec -e "CORE_PEER_MSPCONFIGPATH=/opt/home/rtworker-msp" cli peer chaincode invoke -C mainchannel -n supplychaincc -c '{"Args": ["updateProductState", "TEST1234", "label"]}' -o $ORDERER --cafile /opt/home/managedblockchain-tls-chain.pem --tls

The retailer seller sells the product.

docker exec -e "CORE_PEER_MSPCONFIGPATH=/opt/home/rtseller-msp" cli peer chaincode invoke -C mainchannel -n supplychaincc -c '{"Args": ["updateProductState", "TEST1234", "sell"]}' -o $ORDERER --cafile /opt/home/managedblockchain-tls-chain.pem --tls

After each command, the product status is updated with a timestamp of when each operation was performed. If you see the following error at any time during these steps, try again.

Error: endorsement failure during invoke. chaincode result: <nil>