-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
76 lines (73 loc) · 2.56 KB
/
Copy pathdocker-compose.yml
File metadata and controls
76 lines (73 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# =============================================================================
# Casini — Bitcoin Testnet4 Mining & Scale Testing Infrastructure
# =============================================================================
#
# Usage:
# docker compose up -d bitcoin-node # Start node, begin syncing
# docker compose up -d miner # Start mining (after node synced)
# docker compose logs -f miner # Watch mining progress
#
# =============================================================================
services:
# ---------------------------------------------------------------------------
# Bitcoin Core — Testnet4 Full Node
# ---------------------------------------------------------------------------
bitcoin-node:
build:
context: ./bitcoin-node
dockerfile: Dockerfile
image: casini-bitcoin-node
container_name: casini-bitcoin-node
restart: unless-stopped
ports:
- "127.0.0.1:48332:48332" # RPC — localhost only
- "48333:48333" # P2P — public for peer discovery
- "127.0.0.1:28332:28332" # ZMQ raw blocks
- "127.0.0.1:28333:28333" # ZMQ raw tx
- "127.0.0.1:28334:28334" # ZMQ hash tx
- "127.0.0.1:28335:28335" # ZMQ hash block
volumes:
- bitcoin-data:/home/bitcoin/.bitcoin
- ./bitcoin-node/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf:ro
healthcheck:
test: ["CMD", "bitcoin-cli", "-datadir=/home/bitcoin/.bitcoin", "getblockchaininfo"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 512M
# ---------------------------------------------------------------------------
# CPU Miner — Solo mines testnet4 blocks using generatetoaddress
# ---------------------------------------------------------------------------
miner:
build:
context: ./miner
dockerfile: Dockerfile
image: casini-miner
container_name: casini-miner
restart: unless-stopped
depends_on:
bitcoin-node:
condition: service_healthy
environment:
- BITCOIN_RPC_HOST=bitcoin-node
- BITCOIN_RPC_PORT=48332
- BITCOIN_RPC_USER=${BITCOIN_RPC_USER}
- BITCOIN_RPC_PASSWORD=${BITCOIN_RPC_PASSWORD}
- MINING_TARGET_BTC=${MINING_TARGET_BTC:-500}
- MINING_WALLET=mining
- BLOCKS_PER_BATCH=1
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 128M
volumes:
bitcoin-data:
name: casini-bitcoin-data