-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup_verichain.sh
More file actions
executable file
·62 lines (49 loc) · 1.84 KB
/
setup_verichain.sh
File metadata and controls
executable file
·62 lines (49 loc) · 1.84 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
#
# Copyright IBM Corp All Rights Reserved
#
# SPDX-License-Identifier: Apache-2.0
#
# Script to setup VeriChain 4-Org Consortium Network
ROOTDIR=$(cd "$(dirname "$0")" && pwd)
export PATH="${ROOTDIR}/bin:${PWD}/bin:$PATH"
export FABRIC_CFG_PATH="${PWD}/config"
export VERBOSE=true
. scripts/utils.sh
# Cleanup
infoln "Cleaning up previous network artifacts..."
docker-compose -f compose/compose-test-net.yaml down --volumes --remove-orphans
./network.sh down
# Generate Crypto
infoln "Generating crypto material for all 4 Orgs..."
if [ -d "organizations/peerOrganizations" ]; then
rm -Rf organizations/peerOrganizations && rm -Rf organizations/ordererOrganizations
fi
which cryptogen
if [ "$?" -ne 0 ]; then
fatalln "cryptogen tool not found. exiting"
fi
cryptogen generate --config=./organizations/cryptogen/crypto-config-orderer.yaml --output="organizations"
cryptogen generate --config=./organizations/cryptogen/crypto-config-org1.yaml --output="organizations"
cryptogen generate --config=./organizations/cryptogen/crypto-config-org2.yaml --output="organizations"
cryptogen generate --config=./organizations/cryptogen/crypto-config-org3.yaml --output="organizations"
cryptogen generate --config=./organizations/cryptogen/crypto-config-org4.yaml --output="organizations"
# Generate CCP files
./organizations/ccp-generate.sh
# Start Network
infoln "Starting Network..."
DOCKER_SOCK="/var/run/docker.sock"
docker-compose -f compose/compose-test-net.yaml up -d 2>&1
# Wait for containers
sleep 5
# Create Channel
infoln "Creating Channel 'verichain-channel'..."
# Using the updated createChannel.sh which now handles 4 orgs
./scripts/createChannel.sh verichain-channel 3 5 true 0
# API Setup
infoln "Installing API dependencies..."
pushd verichain-api
npm install
popd
infoln "VeriChain Network Setup Complete!"
infoln "API is ready in ./verichain-api"