Skip to content

Commit a000f96

Browse files
committed
feat: Add Docker connection instructions for Bitcoin node
1 parent 8c13c6f commit a000f96

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,89 @@ You will need to disable the notify fallback in your configuration file if you a
141141
blocknotify=wget -q -O /dev/null http://datum-gateway:7152/NOTIFY
142142
```
143143

144+
### Connecting to a Bitcoin Node
145+
146+
When running the DATUM Gateway in Docker, you need to configure it to connect to your Bitcoin node. The connection method depends on where your Bitcoin node is running:
147+
148+
#### 1. Bitcoin Node Running in Docker (Same Network)
149+
150+
If your Bitcoin node is also running in a Docker container on the same network, use the container name as the hostname:
151+
152+
```json
153+
{
154+
"rpc_host": "bitcoin-node",
155+
"rpc_port": 8332,
156+
"rpc_user": "your_rpc_user",
157+
"rpc_pass": "your_rpc_password"
158+
}
159+
```
160+
161+
In your `bitcoin.conf`, set the blocknotify to use the DATUM Gateway container name:
162+
163+
```
164+
blocknotify=wget -q -O /dev/null http://datum-gateway:7152/NOTIFY
165+
```
166+
167+
#### 2. Bitcoin Node Running on Host System
168+
169+
If your Bitcoin node is running directly on the host system or in a container that binds to host ports, you have two options:
170+
171+
**Option A: Using host.docker.internal (recommended)**
172+
```json
173+
{
174+
"rpc_host": "host.docker.internal",
175+
"rpc_port": 8332,
176+
"rpc_user": "your_rpc_user",
177+
"rpc_pass": "your_rpc_password"
178+
}
179+
```
180+
181+
**Option B: Using host networking mode**
182+
Run the DATUM Gateway container with `--network host`:
183+
184+
```bash
185+
docker run --network host -v /path/to/config:/app/config datum_gateway
186+
```
187+
188+
Then configure using localhost:
189+
```json
190+
{
191+
"rpc_host": "localhost",
192+
"rpc_port": 8332,
193+
"rpc_user": "your_rpc_user",
194+
"rpc_pass": "your_rpc_password"
195+
}
196+
```
197+
198+
For blocknotify in `bitcoin.conf` when using host networking:
199+
```
200+
blocknotify=wget -q -O /dev/null http://localhost:7152/NOTIFY
201+
```
202+
203+
#### 3. Bitcoin Node on Remote System
204+
205+
If your Bitcoin node is running on a different machine, use the hostname or IP address:
206+
207+
```json
208+
{
209+
"rpc_host": "192.168.1.100",
210+
"rpc_port": 8332,
211+
"rpc_user": "your_rpc_user",
212+
"rpc_pass": "your_rpc_password"
213+
}
214+
```
215+
216+
In your remote Bitcoin node's `bitcoin.conf`:
217+
```
218+
blocknotify=wget -q -O /dev/null http://datum-gateway-host-ip:7152/NOTIFY
219+
```
220+
221+
**Important Notes:**
222+
- Ensure your Bitcoin node's RPC is configured to accept connections from the DATUM Gateway
223+
- For remote connections, you may need to configure `rpcbind` and `rpcallowip` in your `bitcoin.conf`
224+
- Always use strong RPC credentials and consider network security when exposing RPC endpoints
225+
- Remember to disable the notify fallback in your DATUM Gateway configuration when using Docker
226+
144227
## Template/Share Requirements for Pooled Mining
145228

146229
- Must be a valid block and conform to current Bitcoin consensus rules

0 commit comments

Comments
 (0)