DPOPS Manual Installation
Manual Installation
This guide hasn't been updated since May 2020. It is highly recommended to install the xcash-dpops program with the installer script provided here.
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.
1. Installation Directories
It is recommended to install the program the different programs needed for the xcash-dpops
in the same folder, in the the /root/
directory or the /home/$USER/
if you are installing from a user different than root.
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.
2. Install Dependencies
First, update your system packages and install the necessary dependencies:
If you want to install xcash-core
from source, you will need to install these additional packages.
2.a) Installing MongoDB
You will need to get the latest stable version (current release) on the MongoDB website: https://www.mongodb.com/download-center/community
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:
2.b) Building the MongoDB C Driver from source
First, download the latest stable version of the MongoDB C Driver. Go to the official GitHub repository and download the latest stable release. Get the tarball file in your installation folder:
Now, build the driver using the following commands (based on these instructions):
Then, update the links and cache of the newly installed library:
2.c) Building xcash-core
from source
xcash-core
from sourceClone the xcash-core
repository to your installation folder and go to the downloaded folder:
Make sure to have all the dependencies installed, and build the binaries using make
:
Once the build finishes, the binaries will be located in ~/xcash-official/xcash-core/build/release/bin
3. Build Instructions
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.
4. Generate a Wallet
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.
The wallet synchronization can take time the first time. It will depend on which remote node you chose, and your servers internet connection.
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/
5. Setup The Services
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.
5.a) Initialization
Create two empty PID
files in the systemdpid
folder previously created, that will manage the corresponding services:
5.b) mongodb Service
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 likelyroot
)PIDFile
: The path tomongod.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)
5.c) xcash-daemon Service
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 likelyroot
)PIDFile
: The path toxcash-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.
5.d) xcash-rpc-wallet Service
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 likelyroot
)ExecStart
:Replace the path to the
xcash-wallet-rpc
file.Replace the path to the
xcash-wallets
folder, and replaceWALLET
by your delegate wallet name.Replace
PASSWORD
with your delegate wallet password.
5.e) Firewall Service
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 likelyroot
)ExecStart
: Replace the path to thefirewall/firewall_script.sh
file.
5.f) xcash-dpops Service
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 likelyroot
)WorkingDirectory
: Replace the path of thexcash-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.
The instructions to generate the block verifier secret key is given in the generate block verifier key guide. Make sure to update the file with your Block Verifier Secret Key
and restart the service.
5.g) Install and reload
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.
6. Generate a Block Verifier Key
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.
Then, add your block verifier secret key as a parameter in the service. See the setup of the services guide to see how to edit the unit file.
Once done, make sure to save the new changes to systemctl
by using the following command:
7. Test build
It is recommended to run the xcash-dpops
test
before you run the main program. The test will ensure that your system is compatible and that you have set up your system correctly.
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 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 contact us on the DPoPS testing section or go the Discord channel to get help from testers and the dev-team.
Shared delegates Manual Installation
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.
Manual Setup
We recommend changing from a solo delegate to a shared delegate with the auto-installer script as described above. The manual process described below can be prone to error in the setup.
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.
Update the xcash-dpops
program
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:
Make sure to update your public information 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.
Build the shared delegate website
The shared delegate website
has been automatically installed if you installed it with the auto-installer script.
As a shared delegate, you will need to pay your voters a share of the block reward. We have designed a delegate pool website
, which works similarly to a regular PoW pool website, where your voters can see their pending payments, your forging statistics and so on...
First, install the website dependencies:
NodeJS
Install nodeJS latest available version:
And update to the latest version using this tutorial.
npm
First, if you are installing from root user, you need to give the current permissions:
Install npm
globally:
Angular & Uglify JS
Install Angular
and UglifyJS
globally:
Build
Once all dependencies are installed, clone the delegate pool website
repository :
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:
And you are done 🎉 Verify that you are listed in the delegate explorer, and start advertising your node to get people joining your cause and vote for you!
Last updated