GithubHelp home page GithubHelp logo

czone-league / fabric-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dawnwords/fabric-demo

0.0 4.0 0.0 71 KB

Hyperledger Fabric End2End Demo

Makefile 2.68% Shell 26.92% Go 23.42% Java 46.97%

fabric-demo's Introduction

Hyperledger Fabric End2End Demo

This project shows an End2End demo for using Hyperledger Fabric v1.1.0-alpha.

Environments

The environments for this project are shown below should be set up, no limited to the given versions, in advance.

  • JDK Version: 1.8.0
  • Go Version: 1.9.3
  • Govendor Version: 1.0.9
  • Docker Version: 17.12.0-ce
  • Docker-compose Version: 1.18.0

Set up chaincode-demo

chaincode-demo gives an example for Golang Chaincode to depends on some other third party libraries as vendors.

Since chaincode-demo might not be located in the $GOPATH or $GOROOT directory, to enable go test and govendor, create a symbolic link for chaincode-demo in $GOPATH together with fabric

cd ${GOPATH}/src/github.com/hyperledger
ln -s ${fabric-demo-root}/chaincode-demo .
cd chaincode-demo
govendor sync
go test

govendor sync fetches all dependencies defines in vendor/vendor.json so that there are no compile errors and the test passes.

Set up sample fabric network

docker-compose-certgen.yml is the docker-compose file to generate configurations and certificates for the network.

docker-compose.yml is the docker-compose file that defines the docker containers in the fabric network, namely one peer container, one orderer container, on CA container and one command line setting-up container.

Makefile defines the following commands:

  • make certgen: run docker-compose-certgen.yml to generate configurations and certificates for the network into config directory
  • make up: start the fabric network specified in docker-compose.yml based on the configurations and certs generated by make certgen
  • make down stop the fabric network
  • make del delete config directory to clear original configurations and certificates

In order to start the fabric network, using the following commands:

cd fabric-demo
make certgen
make up

After make up, the following contents will be output:

Creating Channel
Installing Chaincode
Instantiating Chaincode
Query Chaincode
Query Result: 300
Done

Then press ctrl+C and docker logs -f cli will be interrupted.

To stop the network:

make down
make del  # if *.yaml config file changed

Run client-sdk-demo

The project is based on Gradle and client-sdk-demo is a submodule for the root project. To run the main method and get the output in org.hyperledger.fabric.sdk.demo.DemoClient:

cd fabric-demo
./gradlew :client-sdk-demo:run

fabric-demo's People

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.