Hyperledger Fabric Network bootstrapping made simple for experimentation, development and testing
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
netModel #5 - Seperate version of Fabric images, CA image and thirdparty images Oct 22, 2018
netSpec #5 - Seperate version of Fabric images, CA image and thirdparty images Oct 22, 2018
sample-chaincodes node chaincode included, HF release 1.1.0-preview Nov 11, 2017
templates
tools Fix architecture method Mar 3, 2018
vendor/gopkg.in/yaml.v2
.gitignore #6 - Add 'out' directory to .gitignore Oct 22, 2018
LICENSE Initial commit Nov 6, 2017
Makefile removed downloable folder, binaries will be available in releases Nov 9, 2017
README.md Merge branch 'feature/6-artifacts-out-directory' into dev Oct 22, 2018
main.go
netcomposer.png
samplenet.yaml #5 - Seperate version of Fabric images, CA image and thirdparty images Oct 22, 2018

README.md

Fabric Network Composer

Fabric Network Composer automates the generation of an operational Hyperledger Fabric Network based on a configuration file where basic aspects of the network are defined in a simple way.

This simple tool is useful when getting started with Hyperledger Fabric and for bootstrapping development/testing Hyperledger Fabric Networks based on customized Hyperledger Fabric images.

Hyperledger Network Composer flow

Configuration file

The tool takes as input a config file specifying the network components:

    DOCKER_NS: hyperledger
    # version tag for fabric images (peer, orderer, etc.)
    FABRIC_VERSION_TAG: 1.3.0
    # version tag for ca image
    CA_VERSION_TAG: 1.3.0
    # version tag for couchdb, kafka, zookeeper
    THIRDPARTY_VERSION_TAG: 0.4.13

    network:     "samplenet"
    domain:      "samplenet.com"
    description: "a Fabric network bootstrapped with netcomposer"

    orderer:
        type: "solo"

    db:
        provider: "goleveldb"

    organizations:        1
    peersPerOrganization: 2
    usersPerOrganization: 1

    channels:
      - name: bigchannel

    chaincodes:
      - name:     kv_chaincode_go_example01
        version:  1.0
        language: golang
        path:     go/kv_chaincode_go_example01
        channels:
          - bigchannel
        
    logLevel:       "debug"
    tlsEnabled:     true
    chaincodesPath: "./sample-chaincodes"

Considerations

  • Required crypto material is generated by cryptogen tool.
  • Genesis block and channels are created with configtxgen tool included in tools folder.
  • The tool has been tested on Hyperledger Fabric release 1.0.2 and 1.1.0-preview

Generating network artifacts

go run main.go -spec samplenet.yaml

Starting the network

.out/samplenet/provision.sh

Stopping the network

.out/samplenet/provision.sh stop

Instantiate a chaincode

Pick any endorsing peer already joined to the channel, peer1 is used as follows:

docker exec -it cli.peer1.org1.samplenet.com bash

peer chaincode instantiate -o orderer1.samplenet.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA -C bigchannel -n kv_chaincode_go_example01 -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('org1MSP.member','org2MSP.member')"

Query/Invoke chaincodes

docker exec -it cli.peer1.org1.samplenet.com bash

peer chaincode query -o orderer1.samplenet.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA -C bigchannel -n kv_chaincode_go_example01 -c '{"Args":["query","a"]}'

peer chaincode invoke -o orderer1.samplenet.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA -C bigchannel -n kv_chaincode_go_example01 -c '{"Args":["invoke", "a", "b", "10"]}'

Prerequisites for building the tool

Go - 1.7 or higher

Building the tool

Build binaries for all supported platforms: make

Build binaries for a single platform:
    - make binaries/darwin-amd64
    - make binaries/windows-amd64
    See Makefile for all supported platforms

License

Source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the LICENSE file.