This repository contains all the material needed to start mining on Alephium blockchain.
⚠️ ⚠️ ⚠️ Please keep in mind this is not a production setup, use it at your own risks!
It is based on docker, docker-compose and ubuntu linux version 20.04, and works out of the box with this setup.
The setup contains multiple parts, a.k.a:
- the broker, Alephium full node, storing the blockchain and communicating with other nodes
- the miner, Alephium miner, securing the chain
- the mining-companion, performing coordination duty between the miner and the broker
- the init module, to initialise some directory structures
- prometheus, a timeserie datastore because metrics are king
- mtail, to collect miner metrics
- grafana, a metrics visualisation tool, because metrics are king :)
curl -L https://raw.githubusercontent.com/alephium/alephium-miner-getting-started/main/getting-started-ubuntu2004.sh | bash
Next you can edit the file $HOME/.alephium-miner-setup/.env
, and particularly
configure an transfer address under the config parameter miningTransferAddress
.
The mining companion will start transferring the mined ALPH to this wallet every 15 minutes.
Get involvement in the vibrant community in the Alephium Discord server.
For the miner:
cd $HOME/.alephium-miner-setup; docker-compose logs miner
To get mined blocks:
cd $HOME/.alephium-miner-setup; docker-compose logs miner | grep -i mined
For the broker:
cd $HOME/.alephium-miner-setup; docker-compose logs broker
To retrieve the mnemonic of your mining wallet:
cd $HOME/.alephium-miner-setup; docker-compose logs mining-companion | grep "SENSITIVE"
At startup, a service called alephium is started (/etc/systemd/system/alephium.service
). It will perform
the following operation, in sequence:
- The init container creates the required directory structure with some permissive permissions.
- The broker starts, connect to the
mainnet
, and start synching - The mining companion starts, and check is a mining wallet exists. If no, it creates one, printing the mnemonics in the logs (see below how to get the logs)
- The mining companion configures the mining key of the broker
- The miner waits (container restart) until the broker is synched with the chain, and starts mining.
And that's it, the whole process takes about 20 minutes at the time of writing.