forked from ratnakar-asara/e2e
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerateCfgTrx.sh
More file actions
executable file
·30 lines (23 loc) · 924 Bytes
/
generateCfgTrx.sh
File metadata and controls
executable file
·30 lines (23 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
CHANNEL_NAME=$1
if [ -z "$1" ]; then
echo "Setting channel to default name 'mychannel'"
CHANNEL_NAME="mychannel"
fi
echo "Channel name - "$CHANNEL_NAME
echo
#Backup the original configtx.yaml
cp ../../common/configtx/tool/configtx.yaml ../../common/configtx/tool/configtx.yaml.orig
cp configtx.yaml ../../common/configtx/tool/configtx.yaml
cd $PWD/../../
echo "Building configtxgen"
make configtxgen
echo "Generating genesis block"
configtxgen -profile TwoOrgs -outputBlock orderer.block
mv orderer.block examples/e2e/crypto/orderer/orderer.block
echo "Generating channel configuration transaction"
configtxgen -profile TwoOrgs -outputCreateChannelTx channel.tx -channelID $CHANNEL_NAME
mv channel.tx examples/e2e/crypto/orderer/channel.tx
#reset configtx.yaml file to its original
cp common/configtx/tool/configtx.yaml.orig common/configtx/tool/configtx.yaml
rm common/configtx/tool/configtx.yaml.orig