Search code examples
pythoncommand-linehyperledger-fabric

How to create and join a channel correctly in hyper ledger fabric using python


Hello I am working on a thesis project based on block chain tech. I am developing using Hyperledger fabric python language.

based on this documentation : https://fabric-sdk-py.readthedocs.io/en/latest/tutorial.html

Basically i have been able to :

  1. start my fabric network
  2. Create connection profile
  3. start ca instance server
  4. Create users
  5. revoke users based on certificates

Now I am trying to create a channel and join this channel, but i keep falling into an error as below

configtxgen not in path configtxgen empty

A part of error in screenshot

concluding part of screenshot

The error above points to the fact that configtx.yaml is not found

What i have tried to solve this?

I have tried setting the path of FABRIC_CFG_PATH to environment as below

export FABRIC_CFG_PATH=Users/*******/Documents/hyper/fabric-sdk-py/fabric-samples/bin:$PATH


export FABRIC_CFG_PATH="$HOME/documents/hyper/fabric-sdk-py/fabric-samples/bin:$PATH"

export FABRIC_CFG_PATH=$HOME/documents/hyper/fabric-sdk-py/test/fixtures/e2e_cli/:$PATH

export FABRIC_CFG_PATH=/home/**********/documents/hyper/fabric-sdk-py/test/fixtures/e2e_cli/$PATH

I am still unable to fix this, i need help please


Solution

  • As explained in the documentation, you need configtxgen tool in your $PATH. configtxgen is coming as part of the fabric binaries bundle. You can get the binaries bundle for your fabric version here(Download compatible version for your platform from the 'Assests' section). Download and extract the bundle and move configtxgen binary inside it to some location in your $PATH. You can verify whether configtxgen is accessible from terminal using

    configtxgen -version