Hyperledger fabric0.8 test on Ubuntu

Source: Internet
Author: User

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"]} '





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.