Register Delegate

Once your server is set up and the necessary programs installed, you will be able to register yourself as a delegate.

Introduction

Once you have correctly set up your instance, installed the different programs, either from the installer script or manually, you can now register as a delegate of the X-Cash Public Network. You will need to have all the services already running to generate the necessary parameters to register yourself as a delegate.

1. Generate a Block Verifier Key

If you installed the program through with the auto-installer and chose to create a new block verifier key, you should have saved it at the end of the installation already. You don't need to generate a new one and can go register yourself as a delegate directly.

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.

systemctl stop xcash-dpops

Then, run the xcash-dpops program with the --generate-key option. The program is located in the xcash-dpops/build folder. Run the command:

~/xcash-official/xcash-dpops/build/xcash-dpops --generate-key

You will be given a public key and private key.

Block Verifier Key
XCASH DPOPS - Version 1.0.0
---------------------------
Public Key:
cf8718d638ce0a831f3538ea60d1e27c3a258c7004a1ad7c547cc5331de7d9d7
Secret Key:
ca1319431124f55fa0d9e0fcc84edd780f80da7d91f08d334fac17c803934ecccf8718d638ce0a831f3538ea60d1e27c3a258c7004a1ad7c547cc5331de7d9d7

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.

2. Register Yourself as a Delegate

Now that you have generated your block verifier key pair, you can register yourself as a delegate. You will need to prepare a delegate name, your server IP address or domain name, and the block verifier public key. Furthermore, you will have to register from the wallet you will be using to collect the reward.

Chose your delegate name wisely as you won't be able to change it down the line. If you want to change the name, you will have to generate a new block verifier key pair and register yourself again, but you will however lose your previous delegate stats.

First of all, the wallet service should be running in the background. Stop it by using the command:

systemctl stop xcash-rpc-wallet

Open and let synchronize your wallet generated during the node installation, either when using the auto-installer or created manually.

~/xcash-official/xcash-core/build/release/bin/xcash-wallet-cli --wallet-file ~/xcash-official/xcash-wallets/<WALLET_NAME>

Replace the <WALLET_NAME> with your own.

If you installed with the auto-installer script, the wallet name will be delegate-wallet

Once your wallet is fully synchronized, you can use the delegate_register command with the following parameters:

delegate_register <delegate_name> <IP_address|domain_name> <block_verifier_public_key>

And replace the information with:

  • <delegate_name>: the name that will be displayed on the delegate explorer. Cannot be updated.

  • <IP_address|domain_name> : your server's IP address or its domain name (if you have bought a domain name and correctly set up the DNS record). It is possible to change this information at a later time. Can be updated.

  • <block_verifier_public_key> : the block verifier public key that you have generated earlier. Cannot be updated.

Example:

delegate_register my_delegate my_delegate.domain.com cf8718d638ce0a831f3538ea60d1e27c3a258c7004a1ad7c547cc5331de7d9d7

You will be prompted to wait for the next valid data interval. Once your request has been accepted, you will receive the message The delegate has been registered successfully.

You can exit the wallet and restart the wallet service:

systemctl daemon-reload

Now, you will need to use your block verifier secret key as a parameter to let the program identify that you are the one signing messages.

If you installed the program through with the autoinstaller, your block verifier secret key has already been added as a parameter to the xcash-dpops program. You can go to the next step.

First of all, stop the currently running process of the xcash-dpops program.

systemctl stop xcash-dpops

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 restart systemctl:

systemctl daemon-reload

3. Update Public Information

Each registered delegates will be displayed in the delegates explorer, along with their statistics and information. At registration, the minimum information that is displayed is your delegate name and IP address. You can add additionnal instructions to help other identify you or rally to your cause and vote for you.

First of all, the wallet service should be running in the background. Stop it by using the command:

systemctl stop xcash-rpc-wallet

Open and let synchronize the wallet you used to register as a delegate, either when using the auto-installer or created manually.

~/xcash-official/xcash-core/build/release/bin/xcash-wallet-cli --wallet-file ~/xcash-official/xcash-wallet/<WALLET_NAME>

Replace the <WALLET_NAME> with your own.

If you installed with the autoinstaller script, the wallet name will be delegate-wallet

Once your wallet is fully synchronized, you can use the delegate_update command with the following parameters:

delegate_update <item> <value>

Replace the <item> with one of the list below, and change the correspondig <value>

Item

Type

Description

IP_address

String (255 char. max.)

Server IP address or domain name.

Example:

delegate_update IP_address 104.23.22.12

about

String (1024 char. max.)

Short description about you and your motivations as a delegate.

Example:

delegate_update about Even the smallest delegate can change the course of the future.

website

String (255 char. max.)

Link to your landing page or website relating to your delegate information and statistics.

Example:

delegate_update website my-delegate-website.com

team

String (255 char. max.)

In case of delegate node managed by several persons. Can be a team name, names or GitHub profiles.

Example: delegate_update team Manager: @tic | Treasury: @tac

shared_delegate_status

Boolean

True if shared delegate, false if solo delegate.

Example: delegate_update shared_delegate_status true

delegate_fee

Number

[0 - 100] with up to 6 decimals

Fees (in percentage) taken by the shared delegate on the block reward.

Example: delegate_update delegate_fee 12.354321

server_specs

String (255 char. max.)

A description of the servers' specifications and hardware.

Example: delegate_update server_specs Operating System : Ubuntu 18.04 | CPU : 8 threads (Intel E3-1246 v3 - 3.50GHz RAM = 32GB DDR3 | Hard drive = 2x HDD SATA 2 TB | Bandwidth Transfer = Unlimited

You will be prompted to wait for the next valid data interval. Once your request has been accepted, you will receive the message The delegate info has been updated successfully.

You can exit the wallet and restart the wallet service:

systemctl start xcash-rpc-wallet

4. Shared Delegates

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.

Quick Setup

You can run the Change Solo Delgate or Shared Delegate or Edit Shared Delegate Settings option in the auto-installer script to easily update your delegate settings. To open the installer script, run:

bash -c "$(curl -sSL https://raw.githubusercontent.com/X-CASH-official/xcash-dpops/master/scripts/autoinstaller/autoinstaller.sh)"

Manual 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:

--shared-delegates-website --fee <fee> --minimum-amount <amount>

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

--shared-delegates-website --fee 12.092032 --minimum-amount 10000

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

To 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:

systemctl stop xcash-dpops

Then, edit the unit file:

nano /lib/systemd/system/xcash-dpops.service

And add the parameters to the ExecStart variable:

XCASH_DPOPS.service
[Unit]
Description=XCASH DPOPS
[Service]
Type=simple
LimitNOFILE=infinity
User=root
WorkingDirectory=~/xcash-official/xcash-dpops/build
ExecStart=~/xcash-official/xcash-dpops/build/xcash-dpops --block-verifiers-secret-key BLOCK_VERIFIER_SECRET_KEY --shared-delegates-website --fee <fee> --minimum-amount <amount>
Restart=always
[Install]
WantedBy=multi-user.target

Make sure that the following parameter is in first place:

--block-verifiers-secret-key BLOCK_VERIFIER_SECRET_KEY

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:

sudo apt install nodejs

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:

npm config set user 0
npm config set unsafe-perm true

Install npm globally:

npm install -g npm

Angular & Uglify JS

Install Angular and UglifyJS globally:

npm install -g @angular/[email protected] uglify-js

Build

Once all dependencies are installed, clone the delegate pool website repository :

cd ~/xcash-official && git clone https://github.com/X-CASH-official/delegates-pool-website.git

Go into the folder, install the dependencies, and build the website:

cd ~/xcash-official/delegates-pool-website
npm update
npm run build

It will build in the distfolder.

Compress the .js files with Uglify-JS and move all of the contents of this folder to your xcash-dpops/ folder:

cd ~/xcash-official/delegates-pool-website/dist
for f in *.js; do echo "Processing $f file.."; uglifyjs $f --compress --mangle --output "{$f}min"; rm $f; mv "{$f}min" $f; done
rm -r ~/xcash-official/xcash-dpops/delegates-pool-website
mkdir ~/xcash-official/xcash-dpops/delegates-pool-website
cd ..
cp -a dist/* ~/xcash-official/xcash-dpops/delegates-pool-website

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!