Skip to content

Bitcoind setups

By default, Dojo installs and runs bitcoind inside Docker.

This guide covers advanced bitcoind configuration options available in docker-bitcoind.conf.

All commands are to be copy and pasted into the terminal of your Dojo, then press ENTER.

Terminal window
cd ~/dojo-app/docker/my-dojo/conf/
nano docker-bitcoind.conf

If you want Dojo to use a full node outside Docker, set:

Terminal window
BITCOIND_INSTALL=off
BITCOIND_IP=TypeYourBitcoindIPHere
BITCOIND_RPC_PORT=TypeYourBitcoindRpcPortHere
BITCOIND_RPC_USER=TypeYourBitcoindRpcUserHere
BITCOIND_RPC_PASSWORD=TypeYourBitcoindRpcPasswordHere
BITCOIND_ZMQ_RAWTXS=TypeYourBitcoindZmqRawTxPortHere
BITCOIND_ZMQ_BLK_HASH=TypeYourBitcoindZmqBlockHashPortHere

Your external bitcoind should be configured with:

  • server=1
  • txindex=1
  • RPC enabled on a reachable IP and port
  • ZMQ rawtx and hashblock notifications enabled

Then apply changes:

Terminal window
cd ~/dojo-app/docker/my-dojo
./dojo.sh upgrade

By default, these ports are restricted to Dojo’s internal Docker network. Do not expose these ports to the public internet.

Set:

Terminal window
BITCOIND_INSTALL=on
BITCOIND_RPC_EXTERNAL=on

For Linux, keep:

Terminal window
BITCOIND_RPC_EXTERNAL_IP=127.0.0.1

For macOS or Windows Docker hosts, set BITCOIND_RPC_EXTERNAL_IP to the IP address of the Docker VM.

Then apply changes:

Terminal window
cd ~/dojo-app/docker/my-dojo
./dojo.sh upgrade

With this setting, these local ports are exposed:

  • 28256 bitcoind RPC
  • 9500 ZMQ hash tx notifications
  • 9501 ZMQ raw tx notifications
  • 9502 ZMQ hash block notifications
  • 9503 ZMQ raw block notifications

By default, Dojo rotates the bitcoind hidden service address on restart.

To keep a static address, set:

Terminal window
BITCOIND_EPHEMERAL_HS=off

Then apply changes:

Terminal window
cd ~/dojo-app/docker/my-dojo
./dojo.sh upgrade

This setting only applies when BITCOIND_INSTALL=on and BITCOIND_LISTEN_MODE=on.

To enable bloom filter support for compatible light clients, set:

Terminal window
BITCOIND_BLOOM_FILTERS=on

It is also recommended to keep a static onion address for this setup:

Terminal window
BITCOIND_EPHEMERAL_HS=off

Then apply changes:

Terminal window
cd ~/dojo-app/docker/my-dojo
./dojo.sh upgrade

This is useful when your chain data should be stored on another disk.

  1. Find the bitcoind UID and GID used by Dojo:
Terminal window
cd ~/dojo-app/docker/my-dojo
grep -E '^BITCOIND_LINUX_UID=|^BITCOIND_LINUX_GID=' .env
  1. Create your target directory:
Terminal window
sudo mkdir -p /external/bitcoin
  1. Set ownership to the UID and GID from .env (defaults are usually 1105:1108):
Terminal window
sudo chown -R 1105:1108 /external/bitcoin
  1. Edit docker-bitcoind.conf and set:
Terminal window
BITCOIND_BLOCKS_DIR=/external/bitcoin
  1. Apply changes:
Terminal window
cd ~/dojo-app/docker/my-dojo
./dojo.sh upgrade