Skip to content

Commit b40f921

Browse files
committed
Add monitoring only option - Bitcoin and ebpf-extractor already running
1 parent 0b4fdb1 commit b40f921

2 files changed

Lines changed: 100 additions & 0 deletions

File tree

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,88 @@ Some services include health checks:
154154
- **NATS**: Verifies the message broker is healthy
155155
- Other services depend on NATS being healthy before starting
156156

157+
## Using External Bitcoin Node
158+
159+
If you're already running Bitcoin Core and ebpf-extractor (either locally or on another machine), you can run just the monitoring services:
160+
161+
```bash
162+
docker compose -f monitoring-only.yml --profile monitoring up -d
163+
```
164+
165+
### Local Setup (Same Machine)
166+
167+
When running the monitoring stack on the **same machine** as your Bitcoin node:
168+
169+
1. **Start the monitoring services**:
170+
```bash
171+
docker compose -f monitoring-only.yml --profile monitoring up -d
172+
```
173+
174+
2. **Configure ebpf-extractor** to connect to localhost:
175+
```bash
176+
./ebpf-extractor --nats-address nats://localhost:4222 --bitcoind-path /path/to/bitcoind
177+
```
178+
179+
### Remote Setup (Different Machines)
180+
181+
When running the monitoring stack on a **different machine** than your Bitcoin node:
182+
183+
1. **On the monitoring server**, start the services:
184+
```bash
185+
docker compose -f monitoring-only.yml --profile monitoring up -d
186+
```
187+
188+
2. **On your Bitcoin node machine**, configure ebpf-extractor to connect remotely:
189+
```bash
190+
# Replace MONITORING_SERVER_IP with your monitoring server's IP address
191+
./ebpf-extractor --nats-address nats://MONITORING_SERVER_IP:4222 --bitcoind-path /path/to/bitcoind
192+
```
193+
194+
### Managing Individual Services
195+
196+
Start specific monitoring tools as needed:
197+
```bash
198+
# Start all monitoring tools
199+
docker compose -f monitoring-only.yml --profile monitoring up -d
200+
201+
# Or start individual tools
202+
docker compose -f monitoring-only.yml --profile logger up -d
203+
docker compose -f monitoring-only.yml --profile metrics up -d
204+
docker compose -f monitoring-only.yml --profile websocket up -d
205+
docker compose -f monitoring-only.yml --profile connectivity-check up -d
206+
```
207+
208+
### Verify Setup
209+
210+
1. **Check NATS connectivity**:
211+
```bash
212+
docker compose -f monitoring-only.yml logs nats
213+
```
214+
215+
2. **Verify ebpf-extractor is publishing events**:
216+
```bash
217+
docker compose -f monitoring-only.yml logs logger
218+
```
219+
220+
### Requirements
221+
- Bitcoin Core must be compiled with USDT support (`-DWITH_USDT=ON`)
222+
- ebpf-extractor must run on the same host as bitcoind
223+
- For remote setups: Network connectivity between machines on port 4222
224+
225+
### Security Considerations for Remote Setup
226+
- Use firewall rules to restrict NATS access to your Bitcoin node's IP
227+
- Consider VPN or SSH tunneling between machines
228+
- For production: Enable NATS authentication and TLS
229+
- Monitor logs for unauthorized connection attempts
230+
157231
## Troubleshooting
158232

159233
### Common Issues
160234

161235
1. **Out of disk space**: Ensure you have sufficient disk space for Bitcoin blockchain data
162236
2. **Memory issues**: Increase Docker's memory limit if containers are being killed
163237
3. **Port conflicts**: Ensure the required ports are not in use by other applications
238+
4. **External connection issues**: Verify firewall rules allow connection to NATS port 4222
164239

165240
### Logs
166241

monitoring-only.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Docker Compose configuration for monitoring services only
2+
# Use this when running Bitcoin node and ebpf-extractor externally
3+
#
4+
# Usage:
5+
# docker compose -f monitoring-only.yml --profile monitoring up -d
6+
#
7+
# Configuration:
8+
# LOCAL setup (monitoring on same machine as Bitcoin node):
9+
# ./ebpf-extractor --nats-address nats://localhost:4222 --bitcoind-path /path/to/bitcoind
10+
#
11+
# REMOTE setup (monitoring on different machine):
12+
# ./ebpf-extractor --nats-address nats://MONITORING_SERVER_IP:4222 --bitcoind-path /path/to/bitcoind
13+
#
14+
# Security Note:
15+
# NATS port 4222 is exposed. For remote setups, consider:
16+
# - Firewall rules to restrict access
17+
# - NATS authentication/TLS for production
18+
# - VPN or SSH tunneling between machines
19+
20+
include:
21+
- path: docker-compose/nats.yml
22+
- path: docker-compose/logger.yml
23+
- path: docker-compose/connectivity-check.yml
24+
- path: docker-compose/metrics.yml
25+
- path: docker-compose/websocket.yml

0 commit comments

Comments
 (0)