-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate.sh
More file actions
executable file
·25 lines (21 loc) · 853 Bytes
/
generate.sh
File metadata and controls
executable file
·25 lines (21 loc) · 853 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
# SPDX-License-Identifier: Apache-2.0
export PATH=$GOPATH/src/github.com/hyperledger/fabric/build/bin:${PWD}/../bin:${PWD}:$PATH
export FABRIC_CFG_PATH=${PWD}
CHANNEL_NAME=$1
ORGANIZATION_NAME=$2
# Create config and crypto-config if not exists
mkdir -p config/
# remove previous crypto material and config transactions
rm -fr config/*
# generate channel configuration transaction
configtxgen -profile Channel -outputBlock ./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 Channel -outputAnchorPeersUpdate ./config/${ORGANIZATION_NAME}MSPanchors.tx -channelID $CHANNEL_NAME -asOrg ${ORGANIZATION_NAME}MSP
if [ "$?" -ne 0 ]; then
echo "Failed to generate anchor peer update for MSP..."
exit 1
fi