Then the previous article also recorded the fabric1.0 test process has been in accordance with the "Blockchain Technology Guide" operation, the background log in the start of the output of the following error message
The background error of the cluster will cause the command error, guess the reason is that there is a dependency between the containers, Orderer 7050 has not been opened, Peer0 Grpc failed.
Purely personal guess, because the following error is also shown because GRPC timed out
Then I simply used the setup_setup_fabric_1.0.sh script in the docker-compose-files/hyperledger/1.0 directory, executed with sudo
The script will finally start the container and the background display
Newdeliverservice-INFO 027 Creating delivery service to get blocks from the ordering service no errors
Enter the container Peer0, execute the deployment command install and instantiate in the container, note that the output log has no error, and the final result should look like the figure below
Docker exec-it Fabric-peer0 Bash
Peer Chaincode install-n test_cc-p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02-c ' {" Args ": [" Init "," a "," + "," B "," $ "]} '-V V0
Container background Log
Peer Chaincode instantiate-n test_cc-p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02-c ' { "Args": ["Init", "a", "+", "B", "$"]} '-V V0
At this point, the system generates a dev-peer0-test_cc-v0-like Chaincode Docker image, and a container of the same name.
Perform a query operation on the successful chaincode of the deployment and query the balance of a. Similarly, execute the following command in the Peer0 container, note that the output has no error message, and the final result is Query result:100.
Peer Chaincode query-n test_cc-c ' {"Args": ["Query", "a"]} '
You can also query the balance of B in a different way, and note that the final return result is query result:200.
Peer Chaincode invoke-n test_cc-c ' {"Args": ["Query", "B"]} '
Perform a call operation on a successful Chaincode deployment, such as a to B transfer of 10 yuan. At this point, the balance of A and B is queried again, and a new balance of 90,b of 210 is found to be changed.
Peer Chaincode invoke-n test_cc-c ' {"Args": ["Invoke", "a", "B", "10"]} '
Peer Chaincode query-n test_cc-c ' {"args": ["Query", "a"]} '
peer Chaincode query-n test_cc-c ' {"args": ["Query", "B"]} '