Browse Source

add new config property BITCOIND_LISTEN_MODE in bitcoind.conf

use-env-var-docker
kenshin-samourai 5 years ago
parent
commit
bf7ae27909
  1. 9
      docker/my-dojo/bitcoin/restart.sh
  2. 5
      docker/my-dojo/conf/docker-bitcoind.conf.tpl
  3. 1
      docker/my-dojo/docker-compose.yaml
  4. 14
      docker/my-dojo/dojo.sh
  5. 13
      docker/my-dojo/tor/restart.sh

9
docker/my-dojo/bitcoin/restart.sh

@ -4,15 +4,12 @@ set -e
echo "## Start bitcoind #############################"
bitcoind_options=(
-bind=172.28.1.5
-datadir=/home/bitcoin/.bitcoin
-printtoconsole=1
-dbcache=$BITCOIND_DB_CACHE
-disablewallet=1
-dns=$BITCOIND_DNS
-dnsseed=$BITCOIND_DNSSEED
-externalip=$(cat /var/lib/tor/hsv2bitcoind/hostname)
-listen=1
-maxconnections=$BITCOIND_MAX_CONNECTIONS
-maxmempool=$BITCOIND_MAX_MEMPOOL
-mempoolexpiry=$BITCOIND_MEMPOOL_EXPIRY
@ -32,6 +29,12 @@ bitcoind_options=(
-zmqpubrawtx=tcp://0.0.0.0:9501
)
if [ "$BITCOIND_LISTEN_MODE" == "on" ]; then
bitcoind_options+=(-listen=1)
bitcoind_options+=(-bind=172.28.1.5)
bitcoind_options+=(-externalip=$(cat /var/lib/tor/hsv2bitcoind/hostname))
fi
if [ "$BITCOIND_RPC_EXTERNAL" == "on" ]; then
bitcoind_options+=(-zmqpubhashtx=tcp://0.0.0.0:9500)
bitcoind_options+=(-zmqpubrawblock=tcp://0.0.0.0:9503)

5
docker/my-dojo/conf/docker-bitcoind.conf.tpl

@ -39,6 +39,11 @@ BITCOIND_MEMPOOL_EXPIRY=72
# Type: numeric
BITCOIND_MIN_RELAY_TX_FEE=0.00001
# Allow incoming connections
# This parameter is inactive if BITCOIND_INSTALL is set to 'off'
# Values: on | off
BITCOIND_LISTEN_MODE=on
#
# EXPERT SETTINGS

1
docker/my-dojo/docker-compose.yaml

@ -92,6 +92,7 @@ services:
context: ./tor
env_file:
- ./.env
- ./conf/docker-bitcoind.conf
- ./conf/docker-explorer.conf
- ./conf/docker-whirlpool.conf
- ./conf/docker-tor.conf

14
docker/my-dojo/dojo.sh

@ -83,8 +83,10 @@ stop() {
# Shutdown the bitcoin daemon
if [ "$BITCOIND_INSTALL" == "on" ]; then
# Renewal of bitcoind onion address
if [ "$BITCOIND_EPHEMERAL_HS" = "on" ]; then
$( docker exec -it tor rm -rf /var/lib/tor/hsv2bitcoind ) &> /dev/null
if [ "$BITCOIND_LISTEN_MODE" == "on" ]; then
if [ "$BITCOIND_EPHEMERAL_HS" = "on" ]; then
$( docker exec -it tor rm -rf /var/lib/tor/hsv2bitcoind ) &> /dev/null
fi
fi
# Stop the bitcoin daemon
$( docker exec -it bitcoind bitcoin-cli \
@ -360,9 +362,11 @@ onion() {
fi
if [ "$BITCOIND_INSTALL" == "on" ]; then
V2_ADDR_BTCD=$( docker exec -it tor cat /var/lib/tor/hsv2bitcoind/hostname )
echo "Your local bitcoind (do not share) = $V2_ADDR_BTCD"
echo " "
if [ "$BITCOIND_LISTEN_MODE" == "on" ]; then
V2_ADDR_BTCD=$( docker exec -it tor cat /var/lib/tor/hsv2bitcoind/hostname )
echo "Your local bitcoind (do not share) = $V2_ADDR_BTCD"
echo " "
fi
fi
}

13
docker/my-dojo/tor/restart.sh

@ -19,12 +19,17 @@ tor_options=(
--HiddenServiceDir /var/lib/tor/hsv3dojo
--HiddenServiceVersion 3
--HiddenServicePort "80 172.29.1.3:80"
--HiddenServiceDir /var/lib/tor/hsv2bitcoind
--HiddenServiceVersion 2
--HiddenServicePort "8333 172.28.1.5:8333"
--HiddenServiceDirGroupReadable 1
)
if [ "$BITCOIND_INSTALL" == "on" ]; then
if [ "$BITCOIND_LISTEN_MODE" == "on" ]; then
tor_options+=(--HiddenServiceDir /var/lib/tor/hsv2bitcoind)
tor_options+=(--HiddenServiceVersion 2)
tor_options+=(--HiddenServicePort "8333 172.28.1.5:8333")
tor_options+=(--HiddenServiceDirGroupReadable 1)
fi
fi
if [ "$EXPLORER_INSTALL" == "on" ]; then
tor_options+=(--HiddenServiceDir /var/lib/tor/hsv3explorer)
tor_options+=(--HiddenServiceVersion 3)

Loading…
Cancel
Save