25 lines
804 B
Bash
Executable File
25 lines
804 B
Bash
Executable File
#!/bin/bash
|
|
|
|
export FABRIC_CFG_PATH=${PWD}/network/config/
|
|
|
|
rm -rf ./network/organizations ./network/channel-artifacts
|
|
mkdir -p ./network/channel-artifacts
|
|
|
|
cryptogen generate --config=./network/config/crypto-config.yaml --output=./network/organizations
|
|
if [ "$?" -ne 0 ]; then
|
|
echo "Failed to generate certificates..."
|
|
exit 1
|
|
fi
|
|
|
|
echo "--- Generating genesis block for Hospital profile ---"
|
|
configtxgen -profile HospitalGenesis -outputBlock ./network/channel-artifacts/genesis.block -channelID system-channel
|
|
if [ "$?" -ne 0 ]; then
|
|
echo "Failed to generate genesis block..."
|
|
exit 1
|
|
fi
|
|
|
|
configtxgen -profile HospitalChannel -outputCreateChannelTx ./network/channel-artifacts/mychannel.tx -channelID mychannel
|
|
if [ "$?" -ne 0 ]; then
|
|
echo "Failed to generate channel transaction..."
|
|
exit 1
|
|
fi |