Running a Validator Node

Introduction

A Validator Node starts life as a Full Node, but has also “registered” itself to the network as a Validator by submitting a special transaction from its account. Registration means that it may now accept XRD token “stake” and potentially be included in the validator set of 100 nodes that conduct network consensus.

Once running, a validator node offers two interface endpoints on a private port:

/node may be used to conduct transactions from the node’s account, including validator configuration, registration, and de-registration. The node’s account must hold XRD tokens to pay for network fees on these transactions.

/system may be used to query aspects of the node and network such as current version, current peers, etc.

Full documentation of endpoints under /node and /system paths will be available at mainnet launch.

Prerequisites

A Radix Node running as a Cloud Docker Instance. If you haven’t set up one up yet then please run through this tutorial:

We’re using Amazon Web Services throughout our example, but you can install Radix nodes on any cloud service that supports Java, such as Google’s cloud platform or Microsoft Azure – or follow similar step to deploy on a private server.

Configure the service as a validator

There are two steps for setting up your service to take part in validation:

  1. Use the low-level API to put your service into validator mode.

    Execute the following command to fetch node address.

    curl -s -u admin:<nginx_password_of_your_choice> -k -X  GET 'https://localhost/node'

    This will return some basic information about your Radix instance:

    {"address":"JEzjRWrczMCMHGguB34suKe2qiQ6QNbmsGrHygpf5Z8ThbdBCB7","balance":{"balances":{},"staked":[]}}

    The address field is the the one you’re interested in: this is the address of your node on the network. You can now use the address to allocated tokens to the node:

  2. Send tokens from your wallet to the node address. (Setting the node as a validator is carried out by executing a transaction. The node requires tokens to carry out transactions, so you will need to send tokens to the node before you can register it.)

  3. Make the following call to your node to set it as a validator:

    curl -s -u admin:<nginx_password_of_your_choice> \
      -X POST -k 'https://localhost/node/execute' \
      -H 'Content-Type: application/json' \
      --data-raw '{"actions":[{"action":"RegisterValidator","params":{"name": "My Validator", "url": "https://my-validator.com" }}]}'

    The call can take two optional parameters:

    name

    The name of your validator node. If a Get Validators request is made against the network, then your node will send the name of your node as part of the response.

    url

    The url can be used to provide a website address. Again, this will be returned as part of the Get Validators response, and can be used to point interested parties to your website.

If the call is successful, the node will return the transaction details:

{"result":{"transaction_identifier":"6131aec55be4a226f189efcc14683ce1a93a4b8798bad01063a095fd893ff505","transaction":"0205026f7c48b7d9859f8028abb3b8aef860b663664c59ab4aef13852c956109c4b7c30000000105026f7c48b7d9859f8028abb3b8aef860b663664c59ab4aef13852c956109c4b7c30100000003cda39bb8a7f57e0dc900c67b884512fb570ae3e09ebc35058490ac5e136d0f2600000000010300037872642602026f7c48b7d9859f8028abb3b8aef860b663664c59ab4aef13852c956109c4b7c3b3df8fe60000000000000000000000000000000000000000000000007ce66c50e2840000000800867ee85b1acaf38d4299e631885b760545255f73202abe2d147a11bd3bc3dc564a7a9a1449253d8bd7a06dd6a9986be253013bc096f2c342f7f779110c8b3de1"}}

And that’s it. Your node is registered as a validator.

There may be a delay from the time you register as a validator and the network scans your node and adds it to its list of potential validators. The epoch time, as it is called, could be anything up to four hours.

If you want to check, then you can call the validator command which will tell you whether or not your node is registered as a validator.

curl -s -u radixdlt:<nginx_password_of_your_choice> \
  -X POST https://localhost/node/validator

You should receive a response that looks something like this:

{"validator":{"address":"vb1qfhhcj9hmxzelqpg4wem3thcvzmxxejvtx454mcns5kf2cgfcjmux9fcayd","stakes":[],"registered":true,"totalStake":0E-18}}