Installing a Radix Node Docker Instance with the CLI

Introduction

Using the radixnode CLI tool, you can proceed to installing the node, performing initial setup, and starting it up. While the CLI supports running the node as either a Docker instance or a systemd install using systemd, we recommend Docker as the more straightforward and easy to maintain method.

1. Install Docker

This is done through one simple call of the radixnode CLI script:

+

  • docker mode

radixnode docker configure

Once the process has completed, you will be asked to log out of your session and log back in:

Exit ssh login and relogin back for user addition to group "docker" to take effect

2. Install the node

Execute the following command to install the node:

  1. Run the following command, paying close attention to the parameters

    • docker mode

    radixnode docker setup \
        -n fullnode \    (1)
        -u \    (2)
        -t [address@IP of chosen seed node]     (3)
    1 The -n option sets the node type, which is fullnode . Archive node is not supported for node release 1.1.0 onwards
    2 The -u flag is optional and is used only if you are upgrading from a previous version of the node. If applied to the command, it will create a backup of the old configuration file and ensure that the node has stopped before applying the changes.
    3 The -t setting is the validator address and IP of a seed node that your node will use to join the network. When the command executes, the script will download the configuration file from the specified node and attempt to make a connection. Select your closest seed node from the list below:
    Asia Pacific (south-east)
    radix://rn1q2jt0jswv3lpct8tavr5tvlg2kv25f26x7w8kf6dz2hp4pu9cwq4we9tm5f@13.238.198.54
    radix://rn1qvmp586ylq9e26n98zwyu9s5hdkq8j63t8l028x8wj4vqzk32dwzw0vrg58@54.66.161.181
    Asia Pacific (south)
    radix://rn1qgf0tug4nmxfa7su8zsu8pejzq48eeglvxf8le09cuy0nsghzg44weacz2q@3.109.36.249
    radix://rn1qg54vufz29c5hcwqxuv4pr60f4fsq6ds0qpa7qnrchdwnapkw6qcxymhy7l@3.109.57.223
    EU (west)
    radix://rn1qthu8yn06k75dnwpkysyl8smtwn0v4xy29auzjlcrw7vgduxvnwnst6derj@54.216.99.177
    radix://rn1qtk3g0a2ra663wyua0l4720vfzdje9uqsdzgzjet5w9dhspkaywnjal6dv6@52.212.46.210
    US (east)
    radix://rn1qtq336a2nn2269fjes53pynwlytrv0katm6uzlfcyl6m7yscac5g7mh8prw@23.22.58.54
    radix://rn1qvw5v4w8llexz99uc9gmeh47qp2h9ax2y3aewm5e6vj5sdx8uuph2vfuvg3@52.200.121.204

While running, the CLI will report on its progress, asking at various stages if it is okay to continue; answer Y each time if you’re happy to proceed.

3. Set passwords for the Nginx server

To keep the node as secure possible, the API is divided across a number of different endpoints to allow for varying levels of access to the node’s functions. This requires different usernames and passwords for each endpoint. (If you want more information about the Radix Node API, then take a look at Radix APIs.)

3.1. Set the admin password for the Nginx server

This will set up the admin user and password for access to the general system endpoints.

  1. Execute the following command to set the password for the web server:

    radixnode auth set-admin-password --setupmode DOCKER
  2. Enter your password at the prompt, then enter it again at the verification prompt.

  3. As shown on screen, enter the following command to set an environment variable for your password (remember to fill in your own password):

    echo 'export NGINX_ADMIN_PASSWORD="nginx-password"' >> ~/.bashrc
  4. Add the new environment variable to your session by executing the following command:

    source ~/.bashrc

3.2. Set the super admin password for the Nginx server

You will also need to set up access to the /key endpoint which is used to retrieve information about the node.

  1. Execute the following command to set the password for the web server:

    radixnode auth set-superadmin-password --setupmode DOCKER
  2. Enter your password at the prompt, then enter it again at the verification prompt.

  3. As shown on screen, enter the following command to set an environment variable for your password (remember to fill in your own password):

    echo 'export NGINX_SUPERADMIN_PASSWORD="nginx-password"' >> ~/.bashrc
  4. Add the new environment variable to your session by executing the following command:

    source ~/.bashrc

To keep the node as secure as possible, there are separate nginx usernames/passwords for each functionally-related enpoint.

Table 1. Nginx user endpoints
Nginx user Service endpoints

superadmin

/key

admin

/network
/entity
/mempool
/transactions
/construction
/system

metrics

/prometheus

4. Install and start up the Docker node

With the Docker and Nginx installed and configured, we are ready to install the node as a Docker instance.

The CLI installs, configures, and starts up the node all in one step. The most important choice you must make at this step is what type of node you wish to operate. As described in the introduction to Radix Nodes, there are two types of node depending on its intended purpose: full node, validator node.

When starting up your node, will choose fullnode. A validator node is simply a full nodes that has been registered to the Radix network as valiadtor – a step that is covered later – so choose fullnode.

Run the following command to start your node:

  • full node

radixnode docker setup  \
     -n fullnode \      (1)
     -t [address@IP of chosen seed node]    (2)
1 The -n option sets the node type, which needs to be fullnode.
2 t is the address of the seed node that your node will use to join the network. Use the same address that you used in Section 1, “Install Docker”

In the setup process, the CLI will create a new node-keystore.ks file and ask you for a password to protect it.

The key generation process may take a long time if your server hasn’t generated a sufficiently large pool of random values to build fresh keys. Be prepared to wait up to twenty minutes for the key generation to complete.

The key file contains a randomly-generated private key that determines your node’s unique address and (if choosing to register as a validator node) validator ID.

This means if you lose your key file, you will forever lose your node address and validator ID - forcing you to generate a new key file from scratch.

Any tokens held by the node address will be lost.

As a validator, your delegators will have to unstake from your validator ID and restake to your new ID.

Always make sure that you securely back up your key file as soon as you’ve generated it, and carefully protect it.

Now that your Docker node should be running, there are some basic commands offered by radixnode to check on your node’s operation.

5. Make sure the node is running

You can check to see if your node is running by checking for its identifiers:

radixnode api core key-list

This command will show you the identifiers as below for the key on your node

{
   "public_keys":[
      {
         "identifiers":{
            "account_entity_identifier":{
               "address":"rdx1qspfr4l5ax3gqjfctkjxs4wutgj3sn2ht8l42x9kcp6xa6q6np5cqdgy70cjj"
            },
            "p2p_node":{
               "peer_id":"rn1q2ga0a8f52qyjwza5359thz6y5vy646ela233dkqw3hwsx5cdxqr2c9p3km"
            },
            "validator_entity_identifier":{
               "address":"rv1q2ga0a8f52qyjwza5359thz6y5vy646ela233dkqw3hwsx5cdxqr2qktp69"
            }
         },
         "public_key":{
            "hex":"0291d7f4e9a28049385da46855dc5a25184d5759ff5518b6c0746ee81a98698035"
         }
      }
   ]
}

Run below command to list the details of validator such as balances, registration, metadata, owner account etc

radixnode api core entity -v

This command will show you the details of node’s validator address

{
   "balances":[

   ],
   "data_objects":[
      {
         "name":"",
         "type":"ValidatorMetadata",
         "url":""
      },
      {
         "allow_delegation":false,
         "type":"ValidatorAllowDelegation"
      },
      {
         "registered":false,
         "type":"PreparedValidatorRegistered"
      },
      {
         "fee":10000,
         "type":"PreparedValidatorFee"
      },
      {
         "owner":{
            "address":"rdx1qspfr4l5ax3gqjfctkjxs4wutgj3sn2ht8l42x9kcp6xa6q6np5cqdgy70cjj"
         },
         "type":"PreparedValidatorOwner"
      },
      {
         "data":"0000000000000000000000000000000000000000000000000000000000000000",
         "type":"ValidatorSystemMetadata"
      }
   ],
   "state_identifier":{
      "state_version":21124443,
      "transaction_accumulator":"c26bfd40c79d6a8bbfcde9b2d67dc9a182d46031c5db4bd20eb9fbd50f2e60b9"
   }
}

6. Check your node is syncing correctly

The radixnode script allows you to interrogate your node for useful information, such as the software version:

radixnode api system version

or the node’s status:

radixnode api system health

This will return a message like this:

{"status": "UP"}

An UP status means the node is running and syncing with the network correctly. Details on the other status codes can be found in Monitoring your node’s health

More information on radixnode Usage

You can use radixnode to carry out a variety of administration tasks. For example:

You can find more information about the RadixNode CLI command set here.

If you have any questions or run into problems, then check our troubleshooting guide, or the Node FAQ page. You can also get support from the Radix community and Radix team members.