Giter Club home page Giter Club logo

fabric-demo's Introduction

Maven Central

##Spring Fabric Demo

This demo is updated by using Hyperledger Fabric v2.3.2 Network now.

[bootstrap.sh]

./bootstrap.sh 2.3.2 1.5.0 -s

If you still use Fabric 1.4.x network, please check out branch 1.0.6.

在线演示

1. Build Fabric Network v2.x

open Terminal and go to test-network folder.

then run command:

i. Build Network with channel

./network.sh up createChannel -c mychannel -s couchdb

ii. Deploy chaincode

./network.sh deployCC -ccn mycc -ccv 1.0 -ccp ../src/chaincode/common -ccl go

iii. Deploy Java chaincode

./network.sh deployCC -ccn commoncc -ccv 1.0 -ccp ../src/chaincode-java -ccl java

Java Common Chaincode

2. Generate Fabric Network Config files.

Run io.github.ecsoya.demo.network.NetworkGenerator in src/main/test folder.

you will get 2 network config files in src/main/resources/network folder

connection-org1.yml

and

connection-org2.yml

QA: Why to using custom NetworkGenerator?

Yes, after build your network by using test-network script files, you will find these 2 files connection-org1.yml and connection-org2.yml under organizations/peerOrganizations/org1.example.com and organizations/peerOrganizations/org2.example.com folder.

Firstly, these files does not contain the user identity (admin certificate...) to access wallet. Secondly, these files does not mapping the DNS to IP correctly.

3. Configure application.yml

spring:
   mvc:
      locale: zh_CN
      locale-resolver: fixed
   fabric:
      chaincode: 
         identify: mycc
         name: Common Chaincode
         version: 1.0
      channel: mychannel
      peers: 2
      organizations:
      - Org1
      - Org2
      name: Common Fabric Network
      gateway:
         wallet:
            identify: admin
      network:
         file: network/connection-org1.yml
         name: example-fabric
# Fabric explorer
      explorer: 
         title: Fabric Explorer
#         logo: img/logo.png
         copyright: Ecsoya ([email protected])
         hyperledger-explorer-url: http://www.hyperleder.org
         path: /explorer

Run & Test

Run DemoApplication

then open http://localhost:8080/explorer to view the fabric explorer.

Gitee.com

Clone to gitee.com

fabric-demo's People

Contributors

ecsoya avatar

Watchers

James Cloos 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.