Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,88 @@ Some services include health checks:
- **NATS**: Verifies the message broker is healthy
- Other services depend on NATS being healthy before starting

## Using External Bitcoin Node

If you're already running Bitcoin Core and ebpf-extractor (either locally or on another machine), you can run just the monitoring services:

```bash
docker compose -f monitoring-only.yml --profile monitoring up -d
```

### Local Setup (Same Machine)

When running the monitoring stack on the **same machine** as your Bitcoin node:

1. **Start the monitoring services**:
```bash
docker compose -f monitoring-only.yml --profile monitoring up -d
```

2. **Configure ebpf-extractor** to connect to localhost:
```bash
./ebpf-extractor --nats-address nats://localhost:4222 --bitcoind-path /path/to/bitcoind
```

### Remote Setup (Different Machines)

When running the monitoring stack on a **different machine** than your Bitcoin node:

1. **On the monitoring server**, start the services:
```bash
docker compose -f monitoring-only.yml --profile monitoring up -d
```

2. **On your Bitcoin node machine**, configure ebpf-extractor to connect remotely:
```bash
# Replace MONITORING_SERVER_IP with your monitoring server's IP address
./ebpf-extractor --nats-address nats://MONITORING_SERVER_IP:4222 --bitcoind-path /path/to/bitcoind
```

### Managing Individual Services

Start specific monitoring tools as needed:
```bash
# Start all monitoring tools
docker compose -f monitoring-only.yml --profile monitoring up -d

# Or start individual tools
docker compose -f monitoring-only.yml --profile logger up -d
docker compose -f monitoring-only.yml --profile metrics up -d
docker compose -f monitoring-only.yml --profile websocket up -d
docker compose -f monitoring-only.yml --profile connectivity-check up -d
```

### Verify Setup

1. **Check NATS connectivity**:
```bash
docker compose -f monitoring-only.yml logs nats
```

2. **Verify ebpf-extractor is publishing events**:
```bash
docker compose -f monitoring-only.yml logs logger
```

### Requirements
- Bitcoin Core must be compiled with USDT support (`-DWITH_USDT=ON`)
- ebpf-extractor must run on the same host as bitcoind
- For remote setups: Network connectivity between machines on port 4222

### Security Considerations for Remote Setup
- Use firewall rules to restrict NATS access to your Bitcoin node's IP
- Consider VPN or SSH tunneling between machines
- For production: Enable NATS authentication and TLS
- Monitor logs for unauthorized connection attempts

## Troubleshooting

### Common Issues

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

### Logs

Expand Down
25 changes: 25 additions & 0 deletions monitoring-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Docker Compose configuration for monitoring services only
# Use this when running Bitcoin node and ebpf-extractor externally
#
# Usage:
# docker compose -f monitoring-only.yml --profile monitoring up -d
#
# Configuration:
# LOCAL setup (monitoring on same machine as Bitcoin node):
# ./ebpf-extractor --nats-address nats://localhost:4222 --bitcoind-path /path/to/bitcoind
#
# REMOTE setup (monitoring on different machine):
# ./ebpf-extractor --nats-address nats://MONITORING_SERVER_IP:4222 --bitcoind-path /path/to/bitcoind
#
# Security Note:
# NATS port 4222 is exposed. For remote setups, consider:
# - Firewall rules to restrict access
# - NATS authentication/TLS for production
# - VPN or SSH tunneling between machines

include:
- path: docker-compose/nats.yml
- path: docker-compose/logger.yml
- path: docker-compose/connectivity-check.yml
- path: docker-compose/metrics.yml
- path: docker-compose/websocket.yml