Skip to main content

Installing Node

Introduction

Using the babylonnode CLI tool, you can install dependencies, configure your node installation, and then install and start up your node.

The CLI supports running the node either using Docker or via systemd. However, we recommend Docker as the more straightforward and easy-to-maintain method.

Each step specifies the commands for each mode - you should only run the commands for the mode of your choice (e.g. only those for the “Docker mode”), not both.

1. Install the babylonnode CLI

If you haven’t done so already, install the babylonnode CLI.

2. Install the dependencies on the host machine

This is required only to be run during first time setup on a new host machine. This is done through one simple call of the babylonnode CLI script.

Docker mode

babylonnode docker dependencies

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

systemd mode

babylonnode systemd dependencies

The script will install the software necessary for systemd mode. You’ll be asked to create a password for the radixdlt user (that’s the default user that the node process runs under).

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
$ exit

3. Install the node

3.1. Create the config file

The CLI uses a two-phase config / install setup. First, you are lead through an interactive prompt to create a config.yaml file, which by default is stored at ~/babylon-node-config/config.yaml. This config file serves as a base for an actual node configuration, which is generated by babylonnode. It is also used for future upgrades, to avoid having to remember your settings later.

note

**> Record the password safely

**

A keystore file is created during the config command, and the password that was entered is written to the generated config.yaml file. If you wish, you can delete the line containing keystore_password, but ensure you store the keystore password value safely, as it will be required in a later step.

note

**> Back up your keystore

**

The keystore file contains a randomly-generated private key that determines your node’s identity for peer to peer communications, and can allow it to act as a validator, if a validator entity’s public key is set to your node’s.

We recommend that you securely back up your key file as soon as you’ve generated it, and carefully protect it.

Docker mode

The config command has two modes for node setup.

If you are running a node for the first time, we recommend using the CORE mode. If you are already running an existing node using docker, you will need to use the DETAILED mode to migrate the setup, as it allows you to create a config file based on the answers that you have from existing setup.

CORE - This is a quick config mode to create a config file with simple defaults to run a non-validator full node.

babylonnode docker config -m CORE

DETAILED - This is a detailed config mode, where the user is asked all necessary questions based on the answers replied.

babylonnode docker config -m DETAILED

The config file is created from the input. It will be used during the installation command. At default you can find it at ~/babylon-node-config/config.yaml.

systemd mode

First, log in as radixdlt

sudo su - radixdlt
cd /home/radixdlt

CORE - This is a quick config mode to create a config file with simple defaults to run a non-valiator full node.

babylonnode systemd config -m CORE

The config file is created from the input. It will be used during the installation command. At default you can find it at ~/babylon-node-config/config.yaml.

Mainnet Seed Nodes

Stokenet Seed Nodes

[Optional] Download ledger snapshot using CLI

To trustlessly set-up your node, we recommend running a full sync, but this takes a few days to load and run the full history of transactions. To save time, you can consider using a community backup from a service that you trust instead.

The CLI currently only supports the radix.live mirror of the mainnet ledger. This is a third-party source, and we cannot vouch for the correctness of the mirror. If you trust radix.live yourself, the following command can be used to download and mount their latest ledger snapshot:

#Running the below command ,  ledger is downloaded into default directory which is $HOME/babylon-ledger . 
babylonnode ledger fetch-community-snapshot
#To Download onto different directory other than default $HOME/babylon-ledger pass -d parameter
babylonnode ledger fetch-community-snapshot -d <directory_of_your_choice>

3.2. Install and setup the node

Run the following command and pay close attention to parameters:

Docker mode

babylonnode docker install
note
  1. Optional - Use parameter -f <path to config.yaml> if the config file is different from the /home/ubunu/babylon-node-config/config.yaml.

  2. Optional - Use parameter -a or --autoapprove to run this command without any prompts. It is only recommended for automation purpose.

  3. Use parameter -u or --update to deploy latest versions of software.

systemd mode

  1. Log in as radixdlt

    sudo su - radixdlt
  2. Then ensure that you are in the /home/radixdlt directory:

    cd /home/radixdlt
  3. Run the following command, paying close attention to the parameters

babylonnode systemd install
note
  1. Optional - The -i option is the external IP address of your server.

  2. Optional - 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. Optional - The -t setting is the address of a Radix node you can use to join the network (a seed node). Select one from the list of seed nodes.

4. Set passwords for the nginx server

By default there are two separate users configured for accessing the APIs:

  • admin: for accessing the Core API (/core/* endpoints) and the System API (/system/* endpoints)

  • metrics: for accessing /prometheus/metrics

  1. Execute the following commands to set the passwords for the nginx users:

    Docker mode

    systemd mode

    UserCommand to run
    adminbabylonnode auth set-admin-password --setupmode DOCKER
    metricsbabylonnode auth set-metrics-password --setupmode DOCKER
  2. Enter your password at the prompt

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

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

    source ~/.bashrc
  5. 5. Verifying that the node works

    After you’ve installed the node using the commands above, it should start automatically. It should start processing the genesis transactions. Depending on your setup mode you can use either docker logs -f ubuntu-core-1 or journalctl -f -u radixdlt-nodeto view the logs. You should be seeing messages that begin with “Committing data ingestion chunk…” in the output log. This may take up to 30 minutes to fully process, depending on your hardware. Usually it finishes in around 10-15 minutes.

    note

    **> Warning

    **

    Don’t terminate (or restart) the node while the genesis transactions are being committed!
    If you do so before the whole process is completed you’ll need to wipe the data directory and start from scratch.

    After the process completes you should start seeing messages like “lgr_commit{epoch= … }”, which indicate that the node is working correctly (at which point you can safely stop/restart it any time you wish).

    At this point you can also query the System API and the Core API.
    System API’s health endpoint provides an overall health summary of a node:

    babylonnode api system health

    The response should include "status":"SYNCING. All possible statuses have been described in detail here.

    You can also inspect the Core API and query the current state of the ledger:

    curl -k -u "admin:nginx-password" https://127.0.0.1/core/status/network-status -X POST -H 'Content-Type: application/json' --data '{"network": "mainnet"}' | jq

    There’s a current_epoch_round field in the response and both the epoch and round number should be steadily growing as you re-run the query - this indicates that the node is correctly syncing the ledger state.

    Congratulations! At this point you’ve got a fully operational Radix node connected to the network.
    Note that it might take some time until it’s fully synced up with the latest ledger state. You can check the current epoch using one of the community-run Radix network dashboards on the internet.

    7. Stopping your node

    This command will shut down a systemd or docker node, and is executed differently depending on which kind of installation you’re running.

    Docker mode

    babylonnode docker stop

    Optional parameter -f can be used to point to config.yaml file

    systemd mode

    babylonnode systemd stop

    Optional parameter -f can be used to point to config.yaml file

    8. Restarting your node

    Restart the node using the following command:

    Docker mode

    babylonnode docker restart

    Optional parameter -f can be used to point to config.yaml file

    systemd mode

    babylonnode systemd restart

    Optional parameter -f can be used to point to config.yaml file

    10. Advanced user config

    For advanced users, there is an additional file that can be optionally mounted to provide additional configuration to the babylon-node application which will be appended to the configuration when executing the install command. This allows to add configuration that the babylonnode CLI does not natively support.

    This file is located by default at ~/babylon-node-config/advanced-user.env-file for Docker and at ~/babylon-node-config/advanceduserconfig for systemd. The file will be picked up when executing install without needing to rerun the config command.

    Advanced user config - Docker mode

    Additional environment variables can be added by creating the file ~/babylon-node-config/advanced-user.env-file and writing environment variables in the format described here.

    A file from a different location can be used during the install command by providing the option -aue or --advanceduserenvs followed with the desired location.

    Refer to the default.config substitution file to find out what variables will be converted to which config parameters.

    Please note that the file will only be mounted when executing install while the file is present at ~/babylon-node-config/advanced-user.env-file or the provided custom path.

    Advanced user config - systemd mode

    Additional configurations can be provided by creating a file at ~/babylon-node-config/advanceduserconfig and adding plain configuration to it. This configuration will be appended to the default.config file during templating when executing the install command.

    A file from a different location can be used during the install command by providing the option -auc or --advanceduserconfig followed with the desired location.

    Refer to the default.config substition file to find out the format and supported variables.

    Please note that the file and changes to it will not be added when running start, restart or stop but only when executing the install command while the file at ~/babylon-node-config/advanceduserconfig or the provided custom location is present.

    UserCommand to run
    adminbabylonnode auth set-admin-password --setupmode SYSTEMD
    metricsbabylonnode auth set-metrics-password --setupmode SYSTEMD