STX Mining: Your Easy Contribution

Todd Gruben
3 min readNov 11, 2020
STX

I always try to embark on challenges whether that be physical, mental, or a mix of both. My challenge recently was to implement a STX miner. If you are asking yourself what is STX, check out this article to get started with understanding the STX coin and Hiro ecosystem (aka Blockstack). This was a fun challenge with a learning experience along the way. For new users, do not to be intimidated by setting up a miner, this is nothing like a streamlined Bitcoin mining facility. Below I’ve posted my experience going through this but also a reflection on what mining for a community does.

First and foremost I dive head first into projects without reading the documentation at times. I encourage everyone to read the documentation to run a STX miner with ease. Be sure to note system prerequisites in node operations such as the Rust programming language that the miner relies on. Upon reviewing the docs, there are a couple methods to run a miner, I chose to use the Docker method. For those unfamiliar with Docker, check this out. To put it simply, the advantage of running Docker is that the miner will run in a consistent VM and OS that will not run into conflicts with the host or local machine. Note, you only need minimal Docker and command line knowledge to run a STX miner. As the process goes below, with technical steps laid out in the documentation.

1. First is creating a cryptocurrency address to hold testnet coins in STX and BTC, currently STX mining is on the testnet. Please keep testnet and mainnet changes in mind when going through the documentation.

2. Next step is sending coins to the address recently created. Using a curl command with your recently created address included will populate the address. There is a web GUI to send test coins as well here.

3. After that is creating a config file for Docker to reference when spinning up the container. Within the config file, we replace the private key with the one we generated. Note, this is a configuration file based on the TOML formate.

4. Run the Docker container command provided in the docs. Don’t worry about understanding the command at this time, this requires more in depth Docker knowledge.

5. Lastly, review the logs and ideally will see something like below.

Wow! 5 easy steps and we are up and running with a STX miner probably in a grand total of 15 minutes. Another convenient perk of this set up, when I shut down my machine and want to run a miner again, all I do is run the Docker command we are up running a miner.

For my set up, I’m running my miner on an Intel NUC with Ubuntu OS. But this can easily be configured on a local machine or cloud instance.

Yes, it is easier to run a miner, but why run one in the first place? For a personal gain perspective, miners are frequently rewarded for their mining activity in crypto or STX in this case. The other benefit of running a miner is the contribution to community at large. One great component of blockchain systems is the decentralized, trustless system where transactions are validated on the blockchain. Well, running a miner contributes to the integrity of this system by validating transactions and adding these to the blockchain. Not only does a miner provide personal benefit, it will help add robustness to the system by contributing to the blockchain. Of course, this is a simplified explanation of miner contributions, educate yourself here and go mine!

--

--