Browse Source

Merge pull request #12 from Samourai-Wallet/feat_mydojo_rpc_api2

extend support of external apps
feat-mydojo_upgrade_explorer
kenshin samourai 5 years ago
committed by GitHub
parent
commit
3a560f6eef
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      doc/DOCKER_advanced_setups.md
  2. 57
      docker/my-dojo/bitcoin/restart.sh
  3. 4
      docker/my-dojo/conf/docker-bitcoind.conf.tpl
  4. 2
      docker/my-dojo/overrides/bitcoind.rpc.expose.yaml

2
doc/DOCKER_advanced_setups.md

@ -68,8 +68,10 @@ nano ./conf/docker-bitcoind.conf
``` ```
With this setting, external applications running on your local machine should be able to access the following ports: With this setting, external applications running on your local machine should be able to access the following ports:
* 9500: bitcoind zmqpubhashtx notifications
* 9501: bitcoind zmqpubrawtx notifications * 9501: bitcoind zmqpubrawtx notifications
* 9502: bitcoind zmqpubhashblock notifications * 9502: bitcoind zmqpubhashblock notifications
* 9503: bitcoind zmqpubrawblock notifications
* 28256: bitcoind RPC API * 28256: bitcoind RPC API
Note: this option has no effect if your setup relies on a external full node (i.e. if BITCOIND_INSTALL is set to "off"). Note: this option has no effect if your setup relies on a external full node (i.e. if BITCOIND_INSTALL is set to "off").

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

@ -2,26 +2,37 @@
set -e set -e
echo "## Start bitcoind #############################" echo "## Start bitcoind #############################"
bitcoind -datadir=/home/bitcoin/.bitcoin \
-server=1 \ bitcoind_options=(
-listen=1 \ -bind=172.28.1.5
-bind=172.28.1.5 \ -datadir=/home/bitcoin/.bitcoin
-port=8333 \ -dbcache=$BITCOIND_DB_CACHE
-proxy=172.28.1.4:9050 \ -disablewallet=1
-rpcport=28256 \ -dns=$BITCOIND_DNS
-rpcallowip=::/0 \ -dnsseed=$BITCOIND_DNSSEED
-rpcbind=172.28.1.5 \ -externalip=$(cat /var/lib/tor/hsv2bitcoind/hostname)
-txindex=1 \ -listen=1
-disablewallet=1 \ -maxconnections=$BITCOIND_MAX_CONNECTIONS
-zmqpubhashblock=tcp://0.0.0.0:9502 \ -maxmempool=$BITCOIND_MAX_MEMPOOL
-zmqpubrawtx=tcp://0.0.0.0:9501 \ -mempoolexpiry=$BITCOIND_MEMPOOL_EXPIRY
-dbcache=$BITCOIND_DB_CACHE \ -minrelaytxfee=$BITCOIND_MIN_RELAY_TX_FEE
-dnsseed=$BITCOIND_DNSSEED \ -port=8333
-dns=$BITCOIND_DNS \ -proxy=172.28.1.4:9050
-rpcuser=$BITCOIND_RPC_USER \ -rpcallowip=::/0
-rpcpassword=$BITCOIND_RPC_PASSWORD \ -rpcbind=172.28.1.5
-maxconnections=$BITCOIND_MAX_CONNECTIONS \ -rpcpassword=$BITCOIND_RPC_PASSWORD
-maxmempool=$BITCOIND_MAX_MEMPOOL \ -rpcport=28256
-mempoolexpiry=$BITCOIND_MEMPOOL_EXPIRY \ -rpcthreads=$BITCOIND_RPC_THREADS
-minrelaytxfee=$BITCOIND_MIN_RELAY_TX_FEE \ -rpcuser=$BITCOIND_RPC_USER
-externalip=$(cat /var/lib/tor/hsv2bitcoind/hostname) -server=1
-txindex=1
-zmqpubhashblock=tcp://0.0.0.0:9502
-zmqpubrawtx=tcp://0.0.0.0:9501
)
if [ "$BITCOIND_RPC_EXTERNAL" == "on" ]; then
bitcoind_options+=(-zmqpubhashtx=tcp://0.0.0.0:9500)
bitcoind_options+=(-zmqpubrawblock=tcp://0.0.0.0:9503)
fi
bitcoind "${bitcoind_options[@]}"

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

@ -22,6 +22,10 @@ BITCOIND_MAX_MEMPOOL=1024
# Type: integer # Type: integer
BITCOIND_DB_CACHE=1024 BITCOIND_DB_CACHE=1024
# Number of threads to service RPC calls
# Type: integer
BITCOIND_RPC_THREADS=6
# Mempool expiry in hours # Mempool expiry in hours
# Defines how long transactions stay in your local mempool before expiring # Defines how long transactions stay in your local mempool before expiring
# Type: integer # Type: integer

2
docker/my-dojo/overrides/bitcoind.rpc.expose.yaml

@ -4,5 +4,7 @@ services:
bitcoind: bitcoind:
ports: ports:
- "${BITCOIND_RPC_EXTERNAL_IP}:28256:28256" - "${BITCOIND_RPC_EXTERNAL_IP}:28256:28256"
- "${BITCOIND_RPC_EXTERNAL_IP}:9500:9500"
- "${BITCOIND_RPC_EXTERNAL_IP}:9501:9501" - "${BITCOIND_RPC_EXTERNAL_IP}:9501:9501"
- "${BITCOIND_RPC_EXTERNAL_IP}:9502:9502" - "${BITCOIND_RPC_EXTERNAL_IP}:9502:9502"
- "${BITCOIND_RPC_EXTERNAL_IP}:9503:9503"

Loading…
Cancel
Save