-
Notifications
You must be signed in to change notification settings - Fork 16
/
docker_build.sh
executable file
·58 lines (50 loc) · 1.03 KB
/
docker_build.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
#!/bin/bash
set -eo pipefail
conf_template=docker/config/default._network_.yaml
network=testnet
echo "setup 01cnode for you?"
echo "y/N"
read answer
if [ "$answer" != "y" ];then
echo "aborting."
exit 0
fi
echo "which network to setup?"
echo "1) regtest"
echo "2) testnet"
echo "3) mainnet"
echo "default: $network"
read answer
case "$answer" in
1)
network=regtest
;;
2)
network=testnet
;;
3)
network=mainnet
;;
*)
echo "unknown option $answer, choosing testnet!"
network=testnet
;;
esac
echo "configuring for $network"
# For macOS, use `sed -E`
if [ "$(uname)" == "Darwin" ]; then
config=$(echo ${conf_template}|sed -E 's/_network_/'"$network"'/')
else
config=$(echo ${conf_template}|sed -r 's/_network_/'"$network"'/')
fi
echo "running docker for you"
set -x
cp $config config/default.yaml
set +x
docker build -t 01cnode .
echo ""
echo "edit config/default.yaml to reflect your configuration"
echo "make sure you set the correct rpc username/password"
echo "type ./run.sh to start the container"
echo ""
echo "done."