github.com/leonlxy/hyperledger@v1.0.0-alpha.0.20170427033203-34922035d248/examples/e2e_cli/generateCfgTrx.sh (about) 1 #!/bin/bash 2 3 set -e 4 5 CHANNEL_NAME=$1 6 if [ -z "$1" ]; then 7 echo "Setting channel to default name 'mychannel'" 8 CHANNEL_NAME="mychannel" 9 fi 10 11 export FABRIC_ROOT=$PWD/../.. 12 export FABRIC_CFG_PATH=$PWD 13 14 echo "Channel name - "$CHANNEL_NAME 15 echo 16 17 CONFIGTXGEN=`which configtxgen || /bin/true` 18 19 if [ "$CONFIGTXGEN" == "" ]; then 20 echo "Building configtxgen" 21 make -C $FABRIC_ROOT configtxgen 22 CONFIGTXGEN=$FABRIC_ROOT/build/bin/configtxgen 23 else 24 echo "Using configtxgen -> $CONFIGTXGEN" 25 fi 26 27 echo "Generating genesis block" 28 $CONFIGTXGEN -profile TwoOrgsOrdererGenesis -outputBlock crypto/orderer/orderer.block 29 30 echo "Generating channel configuration transaction" 31 $CONFIGTXGEN -profile TwoOrgsChannel -outputCreateChannelTx crypto/orderer/channel.tx -channelID $CHANNEL_NAME 32 33 echo "Generating anchor peer update for Org0MSP" 34 $CONFIGTXGEN -profile TwoOrgsChannel -outputAnchorPeersUpdate crypto/orderer/Org0MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org0MSP 35 36 echo "Generating anchor peer update for Org1MSP" 37 $CONFIGTXGEN -profile TwoOrgsChannel -outputAnchorPeersUpdate crypto/orderer/Org1MSPanchors.tx -channelID $CHANNEL_NAME -asOrg Org1MSP