This repository contains Docker configuration files to run the INRI Chain miner node using Docker containers instead of systemd.
- Docker
- Docker Compose
- net-tools (for port checking)
-
Clone this repository:
git clone <repository-url> cd inri-miner-docker
-
Make the startup scripts executable:
chmod +x start-miner.sh chmod +x start-miner-with-port-check.sh
Before starting the miner, you need to set your wallet address:
export WALLET="0xYourWalletAddress"Optionally, you can set the number of mining threads:
export MINER_THREADS=4This script automatically checks for available ports and starts the miner:
./start-miner-with-port-check.sh-
Build and start the container:
docker-compose up -d
-
View logs:
docker-compose logs -f
-
Stop the miner:
docker-compose down
-
Build the image:
docker build -t inri-miner . -
Run the container:
docker run -d \ --name inri-miner \ -p 8545:8545 \ -p 8546:8546 \ -p 30303:30303 \ -p 30303:30303/udp \ -e WALLET=$WALLET \ -e MINER_THREADS=$MINER_THREADS \ inri-miner
-
View logs:
docker logs -f inri-miner
-
Stop and remove the container:
docker stop inri-miner docker rm inri-miner
The following ports are used by the miner:
8545: HTTP RPC8546: WebSocket RPC30303: P2P network (TCP and UDP)
If these ports are already in use, the port checking script will automatically find available ports.
Blockchain data is stored in a Docker volume named inri-data to persist data between container restarts.
If you encounter issues:
- Check that your wallet address is correctly set and formatted
- Verify that the required ports are available on your system
- Check the container logs for error messages
- Ensure net-tools is installed for port checking functionality
# Attach to the running node console
docker exec -it inri-miner geth attach /root/inri/geth.ipc// Check your wallet balance
eth.getBalance("0xYourWalletAddress")
// Convert to ethers (if it's in wei)
web3.fromWei(eth.getBalance("0xYourWalletAddress"), "ether")// Latest block number
eth.blockNumber
// Details of the latest block
eth.getBlock("latest")
// Latest block number (readable format)
eth.getBlockByNumber("latest").number
// Miner address of the latest block
eth.getBlockByNumber("latest").miner// Compare miner address with yours
eth.getBlockByNumber("latest").miner === "0xYourWalletAddress"var yourAddress = "0xYourWalletAddress", lastBlock = eth.blockNumber, minedBlocks = []; for (var i = 0; i <= lastBlock; i++) { var block = eth.getBlock(i); if (block.miner.toLowerCase() === yourAddress.toLowerCase()) { minedBlocks.push(block.number); } } minedBlocksvar count = 0; var yourAddress = "0xYourWalletAddress"; var lastBlock = eth.blockNumber; for (var i = 0; i <= lastBlock; i++) { var block = eth.getBlock(i); if (block.miner.toLowerCase() === yourAddress.toLowerCase()) { count++; } } countexit