This project sets up a local Bitcoin Knots node and a DATUM Gateway instance using Docker Compose. It allows easy orchestration, persistent volumes, and dynamic configuration using environment variables.
-
Bitcoin Knots (
bitcoind)
A Bitcoin node built from source with--disable-wallet. -
[DATUM Gateway]
Decentralized Mining
git clone https://github.com/electricalgrade/bitcoin
git clone https://github.com/OCEAN-xyz/datum_gatewayMake sure Dockerfiles are present in each directory:
bitcoin/contrib/docker/Dockerfiledatum_gateway/Dockerfile
Build the Bitcoin Knots image:
cd bitcoin
docker build -t bitcoinknots-custom .Build the DATUM Gateway image:
cd ../../datum_gateway
docker build -t datum-gateway-custom .update .env file in the same directory as your docker-compose.yml:
# .env
# Host volume for Bitcoin node data
BITCOIN_DATA_PATH=/your/local/path/to/bitcoin-data
BITCOIN_CONF_PATH=/your/local/path/to/bitcoin.conf
# Host volume for DATUM Gateway config
DATUM_CONFIG_PATH=/absolute/path/to/datum_config
# RPC Connection Details
BITCOIN_RPC_HOST=bitcoind
BITCOIN_RPC_PORT=8332
BITCOIN_RPC_USER= Shold be genrated by the script
BITCOIN_RPC_PASSWORD= should be generated by the scipt✅ Use absolute paths for volume mounts. ❗ Replace RPC credentials to match your
bitcoin.conf.
In your ${DATUM_CONFIG_PATH}/config.json, provide the correct RPC connection:
{
"rpc_host": "bitcoind",
"rpc_port": 8332,
"rpc_user": "bitcoin",
"rpc_pass": "secret123"
}Ensure the file exists before you start the containers.
In your bitcoin.conf (on the host, within BITCOIN_DATA_PATH), set:
rpcuser=bitcoin
rpcpassword=secret123
blocknotify=wget -q -O /dev/null http://datum_gateway:7152/NOTIFYdocker compose up -d-
bitcoind exposes ports:
8333: P2P8332: RPC
-
datum_gateway exposes:
23334: connect you miners to this port7152: Notification endpoint
project-root/
├── docker-compose.yml
├── .env
├── bitcoin_data/ # Mapped volume for bitcoind
├── datum_config/
│ └── config.json # Your DATUM Gateway config
You get the IP address of the host machine on which docker compose is running. The host port 23334 is connected to datum gateay docker.
In statum IP : port : 23334
You can verify both services are running:
docker ps
docker logs datum_gateway
docker logs bitcoindTo stop and remove everything:
docker compose downMIT License — your usage may vary depending on upstream licenses of Bitcoin Knots and DATUM Gateway.