DPOPS Manual Installation
Last updated
Last updated
This guide hasn't been updated since May 2020. It is highly recommended to install the xcash-dpops program with the installer script provided
This guide is designed for people knowledgeable in Linux and who want to install everything from scratch. If you are not comfortable with the Linux distribution, or if you are following these steps without understanding what you are doing, you might make a mistake that will prevent the xcash-dpops
program to run as intended.
In the ~
directory, create the xcash-official
directory and the xcash-wallets
, systemdpid
, and logs
directory within. Additionally, create the .X-CASH
directory that will store the X-Cash blockchain file.
First, update your system packages and install the necessary dependencies:
If you want to install from source, you will need to install these .
You will need to get the latest stable version (current release) on the MongoDB website:
Version: Latest current release. OS: Ubuntu 18.04 Linux x64 (if you are using this version). Package: Server
Then click on All version binaries.
Copy the link address of the tgz file of the latest version available (disregarding debug symbols version) and use it to download the installation folder using this command (replacing the link with the most recent version).
Then, extract it and remove the downloaded file:
Lastly, add the MongoDB binaries folder to your path with the following command.
Replace $USER/xcash-official/mongodb-linux-x86_64-ubuntu1804-4.4.0-rc7-36-gcf4ac31/bin
with the MongoDB binaries folder in your system.
Additionally, create the /data/db
folder that will keep the delegates databases:
Then, update the links and cache of the newly installed library:
xcash-core
from sourceClone the xcash-core
repository to your installation folder and go to the downloaded folder:
Once the build finishes, the binaries will be located in ~/xcash-official/xcash-core/build/release/bin
At this point, all the dependencies should be installed and built. First, clone the xcash-dpops
repository:
Go into the downloaded folder, and build using make
:
Once the build is completed, you will get the xcash-dpops Has Been Built Successfully
message. Now that the program is built, you will need to generate a wallet to be used for the delegate and set up the different units
for systemd
to organize how your server manages the different services.
You will need to create a wallet to register as a delegate, to receive the block reward if you are elected as a top delegate and if you are a shared delegate, the payments will be sent from this wallet as well.
To generate a new wallet, use the following command:
Replace <WALLET_NAME>
, <PASSWORD>
and the <REMOTE_NODE>
with the parameters of your choice.
Make sure that you write down your mnemonic key and store it in a secure place as it will be the only way to restore your wallet in case of a problem. Failing to do so will result in loss of funds.
The wallet files will be located in ~/xcash-official/xcash-wallets/
In systemd
, a unit
refers to any resource that the system knows how to operate on and manage. This is the primary object that the systemd
tools know how to deal with. These resources are defined using configuration files called unit files.
On this guide, we will set up the different unit files to manage the programs needed to run your delegate node. The unit
files template are present in the xcash-dpops/scripts/systemd
folder, but will need to be adjusted with your delegate information.
Create two empty PID
files in the systemdpid
folder previously created, that will manage the corresponding services:
Edit the systemd unit file mongodb.service
from in the xcash-dpops/scripts/systemd
folder :
You will get the following **unit
**file:
In the file, replace the following if needed:
User
: User of the system (most likely root
)
PIDFile
: The path to mongod.pid
file that you created at the initialization step.
ExecStart
:
Replace the path to the mongod
file.
Replace the path to the database directory (/data/db
as per the instructions)
Edit the systemd unit file xcash-daemon.service
from in the xcash-dpops/scripts/systemd
folder :
You will get the following **unit
**file:
In the file, replace the following if needed:
User
: User of the system (most likely root
)
PIDFile
: The path to xcash-daemon.pid
file that you created at the initialization step.
ExecStart
:
Replace the path to the xcashd
file.
Replace the path to the xcash-daemon_Log.txt
file.
Replace the path to the xcash-daemon.pid
file.
Edit the systemd unit file xcash-rpc-wallet.service
from in the xcash-dpops/scripts/systemd
folder :
You will get the following unit
file:
In the file, replace the following if needed:
User
: User of the system (most likely root
)
ExecStart
:
Replace the path to the xcash-wallet-rpc
file.
Replace the path to the xcash-wallets
folder, and replace WALLET
by your delegate wallet name.
Replace PASSWORD
with your delegate wallet password.
Edit the systemd unit file firewall.service
from in the **xcash-dpops/scripts/systemd
**folder :
You will get the following unit
file:
In the file, replace the following if needed:
User
: User of the system (most likely root
)
ExecStart
: Replace the path to the firewall/firewall_script.sh
file.
Edit the systemd unit file xcash-dpops.service
from in the **xcash-dpops/scripts/systemd
**folder :
You will get the following unit
file:
In the file, replace the following if needed:
User
: User of the system (most likely root
)
WorkingDirectory
: Replace the path of the xcash-dpops/build
folder.
ExecStart
:
Replace the path to the xcash-dpops
file.
Replace BLOCK_VERIFIER_SECRET_KEY
with your generated verifier secret key. This should be the first parameter.
Now that you have prepared all the unit
systemd files, you will need to copy all of them to the system
folder:
Then, reload systemd
to take the changes into account and run the services.
The block verifier key is a unique identifier generated by a delegate and is used in the consensus process to sign messages and verify the information. As a delegate, you will need to generate a block verifier key before being able to register yourself in the system.
First of all, stop the currently running process of the xcash-dpops
program.
Then, run the xcash-dpops
program with the --generate-key
option. The program is located in the xcash-dpops/build
folder. Run the command:
You will be given a block verifier public key and block verifier private key.
Securely save the key you will be using! Once you have registered as a delegate with this key pair, you will be identified in the system with this. If you lose it, you will lose your delegate stats and will have to start over.
First of all, stop the currently running process of the xcash-dpops
program.
Once done, make sure to save the new changes to systemctl
by using the following command:
To run the X-CASH DPOPS test, make sure to have already started the xcash-daemon
, xcash-rpc-wallet
and mongodb
systemd services, and to have stopped the xcash-dpops
systemd service if it was already running.
Navigate to the folder that contains the binary, rebuild the binary in debug mode then run the test
The test will return the number of passed and failed tests at the bottom of the console. The failed test need to be 0 before you run the node. If the output is not showing 0 for a failed test, then you need to scroll through the testing output and find what test failed (It will be red instead of green).
If you plan on being a delegate but need to accept people vote to help you place in the top delegates spot and earn the right to forge blocks, you will need to run a shared delegate. The shared delegates website will automatically pay your voters taking into account their share.
To run your node as a shared delegate, you just need to run the xcash-dpops
program with the following added set of parameters:
With :
<fee>
: Your delegate fee is the amount of the block reward you are keeping to yourself. The <fee>
is expressed in percentage (%) and can take up to 6 decimals.
<amount>
: The minimum amount of XCASH that can be sent to voters as part of their payment. Has to be an integer number.
Example
Will register as a shared delegate, taking a fee of 12.092032%
from the block reward, and process payments to voters when they have accumulated to 10,000
XCASH.
xcash-dpops
programTo make sure that your node is running with the parameters, you should update the unit
files and restart the service.
First, make sure to stop the running xcash-dpops
service:
Then, edit the unit
file:
And add the parameters to the ExecStart
variable:
Make sure that the following parameter is in first place:
First, install the website dependencies:
NodeJS
Install nodeJS latest available version:
Install npm
globally:
Angular & Uglify JS
Install Angular
and UglifyJS
globally:
Build
Go into the folder, install the dependencies, and build the website:
It will build in the **dist
**folder.
Compress the .js
files with Uglify-JS
and move all of the contents of this folder to your xcash-dpops/
folder:
First, download the latest stable version of the MongoDB C Driver. Go to the and download the latest stable. Get the tarball file in your installation folder:
Now, build the driver using the following commands (based on these ):
Make sure to have all the installed, and build the binaries using make
:
The instructions to generate the block verifier secret key is given in the guide. Make sure to update the file with your Block Verifier Secret Key
and restart the service.
Then, add your block verifier secret key as a parameter in the service. See the guide to see how to edit the unit file.
If this is a system compatibility test, then you will need to fix the system. If this is a core test that has failed, then you need to possibly rebuild, or or go the to get help from testers and the dev-team.
Make sure to when you change fees, and change shared_delegate_status
to true if you are running a shared delegate node to let people know that they can vote for you.
As a shared delegate, you will need to pay your voters a share of the block reward. We have designed a , which works similarly to a regular PoW pool website, where your voters can see their pending payments, your forging statistics and so on...
And update to the latest version using .
Once all dependencies are installed, clone the repository :
And you are done 🎉 Verify that you are listed in the , and start advertising your node to get people joining your cause and vote for you!