GithubHelp home page GithubHelp logo

bhemeswararao / 3org1ch_couchdb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kctam/3org1ch_couchdb

0.0 1.0 0.0 8 KB

This repo helps creating a Fabric Network with three organizations with one channel. Each org comes with a peer node and a couchdb.

3org1ch_couchdb's Introduction

3org1ch_couchdb

This repo is used for creating a fabric network in a Hyperledger Fabric node. It is assumed you have a Hyperledger Fabric node, with the prerequisite installation done and all required components, including the docker images, tools and fabric samples.

Instruction

Step 1: clone this repo in fabric-samples directory

cd fabric-samples
git clone https://github.com/kctam/3org1ch_couchdb.git
cd 3org1ch_couchdb

Step 2: generate the required crypto material for organizations

../bin/cryptogen generate --config=./crypto-config.yaml

Step 3: generate the channel artifacts

mkdir channel-artifacts
export FABRIC_CFG_PATH=$PWD
../bin/configtxgen -profile ThreeOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
../bin/configtxgen -profile ThreeOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel

Step 4: bring up all the containers, and you should see total 8 containers up and running

docker-compose -f docker-compose-cli.yaml -f docker-compose-couch.yaml up -d
docker ps

Step 5: create and join channel

docker exec cli peer channel create -o orderer.example.com:7050 --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -c mychannel -f ./channel-artifacts/channel.tx

# peer0.org1
docker exec cli peer channel join -b mychannel.block

# peer0.org2
docker exec -it -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/[email protected]/msp -e CORE_PEER_ADDRESS=peer0.org2.example.com:7051 -e CORE_PEER_LOCALMSPID="Org2MSP" -e CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt cli peer channel join -b mychannel.block

# peer0.org3
docker exec -it -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/users/[email protected]/msp -e CORE_PEER_ADDRESS=peer0.org3.example.com:7051 -e CORE_PEER_LOCALMSPID="Org3MSP" -e CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt cli peer channel join -b mychannel.block

Step 6: If everything looks good, you now have a fabric network with 3 organizations set, and ready for testing any chaincode.

Step 7: clean up: always good practice for cleaning up stuff after testing

docker-compose -f docker-compose-cli.yaml -f docker-compose-couch.yaml down --volumes --remove-orphans
docker rm $(docker ps -aq)
docker rmi $(docker images dev-* -q)

Reuse the crypto material and channel artifacts

You can keep the content inside crypto-config and channel-artifacts for next test. If you have them already you can start with Step 4.

Enjoy Hyperledger Fabric!

3org1ch_couchdb's People

Contributors

kctam avatar

Watchers

 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.