mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Change-Id: I751254bc4b2340c33444248050ddffcc8428ab36 Signed-off-by: Christopher Ferris <chrisfer@us.ibm.com>
22 lines
967 B
Bash
Executable file
22 lines
967 B
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# Copyright IBM Corp All Rights Reserved
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
# Exit on first error, print all commands.
|
|
set -ev
|
|
|
|
docker-compose -f docker-compose.yml down
|
|
docker-compose -f docker-compose.yml up -d
|
|
|
|
# wait for Hyperledger Fabric to start
|
|
# incase of errors when running later commands, issue export FABRIC_START_TIMEOUT=<larger number>
|
|
export FABRIC_START_TIMEOUT=10
|
|
#echo ${FABRIC_START_TIMEOUT}
|
|
sleep ${FABRIC_START_TIMEOUT}
|
|
|
|
# Create the channel
|
|
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com" peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/mychannel.tx
|
|
# Join peer0.org1.example.com to the channel.
|
|
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com" peer0.org1.example.com peer channel join -b mychannel.block
|