Supplier steps

The Supplier should execute the following steps from the Cloud9 terminal.

The Supplier worker manufactures the product.

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

The Supplier inspector inspects the product.

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

The Supplier worker ships the product to the retailer.

docker exec -e "CORE_PEER_MSPCONFIGPATH=/opt/home/spworker-msp" cli peer chaincode invoke -C mainchannel -n supplychaincc -c '{"Args": ["updateProductState", "TEST1234", "ship"]}' -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>