-
Notifications
You must be signed in to change notification settings - Fork 0
/
network-starter.sh
38 lines (27 loc) · 2.01 KB
/
network-starter.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
31
32
33
34
35
36
37
38
#!/bin/bash
#
# SPDX-License-Identifier: Apache-2.0
//Reference: https://hyperledger-fabric.readthedocs.io/en/release-2.2/tutorial/commercial_paper.html
function _exit(){
printf "Exiting:%s\n" "$1"
exit -1
}
# Exit on first error, print all commands.
set -ev
set -o pipefail
# Where am I?
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export FABRIC_CFG_PATH="${DIR}/../config"
cd "${DIR}/../test-network/"
docker kill cliDigiBank cliMagnetoCorp logspout || true
./network.sh down
./network.sh up createChannel -ca -s couchdb
# Copy the connection profiles so they are in the correct organizations.
cp "${DIR}/../test-network/organizations/peerOrganizations/org1.example.com/connection-org1.yaml" "${DIR}/organization/pharmacy/gateway/"
cp "${DIR}/../test-network/organizations/peerOrganizations/org2.example.com/connection-org2.yaml" "${DIR}/organization/pharmacy/gateway/"
cp ${DIR}/../test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/* ${DIR}/../test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]
cp ${DIR}/../test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/* ${DIR}/../test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk
cp ${DIR}/../test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/* ${DIR}/../test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected]
cp ${DIR}/../test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/* ${DIR}/../test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk
echo Suggest that you monitor the docker containers by running
echo "./organization/magnetocorp/configuration/cli/monitordocker.sh net_test"