Running a systemd node with the RadixNode CLI

1. Install and Configure the systemd node

Run the following command to install the node software:

radixnode systemd configure

The script will install the systemd node and its supporting files. You’ll be asked to create a password for the radixdlt user. (For security, the node runs under the radixdlt user, rather than running as an administrator).

Once you have entered and confirmed the password, you will be presented with a series of instructions to enable the radixdlt user to execute commands without the need for user intervention.

Execute following commands so that the radixdlt user can use sudo commands without needing you to enter a password:

  $ sudo su

  $ echo "radixdlt ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/radixdlt
Follow all of these instructions before moving on to the next step.

2. Log on as the radixdlt user

  1. Log in as radixdlt

    sudo su - radixdlt
  2. Then ensure that you are in the /home/radixdlt directory. You can check your current directory using the following command:

    pwd

    If you’re not in the /home/radixdlt directory then switch to it:

    cd /home/radixdlt

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 The Radix Node API.)

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 SYSTEMD
  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 /account 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 SYSTEMD
  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

/account

admin

/system
/validation
/health
/version

metrics

/metrics

no user required

/archive
/construction

4. Run the systemd node

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

    • full node

    • archive node

    radixnode systemd setup \
        -n fullnode \    (1)
        -i 35.176.56.69 \    (2)
        -u \    (3)
        -t radix://tv1qt9kqzzqyj27zv4n67f2jrzgd24hsxfwe8d4kw9j4msze7rpdg3guvk07jy@54.76.86.46     (4)
    radixnode systemd setup \
        -n archivenode \    (1)
        -i 35.176.56.69 \    (2)
        -u \    (3)
        -t radix://tv1qt9kqzzqyj27zv4n67f2jrzgd24hsxfwe8d4kw9j4msze7rpdg3guvk07jy@54.76.86.46     (4)
    1 The -n option sets the node type, which can be fullnode or archivenode.
    2 The -i option is the external IP address of your server.
    3 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.
    4 The -t setting is the address of a Radix node you can 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 node from the list below:
    Asia Pacific (south-east)
    radix://tn1qdg87mk4gr8dlmfv82y9cqleqkcjm0fxlxe8vhcxvskd3k90jcmgk4ewsmw@13.210.91.116
    radix://tn1qfzy56n7wsspqjn8kal8n4ls9rs6lth3x6fzqhhdgqa7emwqz9w8j0xp4e3@3.106.19.89
    radix://tn1qt86e6vjvlcvmhgcgeu4szkmd70kg54g0j2fef9ttpt738xp0jjlv693c92@54.206.193.154
    Asia Pacific (south)
    radix://tn1qvgnymu94dw5gfug2e678x9h0puupk8vkm0z0083744jscukqvgsxjpgrnr@3.108.246.15
    radix://tn1qdhf7aeat739n77e227l3vgvv56kntp20ennaj38t5jc8988r5s2zxzxp77@3.108.209.244
    radix://tn1qwrerrj64fc66v8ztcgd2fr8szx73k7ermkg5hyy8q7qelnu48svw44m362@3.108.183.207
    EU (west)
    radix://tn1qt9kqzzqyj27zv4n67f2jrzgd24hsxfwe8d4kw9j4msze7rpdg3guvk07jy@54.76.86.46
    radix://tn1qw3dyujr8ss29648wfqzenwx7el08yj6mpru6z62hxzlh9n3sgwwqdkl295@52.16.242.94
    radix://tn1qgtjz4432e7ghdfsdc6ssu4v63rwxk2g84e4yedadeasfsfaw3995l9gl6l@52.215.119.169
    US (east)
    radix://tn1qvluh8d3e6uxnm2k0h6zfnng0r7hkgcd8ppjn8slzyhs7vqlavw0va9de6q@3.222.172.90
    radix://tn1q0g9zpvv2ggw99fz86q52csdjk2t0ynqz0r0e23xhdszx3r7sv9jyx84lc4@54.210.93.129
    radix://tn1qt2rma6397uytnusr0ct777tp3gnzkh65apnmhz9zqjqvmwjxwvhv8rmdd3@34.195.139.75

5. Make sure the node is running

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

radixnode api account get-info

This command will show you the address, along with the number of tokens held by the node:

{"result": {"address": "tdx1qspl7mgjqwgwqyjvy2tj8swe8a4lr6mxqdhwmn60cujl6a85mqh69eg37p9ph", "balance": {"stakes": [], "tokens": []}}, "id": 1, "jsonrpc": "2.0"}

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 version

or the node’s status:

radixnode api 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

7. Stopping the systemd node

Run the following command to stop the nginx and node services.

radixnode systemd stop

8. Restarting the systemd node

You can restart the node using the following command:

radixnode systemd restart

9. Changing node parameters

Once you are satisfied that your node is running correctly, you can change the parameters in the node’s configuration file to change the addresses it communicates through.

Make sure that your node is working before you change the default addresses. This will make it much easier to work through any problems that the changes might cause.
  1. First, make sure you’re logged as the radixdlt user.

    sudo su - radixdlt
  2. The configuration file can be found here:

    .
    └── etc/
        └── radixdlt/
            └── node/
                └── default.config

    Edit /etc/radixdlt/node/default.config and set the parameters to your own requirements:

    /etc/radixdlt/node/default.config
    ntp=false
    ntp.pool=pool.ntp.org
    
    network.id=2    (1)
    node.key.path=/etc/radixdlt/node/secrets/node-keystore.ks    (2)
    network.p2p.listen_port=30001    (3)
    network.p2p.broadcast_port=30000
    network.p2p.seed_nodes=radix://tv1qt9kqzzqyj27zv4n67f2jrzgd24hsxfwe8d4kw9j4msze7rpdg3guvk07jy@54.76.86.46:30000    (4)
    network.host_ip=35.178.201.42   (5)
    db.location=/data    (6)
    
    api.node.port=3334    (7)
    api.archive.port=8081    (8)
    log.level=debug
    
    api.archive.enable=true    (9)
    api.construction.enable=true    (10)
    api.account.enable=true    (11)
    api.health.enable=true    (12)
    api.metrics.enable=true    (13)
    api.system.enable=true    (14)
    api.validation.enable=true    (15)
    api.version.enable=true    (16)
    
    api.node.bind.address=0.0.0.0    (17)
    api.archive.bind.address=0.0.0.0    (18)
    1 The id of the Radix network. The value for Stokenet is 2
    2 the location and name of node key file.
    Always make sure you have an up-to-date copy of this file
    3 the TCP port for listening to inbound connections. Set the port address to 30001 so that it doesn’t clash with the Nginx server you’ll be installing later.
    4 this is the address of the node you are connecting to. Select the node closest to your server from the following list:
    Asia Pacific (south-east)
    radix://tn1qdg87mk4gr8dlmfv82y9cqleqkcjm0fxlxe8vhcxvskd3k90jcmgk4ewsmw@13.210.91.116
    radix://tn1qfzy56n7wsspqjn8kal8n4ls9rs6lth3x6fzqhhdgqa7emwqz9w8j0xp4e3@3.106.19.89
    radix://tn1qt86e6vjvlcvmhgcgeu4szkmd70kg54g0j2fef9ttpt738xp0jjlv693c92@54.206.193.154
    Asia Pacific (south)
    radix://tn1qvgnymu94dw5gfug2e678x9h0puupk8vkm0z0083744jscukqvgsxjpgrnr@3.108.246.15
    radix://tn1qdhf7aeat739n77e227l3vgvv56kntp20ennaj38t5jc8988r5s2zxzxp77@3.108.209.244
    radix://tn1qwrerrj64fc66v8ztcgd2fr8szx73k7ermkg5hyy8q7qelnu48svw44m362@3.108.183.207
    EU (west)
    radix://tn1qt9kqzzqyj27zv4n67f2jrzgd24hsxfwe8d4kw9j4msze7rpdg3guvk07jy@54.76.86.46
    radix://tn1qw3dyujr8ss29648wfqzenwx7el08yj6mpru6z62hxzlh9n3sgwwqdkl295@52.16.242.94
    radix://tn1qgtjz4432e7ghdfsdc6ssu4v63rwxk2g84e4yedadeasfsfaw3995l9gl6l@52.215.119.169
    US (east)
    radix://tn1qvluh8d3e6uxnm2k0h6zfnng0r7hkgcd8ppjn8slzyhs7vqlavw0va9de6q@3.222.172.90
    radix://tn1q0g9zpvv2ggw99fz86q52csdjk2t0ynqz0r0e23xhdszx3r7sv9jyx84lc4@54.210.93.129
    radix://tn1qt2rma6397uytnusr0ct777tp3gnzkh65apnmhz9zqjqvmwjxwvhv8rmdd3@34.195.139.75
    5 the external ip address of your server. You can find out your external IP address with the following command:
    curl ifconfig.me
    6 the location of the node’s ledger database.
    7 the HTTP port for the node API. Set this port to 3334 to prevent clashes with the Nginx server.
    8 the HTTP port for the archive API. Set this port to 8081 to prevent clashes with the Nginx server.
    9 set this to true if you want to enable the node’s JSON-RPC service. Only archive nodes support the REST service client.
    10 enables the construction API which is used for building transactions for token transfers, staking and unstaking.
    11 enables the API which allows for the retrieval of account information.
    12 enable the API for extracting health information from the nodes.
    13 activates the API for extracting monitoring and metrics information.
    14 this API is used for extracting operational data for the node, for example: network peers, network identifier and native token information
    15 API used for retrieving information about validator nodes.
    16 activates API that is used to return the version identifier of the node software.
    17 the address to use for the system API.
    18 the address used for the client API. This API is only available for archive nodes.
  3. Stop the node and then restart it for the changes to take effect.

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.