-
Notifications
You must be signed in to change notification settings - Fork 184
/
generate-orderer.sh
executable file
·20 lines (15 loc) · 1.15 KB
/
generate-orderer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash
############################################################
# DEPRECATED
# see inside-container scripts
############################################################
source lib.sh
: ${ORDERER_GENESIS_PROFILE:=SoloOrdererGenesis}
#[ -d "crypto-config/ordererOrganizations/$DOMAIN" ] && exit TODO: adjust for docker-machine
set -x
cryptogenTemplate="templates/cryptogen-orderer-template.yaml"
[ -f "templates/cryptogen-${ORDERER_GENESIS_PROFILE}-template.yaml" ] && cryptogenTemplate="templates/cryptogen-${ORDERER_GENESIS_PROFILE}-template.yaml"
EXECUTE_BY_ORDERER=1 envSubst "${cryptogenTemplate}" "crypto-config/cryptogen-orderer.yaml"
EXECUTE_BY_ORDERER=1 runCLI "rm -rf crypto-config/ordererOrganizations && cryptogen generate --config=crypto-config/cryptogen-orderer.yaml && chown $UID -R crypto-config/"
EXECUTE_BY_ORDERER=1 envSubst "templates/configtx-template.yaml" "crypto-config/configtx.yaml"
EXECUTE_BY_ORDERER=1 runCLI "mkdir -p crypto-config/configtx && configtxgen -configPath crypto-config/ -outputBlock crypto-config/configtx/genesis.pb -profile ${ORDERER_GENESIS_PROFILE} -channelID orderer-system-channel "