======================================================================== Setting Up DATUM Gateway with Bit-Block (Linux, Windows, macOS) ======================================================================== DATUM (by OCEAN) lets you build your own block templates for solo or pool mining, instead of trusting a pool operator to decide what goes into the next block. IMPORTANT PLATFORM NOTE: DATUM Gateway's own documentation states plainly: "Linux-based operating system. Other OSs will be supported in the future." It genuinely only runs natively on Linux today. For Windows and macOS, this guide uses Docker -- DATUM Gateway does ship an official Dockerfile, so this is a real, supported path, not a workaround. Docker Desktop runs a small Linux virtual machine under the hood on both Windows and macOS, which is how a Linux-only program runs there at all. This assumes Bit-Block is already installed and synced on whichever machine will run it. If not, see the earlier build/install guides first. ------------------------------------------------------------------------ STEP 1: Turn on "Mine with DATUM" in Bit-Block (all platforms) ------------------------------------------------------------------------ This replaces a chunk of manual bitcoin.conf editing that DATUM's own documentation normally asks for. GUI (bitcoin-qt): Settings -> Options -> Mempool tab -> check "Mine with DATUM" -> OK -> restart when prompted. Command line: add to your bitcoin.conf, then restart Bit-Block: datum=1 Your bitcoin.conf location depends on your OS: Linux: ~/.bitcoin/bitcoin.conf Windows: %LOCALAPPDATA%\Bitcoin\bitcoin.conf macOS: ~/Library/Application Support/Bitcoin/bitcoin.conf What "datum=1" actually does: turns on txindex, enables the RPC server, sizes block templates to leave room for the pool's coinbase transaction, increases mempool size, and turns on a template-refresh ZMQ hint (see the note near the end of this guide). If this is the first time txindex has been enabled, Bit-Block will need to reindex the blockchain once -- this can take a while. What this does NOT do (still needs manual setup below): DATUM Gateway's own RPC login credentials, and telling DATUM Gateway when a new block arrives. Wait for Bit-Block to fully sync (and reindex, if applicable) before continuing. Check with bitcoin-cli (or bitcoin-cli.exe on Windows): bitcoin-cli getblockchaininfo Look for "initialblockdownload": false. ------------------------------------------------------------------------ STEP 2: Give DATUM Gateway RPC access ------------------------------------------------------------------------ Add an RPC user to bitcoin.conf (replace with your own strong password, or use Bit-Block's rpcauth.py helper script to generate a proper hashed credential instead of a plaintext password): rpcuser=datum rpcpassword=choose-a-strong-password-here If Bit-Block and DATUM Gateway will run on different machines (or in a Docker container, per the Windows/macOS sections below), also add: rpcallowip= rpcbind=0.0.0.0 (Leave rpcbind unset, and skip rpcallowip, if both run on the exact same machine with DATUM Gateway installed natively -- the Linux section below does not need this.) Restart Bit-Block after editing bitcoin.conf. ======================================================================== LINUX -- native install (the officially supported path) ======================================================================== ------------------------------------------------------------------------ STEP 3 (Linux): Install build dependencies ------------------------------------------------------------------------ Debian/Ubuntu: sudo apt install cmake pkgconf libcurl4-openssl-dev libjansson-dev libsodium-dev libmicrohttpd-dev psmisc Fedora/RHEL-family: sudo dnf install cmake pkgconf libcurl-devel jansson-devel libsodium-devel libmicrohttpd-devel psmisc (psmisc provides "killall", used below for new-block notifications.) ------------------------------------------------------------------------ STEP 4 (Linux): Build DATUM Gateway ------------------------------------------------------------------------ Always clone from GitHub directly -- the project's own releases explicitly warn not to use the "Source code" download links. git clone https://github.com/OCEAN-xyz/datum_gateway.git cd datum_gateway cmake -DCMAKE_C_FLAGS="-O2 -g0" . make (Some guides suggest adding -march=native for a small performance boost. Skip it if you might ever move this binary to different hardware -- it makes the build specific to the CPU it was compiled on.) Copy the example config to get started: cp doc/example_datum_gateway_config.json datum_gateway_config.json Open datum_gateway_config.json and fill in at minimum: - Your Bitcoin RPC connection details (host 127.0.0.1, the RPC user from Step 2) - A valid Bitcoin payout address (DATUM Gateway will not start without one, even if you plan to mine to a pool) ------------------------------------------------------------------------ STEP 5 (Linux): New-block notifications ------------------------------------------------------------------------ Add to bitcoin.conf: blocknotify=killall -USR1 datum_gateway This assumes Bit-Block and DATUM Gateway run as the same user on the same machine, which is the normal Linux setup. Restart Bit-Block after adding this. ------------------------------------------------------------------------ STEP 6 (Linux): Run it ------------------------------------------------------------------------ ./datum_gateway Dashboard: http://localhost:7152 Point your ASIC miners' Stratum settings at this machine's IP and the Stratum port set in your config file. ======================================================================== WINDOWS -- via Docker ======================================================================== ------------------------------------------------------------------------ STEP 3 (Windows): Install Docker Desktop ------------------------------------------------------------------------ Download and install Docker Desktop from docker.com. During setup, accept the option to use the WSL2 backend (the default on modern Windows) -- this is what actually provides the Linux environment DATUM Gateway needs. Launch Docker Desktop and make sure it says "Running" before continuing. ------------------------------------------------------------------------ STEP 4 (Windows): Build the DATUM Gateway container image ------------------------------------------------------------------------ Open PowerShell: git clone https://github.com/OCEAN-xyz/datum_gateway.git cd datum_gateway docker build -t datum_gateway . This uses the project's own Dockerfile, so it builds the real, official software -- not a third-party repackaging. ------------------------------------------------------------------------ STEP 5 (Windows): Create your config file ------------------------------------------------------------------------ copy doc\example_datum_gateway_config.json datum_gateway_config.json Edit datum_gateway_config.json: - Bitcoin RPC host: use host.docker.internal instead of 127.0.0.1 -- this is Docker Desktop's special hostname that lets a container reach the Windows machine running it (a plain 127.0.0.1 inside a container refers to the container itself, not your PC). - The RPC user/password from Step 2. - A valid Bitcoin payout address. ------------------------------------------------------------------------ STEP 6 (Windows): New-block notifications (Docker-friendly approach) ------------------------------------------------------------------------ The killall-based blocknotify from the Linux section doesn't reach into a Docker container. Use Bit-Block's ZMQ block notification instead, which crosses the container boundary over a normal network port. Add to bitcoin.conf: zmqpubhashblock=tcp://0.0.0.0:28332 (0.0.0.0 rather than 127.0.0.1, so the container -- which is not "localhost" from Bit-Block's point of view -- can actually connect.) Then point DATUM Gateway's config at tcp://host.docker.internal:28332 for its own ZMQ block-notification setting, if it has one in your version's config -- check datum_gateway_config.json's comments, since exact field names can change between releases. ------------------------------------------------------------------------ STEP 7 (Windows): Run it ------------------------------------------------------------------------ docker run -d --name datum_gateway ` -p 7152:7152 ` -v ${PWD}\datum_gateway_config.json:/app/datum_gateway_config.json ` datum_gateway Add another -p flag for your Stratum port (check datum_gateway_config.json for the port number), e.g. -p 23334:23334, so ASIC miners on your network can actually reach the container. Dashboard: http://localhost:7152 View logs: docker logs -f datum_gateway ======================================================================== macOS -- via Docker ======================================================================== ------------------------------------------------------------------------ STEP 3 (macOS): Install Docker Desktop ------------------------------------------------------------------------ Download Docker Desktop for Mac from docker.com -- pick the Apple Silicon or Intel build matching your Mac (Apple menu -> About This Mac). Launch it and wait for it to say "Running." Note on Apple Silicon specifically: DATUM Gateway's Dockerfile isn't confirmed to publish official multi-architecture (arm64) images, and this guide can't promise the build step below will produce a native arm64 image. Docker Desktop can still typically build and run an x86_64 image via emulation on Apple Silicon, just slower than a native build would be. If you hit build errors specific to your Mac's chip, that's the most likely cause. ------------------------------------------------------------------------ STEP 4 (macOS): Build the DATUM Gateway container image ------------------------------------------------------------------------ Open Terminal: git clone https://github.com/OCEAN-xyz/datum_gateway.git cd datum_gateway docker build -t datum_gateway . ------------------------------------------------------------------------ STEP 5 (macOS): Create your config file ------------------------------------------------------------------------ cp doc/example_datum_gateway_config.json datum_gateway_config.json Edit datum_gateway_config.json: - Bitcoin RPC host: use host.docker.internal (same reasoning as the Windows section -- Docker Desktop provides this hostname on macOS too). - The RPC user/password from Step 2. - A valid Bitcoin payout address. ------------------------------------------------------------------------ STEP 6 (macOS): New-block notifications (Docker-friendly approach) ------------------------------------------------------------------------ Same reasoning as Windows -- blocknotify's killall command can't reach into the container. Add to bitcoin.conf: zmqpubhashblock=tcp://0.0.0.0:28332 Then configure DATUM Gateway's own ZMQ block-notification setting (if present in your version) to tcp://host.docker.internal:28332. ------------------------------------------------------------------------ STEP 7 (macOS): Run it ------------------------------------------------------------------------ docker run -d --name datum_gateway \ -p 7152:7152 \ -v $(pwd)/datum_gateway_config.json:/app/datum_gateway_config.json \ datum_gateway Add another -p flag for your Stratum port, matching your config file. Dashboard: http://localhost:7152 View logs: docker logs -f datum_gateway ======================================================================== About the new template-refresh hint (all platforms, optional/advanced) ======================================================================== Turning on "Mine with DATUM" also enables a Bit-Block-specific ZMQ notification (topic "templatehint") that pings whenever the mempool changes enough that a fresher, more profitable block template might be worth pulling. This does not exist in stock Bitcoin Core or Knots. Important: stock DATUM Gateway does not know how to listen for this topic out of the box -- it currently discovers new mempool activity by polling getblocktemplate on its own schedule. This hint is a hook for the future, or for anyone comfortable writing a small companion script that subscribes to it (default tcp://127.0.0.1:28338 -- on Windows/ macOS Docker setups, publish it the same way as zmqpubhashblock above if you want a container to reach it). It's safe to leave enabled even if nothing is using it yet. ======================================================================== Getting help ======================================================================== The OCEAN Discord has dedicated DATUM support and development channels -- the most active place to ask questions, especially for anything Docker/Windows/macOS-specific, since the DATUM project's own documentation and community experience center on the officially supported Linux path. ========================================================================