First network in hyperledger

a 夏天 提交于 2019-11-30 07:41:38

Let's try to make sure you run thru all the steps as outlined in docs.

  1. First of all you need to edit your docker-compose-cli.yaml file the cli section to comment out line responsible to run automatic flow of channel creation and join:

    command: /bin/bash -c './scripts/script.sh ${CHANNEL_NAME}; sleep $TIMEOUT'
    

E.g.

# command: /bin/bash -c './scripts/script.sh ${CHANNEL_NAME}; sleep $TIMEOUT'
  1. Next export channel name you are working with:

    export CHANNEL_NAME=mychannel

  2. Start the network (use default timeout of 60s):

    CHANNEL_NAME=$CHANNEL_NAME docker-compose -f docker-compose-cli.yaml up -d

  3. Enter the cli container:

    docker exec -it cli bash

  4. Export environmental variables:

    export CHANNEL_NAME=mychannel

  5. Create the channel:

    peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
    
  6. Join the channel:

    peer channel join -b mychannel.block
    
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!