diff --git a/test-network/network.sh b/test-network/network.sh index 24b9481e..33af60fc 100755 --- a/test-network/network.sh +++ b/test-network/network.sh @@ -221,6 +221,26 @@ function createOrgs() { # You can ignore the logs regarding intermediate certs, we are not using them in # this crypto implementation. +# Generate orderer system channel genesis block. +function createConsortium() { + which configtxgen + if [ "$?" -ne 0 ]; then + fatalln "configtxgen tool not found." + fi + + infoln "Generating Orderer Genesis block" + + # Note: For some unknown reason (at least for now) the block file can't be + # named orderer.genesis.block or the orderer will fail to launch! + set -x + configtxgen -profile TwoOrgsOrdererGenesis -channelID system-channel -outputBlock ./system-genesis-block/genesis.block + res=$? + { set +x; } 2>/dev/null + if [ $res -ne 0 ]; then + fatalln "Failed to generate orderer genesis block..." + fi +} + # After we create the org crypto material and the application channel genesis block, # we can now bring up the peers and ordering service. By default, the base # file for creating the network is "docker-compose-test-net.yaml" in the ``docker`` @@ -233,6 +253,7 @@ function networkUp() { # generate artifacts if they don't exist if [ ! -d "organizations/peerOrganizations" ]; then createOrgs + createConsortium fi COMPOSE_FILES="-f ${COMPOSE_FILE_BASE}"