Skip to main content

Become Validator

You must have a Nuchain account in order to become a validator. How to create an account can be found here.

Installing Nuchain Node#

You can install Nuchain node on your server/computer by compiling the source code from the master branch in repository or downloading the pre-built binary on the [releases] page (https://github.com/nusantarachain/nuchain/releases).

If you want to install from source code, please follow the steps install from source code.

After you download from the releases, extract/unzip the zip file. Here is an example.

$ unzip nuchain-0.1.3-3cb5203af-linux.zip

Run:

$ ./nuchain --validator

NOTE: Run Nuchain as a service so that when the computer shuts down/restarts, Nuchain can run again automatically.

The fastest way to run Nuchain node is to use Docker, read how to use it here.

Connect#

You need to link your account to the validator engine so that the Nuchain system knows where the rewards (as the results of the validator engine) will go. Here's how to connect a Nuchain account with the validator engine:

  1. Get the session key from the validator engine that is already running:
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http:// localhost:9933

The output you get is something like this:

{ "Jsonrpc": "2.0", "result": "0x2320085170b06281aedc2df4296d7b5042abcef201c57f2e55201f7aefc6af0c5ac19e74b674cb97913d54d63255dc18fbe88ad73392576130e00803c7082716147a5768a1c7f8708379649c0c9246b049699109c94b7d8957ebb813af62620464a70e69288323168afd69358746d684fc178eefac06aa9e94028a0f409a6d1a", "id": 1}

Copy the hex text in the field result starting with 0x.... The text is the session key which will be needed at the registration/submission stage to become a validator.

Apply As Validator#

To apply as a validator, go to Nuchain Dashboard. Go to the Network menu > Staking > Account actions then click the "+Validator" button:

Nuchain Validator

Fill in the required data for the Staking process then click the next button.

Paste the long hex text -- obtained from the previous step -- into the input Keys from rotateKeys:

Set Session Key

rewards commission percentage can be filled 100% to get all rewards for yourself (excluding nominators).

If you encounter any difficulties, please submit questions in the [Element] group(https://app.element.io/#/room/!aYWUxhUvutqbMBQIsN:matrix.org) or Telegram

Pruning#

When you become a validator, you don't have to store all existing block data. It is possible for the validator to store only the last few blocks of data so that its storage space is not highly consumed. This can be done by using the pruning feature. This feature allows the validator to run the engine without having to store the entire block from the begining; the validator may store only a few blocks based on the desired configuration. Activation of pruning mode is enough by adding the parameters --unsafe-pruning and --pruning=[NUMBER-BLOCK]. Example:

nuchain --validator --unsafe-pruning --pruning=1000 ...

The above example command will run the validator with pruning 1000 or only keep the last 1000 blocks, the old blocks will be deleted.

While using Pruning makes storage power more efficient, saving all blocks is recommended. Saving the entire block will maintain the history of transactions across the network.

Presync Data#

When you become a new validator for the first time, the node will synchronize. This process will take quite a while when there are too many blocks. To speed up the sync process, you can download the following presync data:

Extract the file using 7zip and point Nuchain node to the data using the --base-path parameter.