Skip to content
Open
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ dist/
*.egg-info

htmlcov/

claude.md
.claude/
81 changes: 81 additions & 0 deletions docker-compose.dev-miner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Example docker-compose for running tx-mining-service in dev-miner mode.
#
# BEFORE (production-like test setup):
#
# fullnode ──stratum──▶ tx-mining-service ◀──stratum──── cpuminer
# ▲
# │ HTTP
# test runner
#
# AFTER (dev-miner setup):
#
# fullnode ◀──HTTP──── tx-mining-service (dev-miner mode)
# ▲
# │ HTTP
# test runner
#
# The cpuminer container is eliminated entirely. tx-mining-service handles
# both block production (background loop) and transaction PoW (in-process).
#
# Usage:
# docker compose -f docker-compose.dev-miner.yml up
#
# To use this from another project's docker-compose, build the image first:
# docker build -t hathornetwork/dev-miner .
# Then reference it in your compose file.

services:
fullnode:
# This image must include the --test-mode-block-weight flag, which is a
# proposed change to hathor-core that reduces block weight to 1 (bypassing
# the DAA), just like --test-mode-tx-weight does for transactions.
# See: https://github.com/HathorNetwork/hathor-core (branch: feature/test-mode-block-weight)
image: hathor-core:test-mode-block-weight
command: [
"run_node",
"--status", "8080",
# Reduce transaction weight to ~1 (existing flag, already used in tests).
"--test-mode-tx-weight",
# Reduce block weight to 1 (NEW flag from this RFC). Without this, blocks
# still require full DAA weight, making in-process mining impractical.
"--test-mode-block-weight",
"--allow-mining-without-peers",
"--unsafe-mode", "nano-testnet-bravo",
"--data", "./tmp",
]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/v1a/status"]
interval: 5s
timeout: 5s
retries: 10
ports:
- "8080:8080"
networks:
- hathor-privnet

tx-mining-service:
platform: linux/amd64
build: .
depends_on:
fullnode:
condition: service_healthy
ports:
- "8035:8035"
command: [
"http://fullnode:8080",
# Enables dev-miner mode (RunDevService instead of RunService).
"--dev-miner",
"--api-port=8035",
# Produce one block per second. This gives tests a predictable cadence
# for reward lock releases and confirmation accumulation.
"--block-interval=1000",
"--testnet",
# Mining rewards go to this address. In test environments, this is
# typically a pre-generated address from the test wallet.
"--address", "WTjhJXzQJETVx7BVXdyZmvk396DRRsubdw",
]
networks:
- hathor-privnet

networks:
hathor-privnet:
Loading