A Stratum protocol to Full Node RPC adapter for mining.
For now, only Litecoin testnet is supported.
Follow steps below to quickly start the stratum server with LTC testnet node and cpu miner:
-
Clone the repository:
git clone https://github.com/kaunofakultetas/anypool-stratum.git
-
Copy sample docker-compose.yml and stack startup script:
cp ./anypool-stratum/docker-compose.yml.sample docker-compose.yml cp ./anypool-stratum/runUpdateThisStack.sh.sample runUpdateThisStack.sh -
Configure docker-compose.yml environment variables:
nano docker-compose.yml
-
Run the server:
./runUpdateThisStack.sh
-
Check the logs:
sudo docker-compose logs -f
| Variable | Description | Default | Required |
|---|---|---|---|
RPC_HOST |
Full Node RPC host | 127.0.0.1 | ❌ |
RPC_PORT |
Full Node RPC port | 19332 | ❌ |
RPC_USER |
RPC username | admin | ❌ |
RPC_PASS |
RPC password | admin | ❌ |
REWARD_ADDR |
Your cryptocurrency address for mining rewards | ✅ | |
COINBASE_MESSAGE |
Custom message embedded in mined blocks | "/AnyPool by VU Kaunas faculty/" | ❌ |
STRATUM_PORT |
Port for the stratum server | 3333 | ❌ |
POOL_DIFFICULTY |
Mining difficulty | 2048 | ❌ |
POLL_DIFF_DROPPER |
Drop difficulty for miners if network difficulty suddenly drops even lower then pool's fixed difficulty | false | ❌ |
By default, docker-compose.yml file contains a cpuminer container that can be used to mine.
If you want to mine with your external miner, comment this section out.
The stratum server automatically detects and supports:
- Witness Commitments: Automatically includes witness commitments in coinbase transactions when present
- SegWit Transactions: Properly handles SegWit transaction data from block templates
- Address Support: Compatible with both legacy and SegWit address formats
- MWEB Detection: Automatically detects MWEB data in block templates
- Extension Blocks: Properly constructs and submits blocks with MWEB extension data
- Privacy Transactions: Supports mining blocks containing confidential MWEB transactions
- This implementation includes simplified address decoding
- For production use, implement proper base58check decoding
- Consider adding authentication and rate limiting
- Always test on testnet first
- RPC Connection Errors: Check your Litecoin node is running and RPC credentials are correct
- Invalid Address: Make sure REWARD_ADDR is a valid Litecoin testnet address
- Port Conflicts: Change STRATUM_PORT if 3333 is in use
- Low Hash Rate: Adjust POOL_DIFFICULTY for your mining hardware

