Spinning up an Arweave miner
Cluutch’s goal for the end of 2021 is to launch some sort of “weed of the day” NFT along with the daily price updates. This week’s post goes off on a bit of a tangent to setup an Arweave miner.
What is Arweave?
A few weeks ago, I went through the motions of creating a Metaplex marketplace (looks like I broke the DNS when I recently migrated to Cloudflare). I’m unsure if its a hard requirement, but the official Metaplex instructions tell you to upload NFT image data to Arweave.
I’m going to try to make time to read the official yellow-paper, but in the interim, this blurb seems clear enough:
Unlike in a traditional blockchain, where miners are forced to expend electricity in order to earn tokens, in the Arweave network miners are also encouraged to replicate valuable data (the information stored in the network) in order to gain tokens. This mechanism offsets the value that is normally wasted in blockchain networks, with useful, energy efficient storage of data.
Setting up an Arweave miner
I’m really intrigued by crypto projects that offer a benefit other than just facilitating financial transactions. At the same time, Arweave is seeing a lot of growth, so might as well learn a little bit more about it by setting up a miner.
The best way to setup a miner may be to follow the official instructions literally. But I’m testing this on an obscure VPS and want the solution to be portable in case I want to scale up to a more legit setup down the road. Although it’s not well maintained, I’m using an open source project from Salt Labs to generate a Docker image.
Here’s a rundown of the hiccups to get things working. Until the original project shows more action, I’ll be working off of Cluutch’s fork.
Protocol 'inet_tcp': register/listen error: econnrefused
The steps below will spin up an Arweave miner in minutes but the resulting image will have connections issues.
$ git clone https://github.com/salt-labs/arweave-miner && cd arweave-miner
$ docker build --build-arg VERSION=2.5.0.0 --build-arg ARWEAVE_VERSION=2.5.0.0 .
$ docker run -e ARWEAVE_REWARD_ADDRESS="XYZ" -p 1984:1984 IMAGE_SHA
There is an open issue to solve this more elegantly and securely, but for the moment, switching to host networking and removing port forwarding resolves things.
Failed to download wallet tree chunk, retrying
This solution outputs logs to /arweave/log
and /arweave/logs
. After switching to host networking, the miner will appear to startup, but closer inspection of the logs will show failures to download any data. This happens when the necessary sysctl parameters are not correctly set.
Although the Docker build does copy over relevant configs, these files are ignored when a container is in host networking mode. As a workaround, you can edit /etc/sysctl.conf
directly on the host. In my case, I’m using the host exclusively for the Arweave miner so I’m not worried about conflicts.
Verifying the installation
With those two fixes, docker-compose up
will start up successfully. You can check with:
# curl localhost:1984/info
{"network":"arweave.N.1","version":5,"release":50,"height":830252,"current":"OGt8-sbUlAIWRChrJyWJE5L0ZAj0iJyXsI9GBJ8TxyD6W8soRvS9SkqULMkAgRDZ","blocks":599,"peers":1097,"queue_length":0,"node_state_latency":0}
This is the output after having the miner running for about 6 hours. One gotcha is that the docker-compose file is currently hardcoded to point at the latest Cluutch image. You can generate your own image (but feel free to use ours) by forking the repo, and opening a pull request, which will trigger a Github workflow. If you’ve added a Github secret ARWEAVE_VERSION
to your repo, the build will finish successfully.
I’ll report back next week about earnings and stability.