Build & Configure DATUM Gateway for Bitcoin Mining 2026
On Ubuntu
This article and video walk through the process of downloading, building and configuring Bitcoin Knots (or BIP-110), and the Ocean DATUM gateway for Bitcoin pool mining on Ubuntu.
I also cover how to do solo mining, which is a two-line tweak in the DATUM configuration file.
You can watch this YouTube video to follow along with all the steps.
References:
https://github.com/OCEAN-xyz/datum_gateway
TCP Ports Used:
7152 DATUM API Gateway and web interface
8331 Bitcoin Knots mainnet zmq
8332 Bitcoin Knots mainnet RPC port
8333 Bitcoin Knots mainnet P2P port
23334 DATUM stratum proxy port (point your miner here)
First Steps
Let's start by making sure your Ubuntu machine is up to date.
sudo apt update && sudo apt upgradeNext, we need to install all the build prerequisites for everything in this guide.
sudo apt install build-essential cmake pkgconf python3 libcurl4-openssl-dev libjansson-dev libsodium-dev libmicrohttpd-dev psmisc libevent-dev libboost-dev libzmq3-dev logrotate avahi-daemon gnupgI like to create a security group for each Bitcoin network I am using. Let’s create a group for mainnet.
sudo groupadd mainnetYou should give your machine a static IP address in your internal network. You can get the private IP address of your machine with this command:
ip route get 8.8.8.8 | awk '{print $7}'Now we need to install a node.
Bitcoin Knots or BIP-110
This section covers installing either Bitcoin Knots or BIP-110. You can choose.
You will need a 2TB drive to run a full node. Ideally, use an SSD. An HDD will take a very long time to complete the initial block download.
First, create a user account to run the Bitcoin node under.
sudo useradd -g mainnet -m -s /bin/bash knots-mainnetNow, become the new user.
sudo su - knots-mainnetNow you get to choose to run either Bitcoin Knots or BIP-110. If you want to run Bitcoin Knots, then use this command:
git clone https://github.com/bitcoinknots/bitcoin.gitOtherwise, if you want to run BIP-110, use this command:
git clone -b v29.3.knots20260210+bip110-v0.4.1 --depth 1 https://github.com/dathonohm/bitcoin.gitLet’s verify that the code has not been tampered with.
cd bitcoin
git verify-tag `git describe`You might get a warning like “gpg: Can’t check signature: No public key”. If so, see if there is a publicly registered key for the displayed hash.
gpg --keyserver keyserver.ubuntu.com --recv-keys "2B97F03293744D70F6BBA82F2E3A66FF67F98B4F"Now, if you do the verify again, it should say something like “Good signature from …”. At the moment, it will be “Luke Dashjr” for Bitcoin Knots or “Dathom Ohm” for BIP-110.
git verify-tag `git describe`Time to get building
The less code you use, the less likely you are to be affected by vulnerabilities and bugs. I don’t use the Bitcoin wallet built into the node software or Tor, so I disable both.
I solo mine with ckpool, and it is more efficient with ZMQ enabled, so I enable ZMQ support. This tutorial is about DATUM, so we won’t dwell on ZMQ.
Lastly, I want the node to be as fast as possible, so I enable all host CPU optimisations. Paste all of this in one go. It checks what is available and configures the build environment.
cmake -B build \
-DENABLE_WALLET=OFF \
-DWITH_ZMQ=ON \
-DENABLE_TOR_SUBPROCESS=OFF \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -g0 -march=native"And now we get to build it! This can take a long time. On my machine, it takes 12 minutes.
cmake --build build -j 4Once it has finished building, we need to create some new directories.
mkdir -p ~/bin ~/.bitcoin
source ~/.profileNow, we’ll create links in our ~/bin directory to these new binaries.
ln -sf ~/bitcoin/build/bin/bitcoin-cli ~/bin/bitcoin-cli
ln -sf ~/bitcoin/build/bin/bitcoind ~/bin/bitcoindConfiguring the Bitcoin Node
We need to generate a random RPC password. Run the following command:
share/rpcauth/rpcauth.py rpcadminYou will get an output that looks something like the following. Save this somewhere. We will be referring to it later when we install DATUM. Especially note “Your password”.
String to be appended to bitcoin.conf:
rpcauth=rpcadmin:154615a...511cee2602c
Your password:
4zM8RQuTudM37Vrfehmf762JqH71EfgT6pharMgHEJACreate a config file for the Bitcoin Node using your favourite editor.
vi ~/.bitcoin/bitcoin.confAnd put this into it (updating the rpcauth line). Note in the video, I accidentally put in “rpcauth=rpcauth=rpcadmin…”. There should only be one “rpcauth=” part.
blockmaxsize=3985000
blockmaxweight=3985000
maxmempool=1000
blockreconstructionextratxn=1000000
rpcauth=rpcadmin:154615a...511cee2602c
zmqpubhashblock=tcp://127.0.0.1:8331
blocknotify=wget -q -O /dev/null http://localhost:7152/NOTIFYAdditional options that I also like to use, that you could consider:
dbcache=4096
logips=1
mempoolexpiry=72
listenonion=0
disablewallet=1
rejecttokens=1
maxscriptsize=1024
assumevalid=000000000000000000012d5e7b4745f92b9cd60241854e38be68d9b182feabcbIf you want to later install an Electrum Server, I would also add:
txindex=1Save the config. We can now run a test of the Bitcoin node.
bitcoindIf there are no errors after 30 seconds, press CTRL-C to stop it. Now we’ll configure the Bitcoin node to run as a systemd service.
We need to go back to being a privileged user:
exitCreate the following file, so the Bitcoin node will auto-start on system boot.
sudo vi /etc/systemd/system/knots-mainnet.serviceAnd add the following text:
[Unit]
Description=Bitcoin Knots mainnet daemon
After=network-online.target
Wants=network-online.target
[Service]
User=knots-mainnet
Group=mainnet
Type=forking
PIDFile=/home/knots-mainnet/.bitcoin/bitcoin.pid
ExecStart=/home/knots-mainnet/bin/bitcoind -daemon -pid=bitcoin.pid
ExecStop=/home/knots-mainnet/bin/bitcoin-cli stop
Restart=always
TimeoutSec=120
RestartSec=30
PrivateTmp=yes
ProtectSystem=full
NoNewPrivileges=yes
PrivateDevices=yes
[Install]
WantedBy=multi-user.targetWe now need to tell systemd to load our changes and start Bitcoin Knots.
sudo systemctl daemon-reload
sudo systemctl enable knots-mainnet.service
sudo systemctl start knots-mainnet.serviceWe can check that it has started running with these commands:
sudo systemctl status knots-mainnet.servicesudo journalctl -xeu knots-mainnet.servicesudo tail /home/knots-mainnet/.bitcoin/debug.logNow we need to configure log rotation. Create the following file (using sudo with your editor) /etc/logrotate.d/knots-mainnet.
sudo vi /etc/logrotate.d/knots-mainnetCopy and paste this config.
/home/knots-mainnet/.bitcoin/debug.log
{
su knots-mainnet mainnet
missingok
notifempty
compress
delaycompress
sharedscripts
copytruncate
}Then restart the service and ensure it is running ok (otherwise we have made a typo).
sudo systemctl restart logrotate.service
sudo systemctl status logrotate.serviceAnd lastly, become the knots-mainnet user again.
sudo su - knots-mainnetThen run some bitcoin-cli commands and make sure it spits out lots of data.
bitcoin-cli -netinfobitcoin-cli getnetworkinfobitcoin-cli getblockchaininfobitcoin-cli getpeerinfoNote that the DATUM gateway will not work properly until the Bitcoin node has finished fully syncing. This can take 3 days on an SSD or 3 weeks on an HDD, thanks to all the spam added to Bitcoin. Be patient. You can monitor the progress with:
tail ~/.bitcoin/debug.logInitially, you’ll see lines like:
2026-03-03T05:51:09Z UpdateTip: ... progress=0.600883 cache=2194.9MiB(16426712txo)...The “progress” value is the percentage of the initial block download (IBD) that has been completed. In the above, it has completed 60% of the download.
Lastly, if you can, NAT tcp/8333 from the Internet (on your ISP router) through to the private IP address of your Ubuntu machine. This turns your node into a “listening” node that can help others on the Bitcoin network.
You should now have a running Bitcoin node up and running. Before starting the next section, let’s return to being the main user you first log in as.
exitDATUM Gateway
Let’s create a new user to run the DATUM gateway under.
sudo useradd -g mainnet -m -s /bin/bash datum-mainnetNow let’s become the new DATUM user.
sudo su - datum-mainnetNow we can clone the GitHub repository.
git clone https://github.com/OCEAN-xyz/datum_gateway.gitA new directory will now have been created called “datum_gateway”. We need to change into that directory.
cd datum_gatewayAt the moment, I can’t find signatures for this repository, so we won’t be able to check if the code has been tampered with. If it was signed, we could use a command like:
git verify-tag `git describe`We are now finally at the point where we can build the DATUM gateway.
cmake -DCMAKE_C_FLAGS="-O2 -g0 -march=native" . && makeDATUM gateway builds quite quickly (in less than 10s on my machine). The next step is to create a configuration file. Let’s start with the example provided.
cp doc/example_datum_gateway_config.json datum_gateway_config.jsonEdit the config file using your favourite editor. I like to use vi.
vi datum_gateway_config.jsonUpdate:
“rpcuser” and “rpcpassword” with the values from earlier in the guide that you used with the node setup.
“notify_fallback” to false.
“pool_address” with your Bitcoin wallet address.
“coinbase_tag_secondary” with a message to go in the Bitcoin block, in case you solve a block.
“admin_password”, if you want to be able to use the web GUI. If you don’t set this, you can’t get stats about your connected miners.
This guide is about pool mining, but if you want to solo mine, then update:
Under “datum”, add “pool_host” and set it to an empty string.
"pool_host": ""“pooled_mining_only” to false.
If you want more info on a particular config item, run this command.
./datum_gateway -?Now we are ready to give it a test run.
./datum_gatewayIt should start up and present no errors. If there are, resolve them before continuing. Otherwise, hit CTRL-C.
Now we need to create a systemd unit so that the DATUM gateway starts automatically. We need to return to the initial user and then create the file.
exitsudo vi /etc/systemd/system/datum-mainnet.serviceAnd add these contents:
[Unit]
Description=DATUM Gateway on mainnet
After=multi-user.target knots-mainnet.service
Requires=knots-mainnet.service
[Service]
User=datum-mainnet
Group=mainnet
Type=simple
Restart=always
WorkingDirectory=/home/datum-mainnet/datum_gateway
ExecStart=/home/datum-mainnet/datum_gateway/datum_gateway
PrivateTmp=yes
ProtectSystem=full
NoNewPrivileges=yes
PrivateDevices=yes
[Install]
WantedBy=multi-user.targetLet’s enable and start the new service (paste in the commands one at a time).
sudo systemctl daemon-reload
sudo systemctl enable datum-mainnet.service
sudo systemctl start datum-mainnet.service
sudo systemctl status datum-mainnet.service
sudo journalctl -xeu datum-mainnet.serviceUsing the DATUM Gateway
Note, you can not use the DATUM gateway until the Bitcoin Node has fully downloaded the blockchain.
Go into your ASIC (such as a BitAxe) pool configuration. Enter the IP address for your Ubuntu machine (as the stratum host), the port (port 23334) and your wallet address in the “User” field. The wallet address can include a “.workername” on the end.
You can monitor the DATUM gateway by pointing a web browser to the IP address of your Ubuntu machine, and appending “:7152”. For example, http://192.168.1.2:7152.
Mine On!
You should now see your Bitcoin miner in the DATUM web GUI and on the Ocean website at https://ocean.xyz/stats/.
Note that new miners might take 5 minutes to show up.
Good luck, and thank you for contributing to Bitcoin.

