Mine and mint proof-of-work XPOW tokens on Avalanche; see: xpowermine.com
4.0K
WARNING: Mining can seriously damage your device due to intensive CPU usage. Use at your own risk.
Containerized Deno-based cryptocurrency mining service for XPower tokens on the Avalanche blockchain.
This Docker container runs the XPower cryptocurrency miner, which:
Technology Stack:
bookworm-slim)./docker/xpowermine/miner/build.sh
Or directly:
docker build -t xpowermine/miner -f docker/xpowermine/miner/Dockerfile .
Blockchain Configuration:
CONTRACT_RUN=v11b # Optional: Smart contract version (v11a, v11b, etc.)
Minting Configuration:
INIT_ADDRESS_PK=0x... # Optional: Private key for init transaction signing
MINT_ADDRESS_PK=0x... # Required: Private key for mint transaction signing
MINT_ADDRESS=0x... # Required: Beneficiary address for minted tokens
Blockchain Connection(s):
PROVIDER_URL=https://avalanche.drpc.org,https://avalanche-c-chain-rpc.publicnode.com,https://api.avax.network/ext/bc/C/rpc
Mining Parameters:
MINT_LEVEL=8 # Default: 8 (proof-of-work difficulty, 2^8-1=255 XPOW minimum)
MINE_WORKERS=7 # Default: 7 (number of mining workers, set to cores-1)
MINT_BATCH=1 # Default: 1 (nonces per mint-batch transaction)
Gas Parameters (Optional):
MAX_PRIORITY_FEE_PER_GAS=0 # Default: auto (0 recommended to avoid extra fees)
MAX_FEE_PER_GAS=500000000 # Default: auto (0.5 Gwei recommended)
GAS_LIMIT=100000 # Default: auto (0.1 Mwei recommended)
docker run --rm -ti \
-e PROVIDER_URL="$PROVIDER_URL" \
-e CONTRACT_RUN="$CONTRACT_RUN" \
-e INIT_ADDRESS_PK="$INIT_ADDRESS_PK" \
-e MINT_ADDRESS_PK="$MINT_ADDRESS_PK" \
-e MINT_ADDRESS="$MINT_ADDRESS" \
-e MINT_LEVEL="$MINT_LEVEL" \
-e MINE_WORKERS="$MINE_WORKERS" \
-e MINT_BATCH="$MINT_BATCH" \
xpowermine/miner
# Set custom gas parameters
export MAX_PRIORITY_FEE_PER_GAS=0 # 0.0 gwei
export MAX_FEE_PER_GAS=500000000 # 0.5 gwei
export GAS_LIMIT=100000 # 0.1 mwei
# Run with custom gas settings
docker run --rm -ti \
-e PROVIDER_URL="$PROVIDER_URL" \
-e CONTRACT_RUN="$CONTRACT_RUN" \
-e INIT_ADDRESS_PK="$INIT_ADDRESS_PK" \
-e MINT_ADDRESS_PK="$MINT_ADDRESS_PK" \
-e MINT_ADDRESS="$MINT_ADDRESS" \
-e MINT_LEVEL="$MINT_LEVEL" \
-e MINE_WORKERS="$MINE_WORKERS" \
-e MINT_BATCH="$MINT_BATCH" \
-e MAX_PRIORITY_FEE_PER_GAS="$MAX_PRIORITY_FEE_PER_GAS" \
-e MAX_FEE_PER_GAS="$MAX_FEE_PER_GAS" \
-e GAS_LIMIT="$GAS_LIMIT" \
xpowermine/miner
The container runs mine.sh once at startup and then every hour via the
Supercronic scheduler (mine.cron). Each run kills the previous mining session
and starts a fresh one, ensuring workers always mine against a recent block
hash. Supercronic inherits the container environment, so variables passed with
docker run -e ... remain available to every hourly run — no extra setup is
required.
Instead of passing MINT_ADDRESS and {MINT,INIT}_ADDRESS_PK as environment
variables, mine.sh can read them from files (e.g. Docker / Swarm secrets). If
the corresponding environment variable is unset, mine.sh falls back to:
| Variable | File path |
|---|---|
MINT_ADDRESS | /var/run/secrets/mint-address |
MINT_ADDRESS_PK | /var/run/secrets/mint-address-pk |
INIT_ADDRESS_PK | /var/run/secrets/init-address-pk |
Example with bind-mounted secret files:
docker run --rm -ti \
-e CONTRACT_RUN="$CONTRACT_RUN" \
-v /path/to/mint-address:/var/run/secrets/mint-address:ro \
-v /path/to/mint-address-pk:/var/run/secrets/mint-address-pk:ro \
-v /path/to/init-address-pk:/var/run/secrets/init-address-pk:ro \
xpowermine/miner
Default: https://api.avax.network/ext/bc/C/rpc
The public RPC endpoint of the Avalanche network works well most of the time. However, if your container is behind a popular VPN or your minting frequency is high, using your own custom endpoint is recommended.
Recommendation: Use the default unless you experience rate limiting or connectivity issues.
Default: MINT_ADDRESS_PK
The private key of an address that holds AVAX to pay for init transaction
costs. If not provided, then by default the MINT_ADDRESS_PK is used.
Security Recommendations:
The private key of an address that holds AVAX to pay for mint transaction costs.
Security Recommendations:
The beneficiary address that will receive the mined and minted XPOW tokens.
Security Recommendations:
MINT_ADDRESS_PK for operational securityDefault: 8
Controls the minimum proof-of-work difficulty. Only work corresponding to
2^MINT_LEVEL - 1 XPOW or more will be minted.
Trade-offs:
Recommendation: 8 or higher for current state-of-the-art CPUs. This
provides a good balance between energy consumption and minting costs.
Default: 7
Number of parallel mining workers (threads) to use.
Recommendation: Set to one LESS than your total CPU cores to avoid system lockup.
Examples:
MINE_WORKERS=3MINE_WORKERS=7MINE_WORKERS=15Check your CPU count: nproc or lscpu
Default: 1
Number of mined nonces that xpow-mint groups into a single mintBatch
transaction. With 1, each nonce is minted individually via mint (the
historical behavior).
Trade-offs:
Requirements:
CONTRACT_RUN must implement
mintBatch; otherwise minting reverts.GAS_LIMIT accordingly (a mintBatch of N nonces costs more than N
individual mint calls). GAS_LIMIT is not scaled automatically.Default: Auto (blockchain determines)
Priority fee paid to validators for transaction inclusion.
Recommendation: 0 (zero) to avoid paying extra fees. This seems to work
well on Avalanche. Increase to 1000000000 (1 Gwei) only if transactions are
regularly rejected.
Default: Auto (blockchain determines)
Maximum total gas fee willing to pay per transaction.
Recommendation: 500000000 (0.5 Gwei) or less. Increase to 1000000000 (1
Gwei) only if transactions are regularly rejected.
Default: Auto (blockchain determines)
Maximum gas units to use for each transaction.
Recommendation: 100000 (0.1 Mwei). This value seems to work reliably for
minting operations.
Private Key Management:
INIT_ADDRESS_PK to version controlMINT_ADDRESS_PK to version controlMINT_ADDRESS)Resource Management:
Network Security:
Container Logs:
docker logs -f xpowermine-miner
Resource Usage:
docker stats xpowermine-miner
System Temperature (if available):
sensors # Linux with lm-sensors
Transactions rejected:
MAX_FEE_PER_GAS and/or MAX_PRIORITY_FEE_PER_GASMINT_ADDRESS_PK addressPROVIDER_URL is accessibleLow mining performance:
MINE_WORKERS (but leave at least 1 core free)Container exits:
docker logs xpowermine-minerMINT_ADDRESS_PK and CONTRACT_RUN are correctGPL-3.0 - See project repository for details.
Content type
Image
Digest
sha256:10309b08b…
Size
139.1 MB
Last updated
2 days ago
docker pull xpowermine/miner