mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-26 03:25:09 +00:00
added missing function to create Consortium by creating genesis.block with profile in configtx.yaml
This commit is contained in:
parent
53cc0abea4
commit
e573cfb835
1 changed files with 21 additions and 0 deletions
|
|
@ -227,12 +227,33 @@ function createOrgs() {
|
|||
# folder. This file defines the environment variables and file mounts that
|
||||
# point the crypto material and genesis block that were created in earlier.
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
# Bring up the peer and orderer nodes using docker compose.
|
||||
function networkUp() {
|
||||
checkPrereqs
|
||||
# generate artifacts if they don't exist
|
||||
if [ ! -d "organizations/peerOrganizations" ]; then
|
||||
createOrgs
|
||||
createConsortium
|
||||
fi
|
||||
|
||||
COMPOSE_FILES="-f ${COMPOSE_FILE_BASE}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue