Digibyte Node Setup Guide
Digibyte is a mineable cryptocurrency that has multiple algorithms. In this guide, I cover how to setup a node and configure it as a Miningcore SOLO pool.
NOTE: This walkthrough assumes you are running a system on Ubuntu Linux and are already connected to a shell window either directly on the system or via a SSH session. In order to setup the pool part, you also need to be running an instance of Miningcore. If you need to setup Miningcore, I have a Guide for that here
We’ll start by first making sure we have our packages up to date and then install docker and git
sudo apt update -y
sudo apt install docker.io git -y
Next, we’ll create folders to store our Node application files and also our blockchain data in. I’ll be placing this at /apps and /data paths. You may want to replace those paths if you have multiple drives with different mount points.
sudo mkdir -p /data/.dgb
sudo mkdir -p /apps/dgb
Now, we’ll clone the Digibyte Github repository to a local folder and then move into that folder
sudo git clone https://github.com/DigiByte-Core/digibyte.git /apps/dgb
cd /apps/dgb
Next we need to create a Docker config file as the node doesn’t ship with a native docker file.
sudo nano Dockerfile
Paste the following text and then do ctrl+x followed by Y and then press the Enter key. This will save and exit.
FROM ubuntu:22.04
RUN apt-get update -y
RUN apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 make automake cmake curl g++-multilib libtool binutils-gold bsdmainutils pkg-config python3 patch bison -y
WORKDIR /app
COPY . .
WORKDIR /app/depends
RUN make -j $(( $(nproc) - 1 ))
RUN make install
WORKDIR /app
RUN ./autogen.sh
RUN CONFIG_SITE=/app/depends/x86_64-pc-linux-gnu/share/config.site ./configure
RUN make -j $(( $(nproc) - 1 ))
RUN mv /app/src/digibyted /app/digibyted
RUN mv /app/src/digibyte-cli /app/digibyte-cli
CMD /app/digibyted -printtoconsole
Note the RUN CONFIG_SITE line references the architecture of our system. If you are compiling on an ARM based device or something other than linux x86/x64, you will want to adjust the path in that line. Here are the common architectures:
- i686-pc-linux-gnu for Linux 32 bit
- x86_64-pc-linux-gnu for x86 Linux
- x86_64-w64-mingw32 for Win64
- x86_64-apple-darwin18 for macOS
- arm64-apple-darwin for ARM macOS
- arm-linux-gnueabihf for Linux ARM 32 bit
- aarch64-linux-gnu for Linux ARM 64 bit
- powerpc64-linux-gnu for Linux POWER 64-bit (big endian)
- powerpc64le-linux-gnu for Linux POWER 64-bit (little endian)
- riscv32-linux-gnu for Linux RISC-V 32 bit
- riscv64-linux-gnu for Linux RISC-V 64 bit
- s390x-linux-gnu for Linux S390X
- armv7a-linux-android for Android ARM 32 bit
- aarch64-linux-android for Android ARM 64 bit
- i686-linux-android for Android x86 32 bit
- x86_64-linux-android for Android x86 64 bit
Now we are going to compile it into a local docker image. We are using docker here to simplify starting, stopping, and being able to easily update the node when needed. Please be patient as this step may take 30-45 minutes or more depending on your hardware
sudo docker build -t dgb .
Next, we are going to create our RPC credentials. Most other blockchains allow you to use rpcuser and rpcpassword, but digibyte requires an encoded rpcauth value. We can easily create this by password 2 arguments to the rpcauth script with the username and password we want to use
python3 /apps/dgb/share/rpcauth/rpcauth.py pooluser poolpassword
Copy the rpcauth= line. You will need it in the next step
Now we need to create a config file for the node. This allows us to define the ports and credentials that the node RPC server runs on that we will use to connect our pool to (if applicable)
sudo nano /data/.dgb/digibyte.conf
Paste the following text and then do ctrl+x followed by Y and then press the Enter key. This will save and exit.
server=1
rpcport=9004
algo=sha256d
rpcauth=pooluser:bc1f961ad347f79ab97fa7e3ac35f02a$eb31de681359ba83be70e2cc178bf7de7b3b7affb29df2fb41907436d8ef734e
prune=550
wallet=default
zmqpubhashblock=tcp://127.0.0.1:6004
Let’s break down what the above settings mean
- server – This tells the node to run the JSON-RPC Server. This is needed to interact with the node (such as getting work, submitting blocks, checking balances, sending funds, etc)
- algo – This defines the algo we want the node to be tied to. This is extremely important when mining to this node as Digibyte has multiple algorithms and you must specify the algo this node is for. If you want multiple algo’s, you will need to run multiple instances of the node (1 for each algo and on their own unique port #’s)
- rpcport – This defines the port number that JSON-RPC server will accept connections on
- rpcauth – This defines the JSON-RPC credentials we can use to connect to interact with the node and wallet
- prune – This enables pruning to save storage. 550 is the minimum amount and the value is defined in MB. If you want to run an archival node, you will want to exclude this setting, but for running a mining node, we don’t need the full blockchain history.
- wallet – This tells the node what wallet to auto use when it launches/restarts. We will be creating this wallet in a few steps.
- zmqpubhashblock – This defines a endpoint that our node can push new block notifications too. When running a pool or stratum service, we subscribe to this endpoint so the pool gets real-time notifications that it’s time to switch to the next block instead of having to poll the node multiple times a second.
Now we can create and run the docker container for the node. We set restart to always so if the node crashes or system reboots, it will auto start itself back up
sudo docker run -d --network host --name dgb --restart always --log-opt max-size=10m -v /data/.dgb:/root/.digibyte dgb
The container should now be running and start syncing the blockchain. You can check the logs with the following command
sudo docker logs dgb
This node, by default, doesn’t automatically create a wallet, so we need to create one. We can do this with one simple command
sudo docker exec dgb /app/digibyte-cli createwallet default
You will now need to wait for the node to fully sync. If you want to interact with the node or node wallet, you can do so like this:
sudo docker exec dgb /app/digibyte-cli getnewaddress
After running the above getnewaddress command, make note of the address. You will need it if you are going to configure Miningcore for Bitcoin.
If you want to use this node with Miningcore, here is an example pool config that you can put in the “Pools” array of your Miningcore config file. Replace the address values with what you copied from the “getnewaddress” command earlier
sudo nano /data/.miningcore/config.json
{
"id": "dgb",
"enabled": true,
"coin": "digibyte-sha256",
"address": "DBxxxxxxxxxxxxxxxxxuR",
"rewardRecipients": [
{
"address": "DBxxxxxxxxxxxxxxxxxuR",
"percentage": 0.001
}
],
"enableAsicBoost": true,
"blockRefreshInterval": 0,
"jobRebroadcastTimeout": 10,
"clientConnectionTimeout": 600,
"banning": {
"enabled": true,
"time": 600,
"invalidPercent": 50,
"checkThreshold": 50
},
"ports": {
"5004": {
"name": "General ASIC",
"listenAddress": "0.0.0.0",
"difficulty": 1024,
"varDiff": {
"minDiff": 1,
"targetTime": 15,
"retargetTime": 90,
"variancePercent": 30
}
},
"5904": {
"name": "NerdMiner",
"listenAddress": "0.0.0.0",
"difficulty": 0.001,
"varDiff": {
"minDiff": 0.0001,
"targetTime": 15,
"retargetTime": 90,
"variancePercent": 30
}
}
},
"daemons": [
{
"host": "127.0.0.1",
"port": 9004,
"user": "pooluser",
"password": "poolpassword",
"zmqBlockNotifySocket": "tcp://127.0.0.1:6004"
}
],
"paymentProcessing": {
"enabled": true,
"minimumPayment": 0.001,
"payoutScheme": "SOLO",
"payoutSchemeConfig": {
"factor": 2
}
}
}
In this example, we created 2 stratum ports that miners can connect to. One for general ASIC’s and a very low difficulty stratum to support NerdMiners / ESP32’s
If you added the coin to Miningcore, make sure you restart the miningcore service
sudo docker restart miningcore
If you added the coin to Miningcore, you can now connect your miners to the port configured. If you are exposing over the internet, make sure you open up the stratum port configured (5004 and 5904), Miningcore API port (4000), and Miningcore Web UI port (80)
Congrats, you now have your Digibyte Node setup and optionally your own mining pool with Miningcore. If you find youself wanting to update to the latest version of Digibyte at some point in the future, you can run these commands:
cd /apps/dgb
sudo git pull
sudo docker build -t dgb .
sudo docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once dgb
If you found this guide valueable, please consider donating to help me continue to create similar guides