0

I am looking to create the Genesis Block and the channel config transaction using the Java SDK in Hyperledger Fabric. I know that we can use configtxgen to do this, but I am trying to avoid that since we have a requirement to create channels by the peer organisation admins from the UI

So, the way I see it, there is only one option available at the moment - which is to use ProcessBuilder to create genesis block and channel config transaction. Then continue using the SDK to create the channel, join the peers etc..

Does anyone have any experience with doing this natively using the Java SDK?

Srikumar S
  • 46
  • 3

1 Answers1

0

A better way to do this is to use the option to generate the Genesis block provisionally. Instead of providing a Genesis and Config Block file, we can tell the Orderer that generate the Genesis block using the provided configtx.yaml when the network is started.

Place(Volume Map) the configtx.yaml file at this location in the orderer container /etc/hyperledger/fabric/configtx.yaml and set the environment variable given below in docker-compose for each Orderer.

- ORDERER_GENERAL_GENESISMETHOD=provisional

This works perfectly fine with HLF v1.4.2 but I think this has been removed in v2.0.

UPDATE: Yes it has been removed from v2.0 JiraIssue

Faisal
  • 403
  • 4
  • 18
  • Yes @Faisal - I think your question answers a slightly tangential issue of how to bootstrap orderer and do we need to tie the generation of the genesis block with the bootstraping of the orderer? BTW, we are usinig v2.0. How did you do create the genesis block and the config tx in your experience? – Srikumar S Jul 09 '20 at 09:47
  • The above mentioned things in the answer are no more relevant with the v2.0. I was going through the documentation and the only method supported for now is by providing a pre-generated file(Link Below). I don't think that Fabric SDK has any such option to generate the genesis block, therefore for now you'll have to go with the Configtxgen binary method. I haven't checked Jira there might be some development on this going on for future enablement. https://hyperledger-fabric.readthedocs.io/en/release-2.0/orderer_deploy.html?highlight=genesis%20block%20method#configure-your-node – Faisal Jul 09 '20 at 12:03