Setting Up an External Passive Relay Node

This quick start guide walks through setting up an external relay node with the help of CNTOOLs.

Relay nodes do not have any keys, so they cannot produce blocks. Instead, relays act as proxies between the core network nodes and the Internet, establishing a security perimeter around the core, block-producing network nodes. Since external nodes cannot communicate with block-producing nodes directly, relay nodes ensure that the integrity of the core nodes and the blockchain remains intact, even if one or more relays become compromised.

🌜 Prerequisites

  • A different server/VM (not located on the same machine as your block-producer node)

πŸ›Έ Running the prereqs.sh Script

Installs prerequisite dependencies and creates folder structure.

sudo apt-get install curl net-tools
mkdir "$HOME/tmp";cd "$HOME/tmp"
# Install curl
# CentOS / RedHat - sudo dnf -y install curl
# Ubuntu / Debian - sudo apt -y install curl
curl -sS -o prereqs.sh https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/prereqs.sh
chmod 755 prereqs.sh

# Ensure you can run sudo commands with your user before execution
# You can check the syntax for prereqs.sh using command below:
#
# ./prereqs.sh -h
# Usage: prereqs.sh [-o] [-s] [-i] [-g] [-p]
# Install pre-requisites for building cardano node and using cntools
# -o    Do *NOT* overwrite existing genesis and topology.json files (Default: will overwrite)
# -s    Skip installing OS level dependencies (Default: will check and install any missing OS level prerequisites)
# -i    Interactive mode (Default: silent mode)
# -g    Connect to guild network instead of public network (Default: connect to public cardano network)
# -p    Copy Transitional Praos config as default instead of Combinator networks (Default: copies combinator network)

# You can use one of the options above, if you'd like to defer from defaults (below).
# Running without any parameters will run script in silent mode with OS Dependencies, and overwriting existing files.

./prereqs.sh

Reload environment variables.

Familiarize yourself with the folder structure created by CNtools.

πŸ€Ήβ€β™€οΈ Building the Cardano Node and Command Line Interface

To clone the git repository, type:

To compile binaries, type the following commands where <NodeVersion> is the node version number or branch that you want to build:

To install the compiled binaries, type:

To verify that the correct Cardano node and command line versions are installed, type:

βš’οΈ Using systemd Services

Using systemd services to run your Cardano nodes offers the following benefits:

  • Auto-start your node when the computer reboots due to maintenance, power outage, etc.

  • Automatically restart crashed node processes.

  • Maximize your stake pool up-time and performance.

Nice work. Your node is now managed by the reliability and robustness of systemd. Below are some commands for using systemd.

βœ… Example systemd Commands

To confirm that the node service is active, type:

To display the status of the node service, type:

To restart the node service, type:

To stop the node service, type:

🚧 Filtering Logs

To filter logs, type:

OR

OR

πŸš€ Starting the Relay Node

To start the relay node, type:

To install Guild LiveView, type:

To run Guild Liveview, type:

Sample output of Guild Live View

For more information, refer to the official Guild Live View docs.

πŸ›‘ Configuring and Reviewing the Relay Node Topology File

Modify the localRoots section of the topology.json file to configure your relay node's connections to your other relays and your block producer node. For more details, see the topic Configuring Topology.

πŸ”₯ Configuring Port Forwarding and/or Firewall

Specific to your networking setup or cloud provider settings, ensure your relay node's port 6000 is open and reachable.

Additionally, if you have prometheus-node-exporter installed for providing Grafana statistics, then you need to open ports 9100 and 12798. Do not forget to update prometheus.yml on your prometheus server (aka relaynode1). Restart the prometheus service so that the new relay node appears in your dashboard.

πŸ‘©β€πŸ’» Configuring Topology for Existing Nodes

Finally, add your new relay node IP/port information to the localRoots section of the topology.json file for your existing block producer and/or relay nodes. For more details, see the topic Configuring Topology.

Example snippet to add to your block producer's topology file. Add a comma to separate the nodes where appropriate.

πŸ”„ Restarting Nodes

To refresh topology configurations for a node, you need to restart the node.

To restart nodes:

  1. Type:

  1. Repeat step 1 for each node having updated topology configurations.

🎊 Testing the Connection

On the Guild LiveView screen, press P to view the peer list. You should see the connection to other node's IP address.

Last updated