This repo contains a simple shell script that will help you set up and run a Miner Node on the Stacks 2.0 Testnet.
Note: the code was updated on 2020/12/15 to run the correct configuration for the Daemon Technologies Mining Competition.
Note: The Xenon phase is not supported by this repository (yet).
This script is designed for and tested with Ubuntu Server 20.04 LTS.
In theory, it should work for any Ubuntu-based installation but YMMV.
If you run into an error, please file an issue with more information.
To run the script, simply use the command below.
curl -sS -o- https://raw.githubusercontent.com/AbsorbingChaos/bks-setup-miner/master/config-miner-krypton.sh | bashIt will download the file from this repository and run it via bash.
To stop the script or the miner (once it's running), press CTRL+C on Linux, or COMMAND+. on MacOS.
The script can be run multiple times, and will complete the following tasks:
- Install or update operating system prerequisites
build-essential cmake libssl-dev pkg-config jq git bc
- Detect or install node version manager (nvm)
- Detect or install Node.js (via nvm)
- Detect or install Rust (via rustup.rs)
- Download or update the stacks-blockchain repository (via git)
- Check out the 24.0.0.0-xenon tagged release for Krypton (via git)
- Detect or create the keychain file (via blockstack-cli make_keychain)
- Detect or request test BTC balance (via keychain file and faucet)
- Detect or download miner configuration file (via GitHub)
- If downloaded, automatically inserts the private key (via keychain file)
- Check test BTC balance before starting the miner process
- Start the miner and try to win the sortitions!
This link will allow you to manually view or download the script, as well as the node configuration file, if you are into that kind of thing.
To run the script in debug mode, there are a few extra steps involved, but it provides a lot of useful information and records the screen output to a file that can be used to report to the team or file an issue on GitHub.
Note: The log file can grow really fast in this mode, so if leaving running for more than one day, be sure to double-check you have enough free space.
First, download the script:
curl -sS -O https://raw.githubusercontent.com/AbsorbingChaos/bks-setup-miner/master/config-miner-krypton.shSecond, run the script with the debug option:
bash config-miner-krypton.sh debugIn addition to the tasks listed above, this will:
- Delete and download a new copy of the stacks-blockchain repository (via git)
- Record the output of
cargo startusing thescriptcommand, to a file namedbks-miner-YYYYMMDD-HHMMSS.txt - Run
cargo startwith the environment variablesBLOCKSTACK_DEBUG=1andRUST_BACKTRACE=full
This file contains a copy of all the terminal output seen on the screen, and is saved if the miner crashes or when the miner is stopped.
To view the status of the blockchain, click the link below.
http://status.test-blockstack.com/
To view a live demonstration of the setup for Virtualbox, Ubuntu Server, and usage of the script, check out the video below!
Before running the script, I recommend setting up a virtual machine using Virtualbox.
A step by step walkthrough of installing Virtualbox and setting up the Ubuntu Server virtual machine can be found at the link below as part of the Zero to Testnet Blog Series:
The specifications I used for my Ubuntu Server virtual machine are listed and pictured below:
- Base Memory: 2048 MB (2gb RAM)
- Video Memory: 16 MB
- Hard Drive: 100 GB
- Network: Bridged Adapter
Please note that this script is released under the MIT License. Please only run this script on a virtual machine setup for the purpose of mining on the Blockstack Stacks 2.0 Testnet, and please do not run this script on any system used in production.
THIS IS FOR TESTING PURPOSES ONLY!
If you run into any issues with the script or have any general questions about the process, feel free to file an issue here, or reach out to me via the Blockstack Discord channel @whoabuddy.