Mine testnet Base tokens
Last updated
Last updated
To learn more about mining's technical details, please refer to the mining guide.The following is a condensed version of the walkthrough for a Linux system. If you are using Windows or MacOS, some slight modifications may be necessary (PR's welcome!).
To participate as a miner on testnet, you must have access to a testnet bitcoin node with a wallet (and the wallet's private key). One way to accomplish this is to run bitcoin locally.
First, download a
Next, update the bitcoin configuration:
optional but recommended: Use a persistent directory to store the Bitcoin chainstate, i.e. datadir=/bitcoin
optional but recommended: Update the rpcallowip
value to only allow 127.0.0.1
, or the base miner IPv4
Modify the rpcuser
and rpcpassword
values from the defaults below
Store the following configuration somewhere on your filesystem (ex: $HOME/bitcoin.conf
)
Finally, start bitcoind as follows:
While it's syncing, you can track the progress with bitcoin-cli
or the logfile (will be located where the chainstate is stored, i.e. /bitcoin/testnet3/debug.log
):
First, download a Base blockchain binary, or build from source
First, a keychain needs to be generated. With this keychain, we'll get some testnet BTC from a faucet, and then use that BTC to start mining.
To create a keychain, the simplest way is to use the base-cli with the make_keychain
command.
After this runs, you should see some JSON printed to the screen that looks like this:
The above btcAddress
(mkRYR7KkPB1wjxNjVz3HByqAvVz8c4B6ND) will then need to be imported into the bitcoin testnet network.
Now, we need to configure our node to use this Bitcoin keychain.
Now, grab your privateKey
from earlier when you ran the make_keychain
command. Replace the seed
and local_peer_seed
field with your private key. Save and close this configuration file.
Next, update the bitcoin configuration:
optional but recommended: Use a persistent directory to store the Base chainstate, i.e. working_dir = "/base-blockchain"
From the make_keychain
step, modify the seed
and local_peer_seed
values with privatekey
Store the following configuration somewhere on your filesystem (ex: $HOME/testnet-miner-conf.toml
)
To run your miner, run this in the command line:
Your node should start. It will take some time to sync, and then your miner will be running.
In case you are running into issues or would like to see verbose logging, you can run your node with debug logging enabled. In the command line, run:
Alternatively, you can run a Base testnet miner with Docker.
Generate a keychain:
Now, we need to get some tBTC. Grab the btcAddress
field, and paste it into this Bitcoin testnet faucet. You'll be sent 0.01
tBTC to that address.
You can review the node logs with this command:
In addition, you're also able to run a Base miner in a Kubernetes cluster.
Ensure you have the following prerequisites installed:
To install the chart with the release name my-release
and run the node as a miner:
You can review the node logs with this command:
Once imported, we need to get some testnet BTC to that address. Grab the btcAddress
field, and paste it into . You'll be sent 0.01
testnet BTC to that address.
Ensure you have installed
Use the steps oulined above to create the
(Only needed if standing up a local Kubernetes cluster)
Use the steps