-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabric-docker.sh
executable file
·69 lines (64 loc) · 1.99 KB
/
fabric-docker.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
#!/usr/bin/env bash
set -eu
FABLO_NETWORK_ROOT="$(cd "$(dirname "$0")" && pwd)"
source "$FABLO_NETWORK_ROOT/fabric-docker/scripts/base-help.sh"
source "$FABLO_NETWORK_ROOT/fabric-docker/scripts/base-functions.sh"
source "$FABLO_NETWORK_ROOT/fabric-docker/scripts/chaincode-functions.sh"
source "$FABLO_NETWORK_ROOT/fabric-docker/channel-query-scripts.sh"
source "$FABLO_NETWORK_ROOT/fabric-docker/snapshot-scripts.sh"
source "$FABLO_NETWORK_ROOT/fabric-docker/commands-generated.sh"
source "$FABLO_NETWORK_ROOT/fabric-docker/.env"
networkUp() {
generateArtifacts
startNetwork
generateChannelsArtifacts
installChannels
installChaincodes
installChaincodeTPCC
notifyOrgsAboutChannels
printStartSuccessInfo
}
if [ "$1" = "up" ]; then
case "${2-}" in
--build|-b) buildChaincodeTPCC;;
esac
networkUp
elif [ "$1" = "down" ]; then
networkDown
elif [ "$1" = "reset" ]; then
networkDown
case "${2-}" in
--build|-b) buildChaincodeTPCC;;
esac
networkUp
elif [ "$1" = "start" ]; then
startNetwork
elif [ "$1" = "stop" ]; then
stopNetwork
elif [ "$1" = "chaincode" ] && [ "$2" = "install" ] && [ "$3" = "tpcc" ]; then
installChaincodeTPCC
elif [ "$1" = "chaincodes" ] && [ "$2" = "install" ]; then
installChaincodes
elif [ "$1" = "chaincode" ] && [ "$2" = "install" ]; then
installChaincode "$3" "$4"
elif [ "$1" = "chaincode" ] && [ "$2" = "upgrade" ]; then
upgradeChaincode "$3" "$4"
elif [ "$1" = "chaincode" ] && [ "$2" = "dev" ]; then
runDevModeChaincode "$3" "$4"
elif [ "$1" = "channel" ]; then
channelQuery "${@:2}"
elif [ "$1" = "snapshot" ]; then
createSnapshot "$2"
elif [ "$1" = "clone-to" ]; then
cloneSnapshot "$2" "${3:-""}"
elif [ "$1" = "help" ]; then
printHelp
elif [ "$1" = "--help" ]; then
printHelp
else
echo "No command specified"
echo "Basic commands are: up, down, start, stop, reset"
echo "To list channel query helper commands type: 'fablo channel --help'"
echo "Also check: 'chaincode install'"
echo "Use 'help' or '--help' for more information"
fi