Set up your own Public Pool instance on a Start9 node

All our devices come with connection to Public Pool reconfigured. It is a solo (lottery) mining pool, meaning that the rewards are not distributed among the various miners connect to the pool. If someone mines a block, they get to keep the whole reward. Public Pool is open source software, and the official instance we normally connect to, is generously hosted (with 0 fees!) by its creator Ben.

However, if you want to embrace the ideals of technological self sovereignty, and not depend on third parties (as based as they may be), managing your own mining infrastructure is the next step. This guide assumes you already have a Start9 Bitcoin node. If you don’t, do consider getting yourself one, or building one from scratch!

Prerequisite

Heads up! Setting up Public Pool requires you to SSH into your node (from terminal), if you haven’t done this already, you should first generate and set up your SSH key. You can follow Start9 instructions here. You will then have to install and configure a tool called simpleproxy, this will enable non http port forwarding, which is required by Stratum protocol.

Setting up Public Pool on Start9 (compatible with Core or Knots)

First, go to Marketplace, change to Community Registry, search for Public Pool and proceed to install it.

Next, you will need to open up the terminal and login to Start9 over SSH. You will need to either know the local network domain (adjective-noun.local), or the IP, of your Start9 node.

ssh [email protected]

If you provided a password while setting up the SSH key, the command above will prompt you for it.

Once you’ve successfully signed in over SSH, follow these official instructions for installing simpleproxy (copied directly from github, also appear when you click “Instructions” in the Start9 interface):

Switch to the root user:

sudo -i

Run the following command to switch to the “chrooted” environment, any system changes made now will be persisted across reboots.

/usr/lib/startos/scripts/chroot-and-upgrade

Install “simpleproxy”:

apt update && apt install simpleproxy -y

Paste the following, this will create a new systemd service responsible for port forwarding 3333 (Stratum):

cat > /lib/systemd/system/simpleproxy.stratum.service <<'EOL'
[Unit]
Description=simpleproxy stratum forward
Wants=podman.service
After=podman.service

[Service]
Type=simple
Restart=always
RestartSec=3
ExecStartPre=/bin/bash -c "/bin/systemctl set-environment IP=$(ip route | grep default | awk '{print $9}' | head -1)"
ExecStart=/usr/bin/simpleproxy -L ${IP}:3333 -R public-pool.embassy:3333

[Install]
WantedBy=multi-user.target
EOL

Enable the new systemd service:

systemctl enable simpleproxy.stratum

Now exit the chroot environment. this will reboot StartOS! Do NOT close the SSH window manually, actually type exit and let it reboot.

exit

NOTE: do not use the .local or .onion address of this service for mining, use the IP address (and port 3333) of your StartOS device instead.

To get the LAN IP address of your StartOS device, you can run the following command from another device on the same network:

ping -4 adjective-noun.local

where adjective-noun is the name of your StartOS device you normally use to access the web interface.


Once you’ve completed the instructions above, your Start9 will restart. Next, go to Services, click on Public Pool, and click Start. If all is set up correctly, you should see the status turn to “Running”.

Now you can go ahead and enter the Bitaxe/Nerdaxe dashboard. In “Settings”, under “Primary Stratum Pool”, for “Stratum Host” go ahead and enter the IP address of your Start9 device (use the command above to find it). For “Stratum Port”, enter 3333. As always, “Stratum User” is your bitcoin address, and “Stratum Password” doesn’t matter. Save and restart the miner.

Finally, you can check out the Public Pool dashboard, by clicking the “Launch UI” button on Start9’s Public Pool service page.

Or check out the logs, by clicking “Logs” on the Start9’s Public Pool service page.

Above you can see when we first connected the miner to the pool.

Congratulations! You are now mining completely independently from any third parties on your self hosted infrastructure. Your chances of finding a block remain the same as if you were mining with the “public” Public Pool, however you are now resilient to risks like their servers being down. Furthermore, you have more control over what can/cannot enter into the blocks you contrsuct by managing you mempool policy.

Similar Posts