Browse Source

Merge branch 'feat_mydojo_bitcoind_listen_mode' into 'develop'

add new configuration property BITCOIND_LISTEN_MODE

See merge request dojo/samourai-dojo!166
use-env-var-docker
kenshin-samourai 4 years ago
parent
commit
60fa6dd875
  1. 4
      docker/my-dojo/.env
  2. 9
      docker/my-dojo/bitcoin/restart.sh
  3. 5
      docker/my-dojo/conf/docker-bitcoind.conf.tpl
  4. 1
      docker/my-dojo/docker-compose.yaml
  5. 14
      docker/my-dojo/dojo.sh
  6. 13
      docker/my-dojo/tor/restart.sh

4
docker/my-dojo/.env

@ -12,10 +12,10 @@ COMPOSE_CONVERT_WINDOWS_PATHS=1
DOJO_VERSION_TAG=1.9.0
DOJO_DB_VERSION_TAG=1.2.0
DOJO_BITCOIND_VERSION_TAG=1.8.0
DOJO_BITCOIND_VERSION_TAG=1.9.0
DOJO_NODEJS_VERSION_TAG=1.9.0
DOJO_NGINX_VERSION_TAG=1.5.0
DOJO_TOR_VERSION_TAG=1.5.0
DOJO_TOR_VERSION_TAG=1.6.0
DOJO_EXPLORER_VERSION_TAG=1.3.0
DOJO_INDEXER_VERSION_TAG=1.1.0
DOJO_WHIRLPOOL_VERSION_TAG=1.2.0

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