-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-qtum.sh
executable file
·38 lines (33 loc) · 1.11 KB
/
run-qtum.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
curr_dir=$(cd $(dirname $0); pwd)
QTUM_DOCKER_IP=
QTUM_NETWORK=${QTUM_NETWORK:-"regtest"}
QTUM_CHAIN_DATA="$curr_dir/$QTUM_NETWORK/qtum_data"
mkdir -p "$QTUM_CHAIN_DATA"
DOCKER_QTUM_NETWORK=qtum_network_bridge
if [ "$QTUM_NETWORK" = "regtest" ] ; then
QTUM_DOCKER_IP=${QTUM_DOCKER_IP:-"192.168.168.168"}
elif [ "$QTUM_NETWORK" = "testnet" ] ; then
QTUM_DOCKER_IP=${QTUM_DOCKER_IP:-"192.168.168.111"}
else
echo "fatal - cannot recognize qtum network ${QTUM_NETWORK}, exiting!"
exit -1
fi
echo "ok - connecting to Qtum $QTUM_NETWORK on IP $QTUM_DOCKER_IP"
docker run -it --rm \
--name qtum_shell_cli \
-e "QTUM_NETWORK=$QTUM_NETWORK" \
--entrypoint '' \
--mount "type=bind,src=$QTUM_CHAIN_DATA,dst=/dapp" \
--mount type=bind,source=$curr_dir/qtum-ipfs,target=/home/ipfsuser/qtum-ipfs \
-u $(id -u $USER) \
--network=$DOCKER_QTUM_NETWORK \
--ip 192.168.168.100 \
--publish 127.0.0.1:3000:3000 \
--publish 127.0.0.1:5001:5001 \
--publish 127.0.0.1:8080:8080 \
-e QTUM_RPC_USER="qtum" \
-e QTUM_RPC_PASS="test" \
-e QTUM_RPC="http://qtum:test@${QTUM_DOCKER_IP}:3889" \
ipfs-qtum-dev \
sh