Samples for Hyperledger Fabric
Find a file
2018-06-28 16:38:00 +05:30
balance-transfer FAB-8947 Fabric-Samples remove package lock 2018-03-20 12:17:30 -04:00
basic-network [FAB-6568] Fabric-Samples - update fabcar 2017-10-30 12:08:06 -04:00
chaincode [FAB-8920] Pin fabric-samples to node.js "~1.1.0" 2018-03-16 08:15:51 -04:00
chaincode-docker-devmode [FAB-6934] fix devmode sample for v1.1 2018-02-01 05:36:00 +00:00
fabcar [FAB-8920] Pin fabric-samples to node.js "~1.1.0" 2018-03-16 08:15:51 -04:00
fabric-ca Merge "[FAB-8496] allow modification of affiliations" 2018-03-07 23:01:33 +00:00
first-network [FAB-9406] Typo in byfn.sh 2018-04-11 16:42:20 +00:00
high-throughput [FAB-6292] Fix spelling error 2017-09-26 15:24:26 +08:00
scripts FAB-5412 add fabric-preload.sh script 2017-07-22 16:58:14 -04:00
.gitignore FAB-8564 add debug commands to byfn 2018-02-28 10:05:33 -05:00
LICENSE FAB-4853 initial content 2017-06-21 07:30:04 +08:00
MAINTAINERS.md FAB-4853 initial content 2017-06-21 07:30:04 +08:00
README.md Update README.md 2018-06-28 16:38:00 +05:30

Hyperledger Fabric Samples

First of all start the three terminals.

Terminal 1 Start the Fabric Network##

To start the fabric network on your local machine, First navigate to the chaincode-docker-devmode directory and tag the all images as latest in the docker-compose-simple.yaml file.

docker-compose -f docker-compose-simple.yaml up

Above command download the all required images and start the network with the SingleSampleMSPSolo orderer profile and launches the peer in development mode. It also launches two additional containers one is chaincode and a CLI to interact with the chaincode.Running the command you will see the following

D:\fabric-samples-release-1.1\chaincode-docker-devmode>docker-compose -f docker-compose-simple.yaml up Pulling orderer (hyperledger/fabric-orderer:x86_64-1.0.0)... x86_64-1.0.0: Pulling from hyperledger/fabric-orderer aafe6b5e13de: Pull complete 0a2b43a72660: Pull complete

Terminal 2 Run ChainCode Container. Build and Start ChainCode

docker exec -it chaincode bash

You should see the following:

root@d2629980e76b:/opt/gopath/src/chaincode#

Now, compile your chaincode:

.chaincode/sacc# go build

Now mention and run the chaincode on the peer:

CORE_PEER_ADDRESS=peer:7051 CORE_CHAINCODE_ID_NAME=xyz:0 ./sacc

License

Hyperledger Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the LICENSE file. Hyperledger Project documentation files are made available under the Creative Commons Attribution 4.0 International License (CC-BY-4.0), available at http://creativecommons.org/licenses/by/4.0/.