Hyperledger Fabric Chaincode Tutorial II

Source: Internet
Author: User
Tags docker cp hyperledger fabric


# Deploy and instantiate your own chaincode to fabric:


# # First write the chaincode copy to the CLI.
```
Command reference: Docker CP [OPTIONS] src_path|-Container:dest_path
Docker Cp/chaincode/bdata/3a113b6c0ecf:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go
```
# # Installation Bdatas = = =
```
Peer Chaincode install-n bdata-v1.0-p github.com/hyperledger/fabric/examples/chaincode/go/bdata
```
# # Instantiation Bdatas = = =
```
Peer Chaincode instantiate-n bdata-v1.0-c ' {"Args": ["Initbdata", "Bdata1", "Blue", "Hashcode", "Tom"]} '-C MyChannel
```
# # The code has an error when instantiating, because the property name is case-sensitive.
Upgrade required after correction Chaincode
```
Peer Chaincode install-n bdata-v2.0-p github.com/hyperledger/fabric/examples/chaincode/go/bdata
```


# # #//====chaincode Use example (CLI) = = =
```
= = = Install Bdatas = =
Peer Chaincode install-n bdata-v 4.0-p github.com/hyperledger/fabric/examples/chaincode/go/bdata
= = = Instantiation Bdatas = = = =
orderer_ca=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererorganizations/example.com/tlsca/ Tlsca.example.com-cert.pem
Peer Chaincode Instantiate-o orderer.example.com:7050--tls true--cafile $ORDERER _ca-n bdata-v 4.0-c ' {"Args": ["in Itbdata "," Bdata1 "," Blue "," Hashcode "," Tom "]} '-P ' OR (' org1msp.member ', ' Org2msp.member ')"-C MyChannel
```

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.