- Go-Install Go language
- Clone the hyperledger
- Fabric-Install the fabric
- Fabric-Setup the development environment
- Look at the credentials of Lukas inside the membersrvc.yaml, the user will have to log on to interact with the hyperledger
- Clone this code Chaincode-Helloworld into
<hyperledger directory>/fabric/examples
- Setup 3 UNSECURED peers (setting up secured peers generate marshalling errors for the moment)
- Setup 3 terminals as described in Writing Building and Running Chaincode in a Development Environment
- Security Setup
- Start your favorite bash command line, on windows start
Git bash
for example cd <GO PATH>/gopg/src/github.com/hyperledger/fabric/devenv/
vagrant up
vagrant ssh
cd $GOPATH/src/github.com/hyperledger/fabric/
make membersrvc && membersrvc
- Start your favorite bash command line, on windows start
- Vagrant Terminal 1 (validating peer)
- Start your favorite bash command line, on windows start
Git bash
for example cd <GO PATH>/gopg/src/github.com/hyperledger/fabric/devenv/
vagrant ssh
cd $GOPATH/src/github.com/hyperledger/fabric/
make peer
peer node start --peer-chaincodedev
- Start your favorite bash command line, on windows start
- Vagrant Terminal 2 (chaincode)
- Start your favorite bash command line, on windows start
Git bash
for example cd <GO PATH>/gopg/src/github.com/hyperledger/fabric/devenv/
vagrant ssh
cd $GOPATH/src/github.com/hyperledger/fabric/examples/chaincode/go/altf1be/chaincode-helloworld/helloworld
go build && CORE_CHAINCODE_ID_NAME=helloWorld CORE_PEER_ADDRESS=0.0.0.0:30303 ./helloworld
- Start your favorite bash command line, on windows start
- Vagrant Terminal 3 (Command line interpreter)
- Start your favorite bash command line, on windows start
Git bash
for example cd <GO PATH>/gopg/src/github.com/hyperledger/fabric/devenv/
vagrant ssh
$GOPATH/src/github.com/hyperledger/fabric/peer
peer network login lukas
- input the password stored in membersrvc.yaml
- deploy the chaincode-helloword
peer chaincode deploy -p ./helloWorld -c '{"Function":"init", "Args":["noArgsyet"]}' -u lukas
- query the chaincode-helloword:
peer chaincode query -u lukas -l golang -n helloWorld -c '{"Function": "query", "Args": ["b"]}'
peer chaincode invoke -l golang -u lukas -n helloWorld -c '{"Function":"invoke", "Args":["noArgsyet"]}'
- Start your favorite bash command line, on windows start
go build && CORE_CHAINCODE_ID_NAME=helloWorld CORE_PEER_ADDRESS=0.0.0.0:30303 ./helloworld
peer network login lukas
peer chaincode deploy -n helloWorld -c '{"Function":"init", "Args":["noArgsyet"]}'
peer chaincode invoke -l golang -n helloWorld -c '{"Function":"invoke", "Args":["noArgsyet"]}'
peer chaincode query -l golang -n helloWorld -c '{"Function": "quey", "Args": ["b"]}'
CORE_SECURITY_ENABLED=true CORE_SECURITY_PRIVACY=true peer chaincode deploy -p ./helloWorld -c '{"Function":"init", "Args":["noArgsyet"]}' -u lukas
CORE_SECURITY_ENABLED=true CORE_SECURITY_PRIVACY=true peer chaincode query -u lukas -l golang -n helloWorld -c '{"Function": "query", "Args": ["b"]}'
CORE_SECURITY_ENABLED=true CORE_SECURITY_PRIVACY=true peer chaincode invoke -l golang -u lukas -n helloWorld -c '{"Function":"invoke", "Args":["noArgsyet"]}'
CORE_SECURITY_ENABLED=true CORE_SECURITY_PRIVACY=true peer chaincode query -l golang -u lukas -n helloWorld -c '{"Function":"query", "Args":["noArgsyet"]}'
- Ledger, chaincode
- Ledger, Protocol Specification : https://github.com/hyperledger/fabric/blob/960db9f57a5e19f1f097741c807c01cdbe86ada6/docs/protocol-spec.md
- Chaincode APIs: https://github.com/hyperledger/fabric/blob/bf9f05014680ba2872eda3c18e42f742f8050066/docs/API/ChaincodeAPI.md
- shim package : https://godoc.org/github.com/hyperledger/fabric/core/chaincode/shim
- hyperledger asset management app: https://github.com/hyperledger/fabric/blob/012384ac7c2e8c16496e3c4f3a4b84cec301aead/examples/chaincode/go/asset_management/app/README.md
-- End of the Document