Mining Webdollar in a Container

Do repost and rate:

Hello and welcome to another installment of Awesome Self Hosted!

Today we are going to be looking at mining WebDollar (WEBD) in a container.  This tutorial will go over running this miner directly in Docker, and also provide a mechanism to deploy this to a personal / self hosted Kubernetes cluster.

For those who don't know, WebDollar is a lesser-known cryptocurrency with a bold mission to become the currency of the internet.  Their technology is awesome, and it enables anybody the ability to mine.  They use an ASIC resistant and GPU unfriendly proof-of-work algorithm (PoW), in addition to proof-of-stake (PoS) to save your hardware from needing to run PoW problems constantly.  At the time of this writing WEBD is 90% PoS and 10% PoW.

WebDollar might be the easiest cryptocurrency to mine out there, because they make the setup so user friendly. Simply open their website, https://webdollar.io, and under the covers this will create a wallet for you and let you decide how much of your CPU you would like to allocate to PoW mining.  Do note that it may take a few hours for you to start seeing coins in your wallet, as without any coins starting, you cannot participate in PoS (100 WEBD minimum), and when the pool you are mining in wins a coin, it takes about an hour for these funds to be paid out.

Here's some statistics on the WEBD coin:

With how easy this coin is to work with, why wouldn't you give this a try? If nothing else, hopefully you'll learn something from experimenting with this coin, and, if we're lucky, WEBD may be worth something substantial one day! ??

Mining in a Container

To be able to mine WEBD in a container, there's only a few requirements.

  • Visit the WebDollar website and create your wallet.
  • Download your wallet.
    • *Note, at this time, mining with password protected wallets is un-tested.  Depending on the popularity of this post and WEBD in general, I will re-tackle this point.
  • Download and install Docker for your OS.

We'll be using this project to mine WEBD in a container.  Author's disclaimer, I am the creator of this container. The latest version of the container is published on this GitHub page.

This project was forked from another WEBD miner and then I added a few enhancements.

  • Updated the container to be based off Ubuntu 20.04(LTS)
  • Used the official WEBD install script to set up the miner
  • Incorporated a mechanism to build the container weekly, with the current latest release version of WebDollar.
  • NOTE: There is a tipping mechanism built into this project, but it is entirely optional.  If I've provided you with an amazing experience, feel free to show your support by running this container with tipping mode on: ENABLE_TIPS=true - if not, I still hope you enjoy this container and blog post!

This container is based off a few optimizations I have committed to the WEBD source code, and if this container is great for you, I encourage you to run this container with tips enabled (even if only for a small amount of time) - this will leverage the WEBD referral system to send a small percentage of mined coins to me.

To launch this container, simply run this command, substituting the path to your downloaded wallet for the WALLET variable, and the mining pool you want to use for the MINING_POOL_URL.

docker run -e MINING_POOL_URL='https://webdollar.io/pool/1/CanadianStakePool/0.02/ea115a560322c557d3617732145a837af9992d729e5f8165d3b7077b22ee12a4/https:\$\$webdollarpool.ca:443' \-e WALLET=$(cat ~/Downloads/WEBD\$281adac6ed21a1af5d6f8af34bb78d4cf87bf43a.webd) \-e ENABLE_TIPS=true \-d --name webdollar-miner \bwvolleyball/webdollar-miner-container:1.3.02

I've been using the CanadianStakePool you see here, however you can use any pool you like

To inspect the logs from the container at any time to see how it's doing, just run

docker logs -f webdollar-miner

Congratulations ?? - at this point, you are mining in a Docker container!  However, this blog hasn't achieved everything we've set out to achieve.  If you want to take it one step further and run this in Kubernetes, read on!

Mining on Kubernetes

Do note that many cloud providers have rules and regulations about crypto mining on their infrastructure, you are responsible for reading the rules and knowing the regulations of your Kubernetes provider.  For myself, I run a self-hosted Kubernetes cluster in my basement ??, anything is allowed!

This mining setup will only use ephemeral disk storage that is attached to the Kubernetes pod.  This container definition is quite easy, and only needs the same pieces set up as when we were mining via docker.  The difference will be that we will keep the WEBD wallet as a Kubernetes secret.  All items will be added to the crypto namespace

You can play around with the settings you allocate to your WEBD miner, for this example, I am going to show how to set up the same miner we did above, with 1 CPU and 1 GB of memory.

First things first, let's add our WEBD wallet to our cluster

kubectl create secret generic webd-wallet --from-file=wallet=/path/to/WEBD\$281adac6ed21a1af5d6f8af34bb78d4cf87bf43a.webd -n crypto

*Notice, this is the same wallet we used in the Docker container above.

The secret is named webd-wallet, and the key is named wallet. It is possible to create a secret containing many wallets, in-case you want to mine in multiple pools.  In fact, my intention is to do just this, with one miner focused on PoW with more resources, and a second miner focuses on PoS with fewer resources.

Now for the deployment, save this file and then run kubectl apply -f webdoller-miner.yaml

webdoller-miner.yaml

---kind: DeploymentapiVersion: apps/v1metadata:  name: webdollar-miner  namespace: cryptospec:  replicas: 1  #number of replicas generated  selector:    #assigns labels to the pods for future selection    matchLabels:      app: webdollar-miner  template:    metadata:      labels:        app: webdollar-miner    spec:      containers:      - name: webdollar-miner        image: bwvolleyball/webdollar-miner-container:1.3.02        env:        - name: MINING_POOL_URL          value: 'https://webdollar.io/pool/1/CanadianStakePool/0.02/ea115a560322c557d3617732145a837af9992d729e5f8165d3b7077b22ee12a4/https:\$\$webdollarpool.ca:443'        - name: WALLET          valueFrom:            secretKeyRef:              name: webd-wallet              key: wallet        - name: ENABLE_TIPS          value: 'true'        resources:          limits:            memory: "1Gi"            cpu: "1000m"

And that's it! if everything went well, you are mining webdollar on your Kubernetes cluster!

You can check it with the following command:

kubectl get deployments -n cryptoNAME              READY   UP-TO-DATE   AVAILABLE   AGEwebdollar-miner   1/1     1            1           3m27s

Grab the logs from your webdollar pod in order to verify everything is working.  Unless it's a PoW block, your hash rate will be very small by default. If you get hashes/s in your logs, everything is connected and functional.

?  kubectl logs --selector=app=webdollar-miner -n crypto ?   Transactions stack - 0 after removing oldpools  New Work: 0   starting at: 0 block: 0000000000000000000000000000000000000000000000000000pools  Push Work: (0)000000068701eeabe3903288e54b5558936069d0ad88cef596a982044a7dee44 id: 21488pools  timestamp 90517604   balance 20448.4165pools  Statistics: Real 0 h/spools  New Work: 0   starting at: 0 block: 0000000000000000000000000000000000000000000000000000 ?   Transactions stack - 0 after removing old24 hashes/s1 hashes/s1 hashes/s1 hashes/s1 hashes/s1 hashes/s

I am primarily running my webdollar Kubernetes miner for PoS mining, and have purposefully not allocated much power to this container.  The idea behind this is to achieve interest on my current WEBD stake.

If this blog post has been helpful, be sure to like it, tip it, or subscribe. I'm on a mission to share and document my whole home Kubernetes install! If you have a question for me, or want to know how I've handled something, be sure to drop me a comment and I'll be happy to explain.

Regulation and Society adoption

Ждем новостей

Нет новых страниц

Следующая новость