-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate.sh
executable file
·30 lines (25 loc) · 1 KB
/
generate.sh
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
export PATH=$GOPATH/src/github.com/hyperledger/fabric/build/bin:${PWD}/../bin:${PWD}:$PATH
export FABRIC_CFG_PATH=${PWD}
CHANNEL_NAME=diplomachannel
# Create config and crypto-config if not exists
mkdir -p config/
# remove previous crypto material and config transactions
rm -fr config/*
# generate genesis block for orderer
configtxgen -profile OrdererGenesis -outputBlock ./config/genesis.block
if [ "$?" -ne 0 ]; then
echo "Failed to generate orderer genesis block..."
exit 1
fi
# generate channel configuration transaction
configtxgen -profile DiplomaChannel -outputCreateChannelTx ./config/channel.tx -channelID $CHANNEL_NAME
if [ "$?" -ne 0 ]; then
echo "Failed to generate channel configuration transaction..."
exit 1
fi
# generate anchor peer transaction
configtxgen -profile DiplomaChannel -outputAnchorPeersUpdate ./config/GoBlockchainMSPanchors.tx -channelID $CHANNEL_NAME -asOrg GoBlockchainMSP
if [ "$?" -ne 0 ]; then
echo "Failed to generate anchor peer update for GoBlockchainMSP..."
exit 1
fi