forked from aws-samples/hyperledger-on-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
start-fabric.sh
executable file
·71 lines (66 loc) · 2.56 KB
/
start-fabric.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Builds the main Fabric network on a Kubernetes cluster.
# This script can be rerun if it fails. It will simply rerun the K8s commands, which will have
# no impact if they've been run previously
set -e
function main {
echo "Beginning setup of Hyperledger Fabric on Kubernetes ..."
cd $HOME/$REPO/fabric-main
source util-prep.sh
updateRepo $HOME $REPO
makeDirs $DATADIR
copyScripts $HOME $REPO $DATADIR
source $SCRIPTS/env.sh
cd $HOME/$REPO/fabric-main
source utilities.sh
makeDirsForOrg $DATADIR
genTemplates $HOME $REPO
createNamespaces $HOME $REPO
startKafka $HOME $REPO
startPVC $HOME $REPO
startRCA $HOME $REPO
startICA $HOME $REPO
startRegisterOrgs $HOME $REPO
sleep 30
startRegisterOrderers $HOME $REPO
startRegisterPeers $HOME $REPO
if [ $FABRIC_NETWORK_TYPE == "PROD" ]; then
startOrdererNLB $HOME $REPO
startAnchorPeerNLB $HOME $REPO
fi
updateChannelArtifacts $HOME $REPO
startOrderer $HOME $REPO
startPeers $HOME $REPO
if [ $FABRIC_NETWORK_TYPE == "PROD" ]; then
checkNLBHealthy
fi
echo "starting next test case: ABAC"
startTestABAC $HOME $REPO
echo "sleeping for 1 minute before starting next test case: Marbles"
sleep 60
startTestMarbles $HOME $REPO
echo "sleeping for 1 minute before starting next test case: Marbles Workshop"
sleep 60
startTestMarblesWorkshop $HOME $REPO
whatsRunning
echo "Setup of Hyperledger Fabric on Kubernetes complete"
}
SDIR=$(dirname "$0")
DATADIR=/opt/share/
SCRIPTS=$DATADIR/rca-scripts
REPO=hyperledger-on-kubernetes
main