top of page
Search
  • Writer's pictureCorey Wooten

Launching Cardano (ADA) Relay Nodes from a Remote Server: A Step-by-Step Guide

Updated: Dec 14, 2023


A gold Cardano (ADA) cryptocurrency coin in depth-of-field with a vibrant boxwood plant
Courtesy: Unsplash

The following content presents a step-by-step guide explaining the process of launching a node on the Cardano ($ADA) blockchain network, otherwise known as the 'Cardano-node'. The example will demonstrate the remote deployment process of a passive relay node¹ on the Cardano mainnet², using a virtual machine running Ubuntu Server (Linux OS). We will cover setting up, configuring, compiling, and deploying the node. Before diving into the specifics, let's begin with a brief overview of Cardano.


"A blockchain platform for changemakers, innovators, and visionaries." – Cardano Foundation

The Chronicles of Cardano


Ethereum co-founder Charles Hoskinson established the Cardano Foundation in 2015 (source: Wikipedia). Cardano [organization] describes itself as "a blockchain platform for changemakers, innovators, and visionaries" (source: Cardano). Along with peer-to-peer (P2P) transacting of their ADA cryptocurrency, Cardano offers a first-in-class Layer-1 blockchain³ built on an open-source, decentralized network, that uses a proof-of-stake mechanism to authenticate network activity and validate transactions.

A Cardano (ADA) token displaying the ADA logo sits atop a wooden surface
Courtesy: Unsplash

Although Cardano is an open-source platform, it has one of the few blockchain networks that operates with a fully democratized governance system. Not only is the network community-focused, it also depends on peer reviews for ongoing research and development projects. Furthermore, peers must agree in-majority before any new processes or developments are implemented.


Why Cardano?

Simply put, Cardano is a decentralized network literally built by the people, and for the people. By running Cardano nodes, the node operator contributes to a distributed peer network focused on trust and transparency. Moreover, Cardano nodes can validate blockchain transactions, and generate new blocks on the network. This means you could potentially deploy a single node that acts simultaneously as a full (passive) node and a validator (staking) node⁴.


 

Configuring and Launching a Cardano Node from a Remote Server


Cardano-node binaries package scripts running in Terminal shell
Cardano-node binary package scripts running in Terminal shell

For clarification, this process is divided into phases, each with its own list of steps.


Time allocation:

  • Software installations: ~30 minutes

  • Virtual Machine (VM) setup: ~30 minutes

  • Node configuration: ~90 minutes

  • Launching/syncing node with blockchain: ~20 - 48 hours

Time for system setup/configurations: ~3 - 4 hours

Total time (incl. launching/syncing): ~24 - 48 hours

  1. Preparation

    1. Requirements

    2. Step 1: Set up Ubuntu Server as a Virtual Machine (VM)

    3. Step 2: Adjust the VM Settings

    4. Step 3: Configure Ubuntu Server and OpenSSH

      1. Launch and Configure Ubuntu Server

      2. Set Up the Ubuntu Server Profile

      3. Install OpenSSH Server on the VM

      4. Install Command Line Tools for the Server

  2. Updating the VM and Installing CNTools

  3. Launching the Cardano Node

    1. Install the Node Components

    2. Deploy the Cardano Node

  4. Restoring the Security Settings

 

PREPARATION


Requirements

  • Laptop/desktop computer running Mac OS, Windows, or Linux -- (Minimum 250 GB hard drive with at least 64 GB of free disk space recommended).

  • Oracle VM VirtualBox (get it here)

  • Ubuntu Server 20.04.3 (get it here)

Important: This guide will follow the process with a virtual machine on a Mac OS system. While the outlined steps and methods are generally the same, some of the included applications and troubleshooting solutions may differ slightly.

Step 1: Set up Ubuntu Server as a Virtual Machine (VM)

The next steps should be completed following the successful installation of VirtualBox and Ubuntu Server on your system.

  1. Launch VirtualBox.

  2. From the Tools menu, select New.

    1. Name: Ubuntu Server

    2. Machine Folder: {{prefilled; do not change}}

    3. Type: Linux

    4. Version: Ubuntu 64-bit

    5. Select Continue.

  3. On the next screen will be Memory Size. Adjust the slider to 8192 MB (this means the virtual machine will take roughly 8 GB of space), then Continue.

  4. Confirm the "Create a virtual hard disk now" option is selected, then click Create.

  5. Select VDI (VirtualBox Disk Image), then Continue.

  6. Select Dynamically allocated, then Continue.

  7. Leave the file location unchanged, and set the disk size in the range of 32 - 48 GB (a disk size of 42 GB will be used for this example), then click Create.

If the Ubuntu Server was properly set up, it will now be displayed in the VirtualBox toolbar in the "powered off" state.

Oracle VM VirtualBox Manager

Step 2: Adjust the VM Settings

The virtual machine will require a few adjustments to effectively run the node.

  1. To begin, right-click on the Ubuntu Server thumbnail in the toolbar and click Settings.

    1. Go to System > Processor > Adjust the slider to 4.

    2. Go to Storage

      1. Select the disk labeled 'Empty' > Click the blue disk icon > "Choose a disk file."

      2. Locate/select the Ubuntu Server download (.iso or.dmg file type), then Open.

    3. Go to Network > "Attached to" > Bridged Adapter.

    4. Click OK to apply the changes.

Oracle VM VirtualBox Manager (2)


Step 3: Configure Ubuntu Server and OpenSSH

3a: Launch and Configure Ubuntu Server

Now that we've corrected the settings and specifications of our virtual machine, it's time to boot up the Ubuntu Server.

  1. With Ubuntu Server selected in the VirtualBox toolbar, click Start.

    1. Mac OS users may encounter a 'kernel driver not installed' error. To resolve...

      1. Go System Preferences > Privacy & Security. If necessary, click on the padlock icon and enter your administrator password to authorize access.

      2. A message about Oracle may be displayed next to an 'Allow' button. Click Allow and a prompt to restart the system should appear.

      3. Select Restart and wait for the system to reboot. Once it has finished, relaunch VirtualBox and start the Ubuntu Server again.

  2. Perform the following actions on the next screens:

    1. Select your preferred language. > Done (Return key)

    2. Leave Keyboard Configurations unchanged. > Done

    3. Leave Network Connections unchanged. > Done

    4. Leave Configure Proxy unchanged. > Done

    5. Leave Configure Ubuntu Archive Mirror unchanged. > Done

  3. At Guided Storage Configuration, we will add two (2) partitions for the Ubuntu Server. Apply the following settings:

    1. Use the arrow-down key to move the cursor to Custom Storage Layout, then press the Return key.

    2. Move the cursor to Done > Return

    3. The local disk will then be displayed and highlighted, press Return.

    4. Arrow-down to Add GPT Partition > Return

      1. Set the size to 2 - 4G (4G will be used for this example) > Return

      2. For the Format, press Return > arrow-down to Swap > Return

      3. Arrow-down to Create > Return

    5. Next, arrow-down to the local disk > Return

    6. Again, select Add GPT Partition > Return

      1. This time, leave all fields empty, then arrow-down to Create.

    7. Ubuntu Server will now show the two (2) partitions created on the local disk. From here, arrow-down to Done > Return

    8. A popup message that reads Confirm destructive action will appear, arrow-down to Continue > Return

Configuring partitions on the Ubuntu Server
3b: Set Up the Ubuntu Server Profile

Apply the following settings when setting up the Ubuntu profile.

Your Name: {{your name}}
Your server's name: ubuntu-server
Pick a username: {{any username}}
Choose a password: {{password}}
Confirm your password: {{password}}
Ubuntu Server Setup
3c: Install OpenSSH Server on the VM

After setting up the server profile, the next screen will display a prompt to install an OpenSSH server on the virtual machine.

  1. The cursor next to Install OpenSSH Server is blinking, press Return to select.

  2. Leave Import SSH Identity set to No > arrow-down to Done > Return

  3. Leave Featured Server Snaps unchanged > arrow-down to Done > Return (the installation process will begin).

  4. Once the installation has completed, arrow-down to Reboot Now > Return

  5. The next screen will show a line of "failed" processes. Ignore these and press the Return key (if the window stalls or freezes, go to the Menu bar and select Machine > Reset to reset the VM).

  6. At this point, the user is prompted to log in to the Ubuntu Server they've recently configured. The cursor should blink on the line labeled ubuntu-server login, type the username entered at setup, press Return, then enter the user's password.

Ubuntu Server Setup
3c: Install Command Line Tools for the Server

The last step in setting up the Ubuntu Server will be installing the necessary tools for the Ubuntu Command Line Interface (CLI). At this point, the cursor should blink on the command line labeled username@ubuntu-server.

Ubuntu Server Setup

The next step is important, as it will be vital to access OpenSSH from the virtual machine. Enter the following command in the command line:

sudo apt install net-tools

Press the Return key, enter the user's password when prompted, then press Return again. Afterwards, go to the Menu bar and select Machine > Reset.

 

UPDATING THE VM AND INSTALLING CNTOOLS


Both the virtual machine and Ubuntu Server are now properly configured, and we are ready to boot the machine to finish setting up the Cardano node.

  1. Start the Ubuntu Server machine.

  2. Enter the username and password when prompted.

  3. Update the Ubuntu Server with the latest packages/firmware/etc. From the command line, type:

sudo apt-get update

4. Obtain the IP address of the remote server:

ifconfig

The IP address will be labeled "inet" and be similar to "192.168.1.###"


Important: The next steps will use the Terminal application. Before opening Terminal, it is important to allow full disk access so that SSH can be enabled (SSH will be disabled again after testing the Cardano node). On Mac OS systems, go to System Preferences > Security & Privacy > Privacy > Full Disk Access (click the padlock and enter the system password, if necessary). Add Terminal by clicking [+] > Applications > Utilities > Terminal, select Open, then close the window.

5. Enable SSH – Open Terminal and enter the following command:

sudo systemsetup -setremotelogin on

6. SSH into the remote server.

ssh username@192.168.1.###

At the next prompt, type yes. Enter the Ubuntu Server password when prompted.

7. Install the system updates.

sudo apt-get update
sudo apt-get upgrade
clear

8. Create a new directory for the node in the system's $HOME folder.

mkdir "$HOME/tmp"
cd "$HOME/tmp"

9. Load and run the Cardano helper script prerequisites.

curl -sS -o prereqs.sh https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/prereqs.sh

Confirm the script was loaded successfully.

ls

Allow permissions.

chmod 755 prereqs.sh

Run the script.

./prereqs.sh

Apply bashrc script.

. "${HOME}/.bashrc"

The files for our Cardano node will be installed from the helper script. This process may take a while to complete. Once completed, type clear to clear the Terminal shell.

Installing Cardano-node files with the helper script

 

LAUNCHING THE CARDANO NODE


Now it's "game time!" In this section, we will go over the final steps to configure and finally launch the Cardano node.


Step 1: Install the Node Components


1. Clone the 'cardano-node' repository from Github on the home system, then switch (cd) to the node folder.

cd ~/git
git clone https://github.com/input-output-hk/cardano-node
cd cardano-node
Cloning the Github repository

3. Download the cardano-node binaries (these commands will take some time and may slow down the system while running).

echo -e "package cardano-crypto-praos\n  flags: -external-libsodium-vrf" > cabal.project.local
$CNODE_HOME/scripts/cabal-build-all.sh
sudo cp $HOME/.cabal/bin/cardano* /usr/local/bin
Downloading the cardano-node binaries

4. Confirm the Cardano files were successfully installed.

cardano-cli version
cardano-node version

Step 2: Deploy the Cardano Node


1. Configure the node connection by modifying and deploying the topology scripts.

echo -e "package cardano-crypto-praos\n  flags: -external-libsodium-vrf" > cabal.project.local
$CNODE_HOME/scripts/cabal-build-all.sh
sudo cp $HOME/.cabal/bin/cardano* /usr/local/bin

2. Launch cnode.sh script to start cardano-node.

$CNODE_HOME/scripts/deploy-as-systemd.sh
n

3. Check the cnode status, then start the node service.

$CNODE_HOME/scripts/deploy-as-systemd.sh
n

3. Install and run Guild Liveview to sync with the Cardano blockchain.

cd $CNODE_HOME/scripts
curl -s -o gLiveView.sh https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/gLiveView.sh
curl -s -o env https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/env
chmod 755 gLiveView.sh
./gLiveView.sh
Launching the cardano-node service


 

RESTORING THE SECURITY SETTINGS

A padlock sits atop a computer keyboard offering a visual analogy of network security
Courtesy: Unsplash

Be mindful that it will take a long time (potentially a day or more) to complete the syncing process.


Before wrapping up, let's cover the basic steps to reinstate the initial security settings on the main system.

  1. Quit LiveView (press the Esc or Q key).

  2. Go to the Menu bar > Terminal > Quit Terminal > Terminate.

  3. Power down the Ubuntu Server machine.

  4. Go to the Menu bar > VirtualBox > Quit VirtualBox.

  5. Relaunch Terminal and Disable SSH.

sudo systemsetup -setremotelogin off
clear

6. Go to the Menu bar > Terminal > Quit Terminal > Terminate.

7. Open System Preferences > Security & Privacy > Privacy > Full Disk Access (click the padlock and enter the system password, if necessary).

8. Select Terminal to highlight it, then click [–] to remove permissions.

9. (Optional) Uninstall VirtualBox and Ubuntu Server (review the operating system manual for further instruction).

10. Reboot the main system.


 

Closing Statements


There you have it! We have successfully installed the needed components, configured the virtual machine and server settings, cloned the Github repository, compiled the node scripts, and alas, launched a passive relay node on Cardano's mainnet blockchain. Thank you for reviewing/following this guide on launching a passive Cardano node. Stay tuned for more Corey Talks Crypto blog updates!


For further information, visit Cardano.org, and follow the Cardano Community (@Cardano) and the Cardano Foundation (@CardanoStiftung) on Twitter.


 

Terminology

Term

Definition

passive relay node¹

A type of node configured solely for storing blockchain transactions without contributing to staking, transacting, or pooling.

mainnet²

An autonomous blockchain network with its own services, protocols, and oftentimes cryptocurrencies.

Layer-1 blockchain³

​A set of solutions implemented on the base protocol of a blockchain to improve its functionality and scalability.

​validator node⁴

A type of node responsible for validating new blocks and appending them to the blockchain.


Disclaimer

This is not a sponsored post. Neither the entities referenced therein nor myself have agreed to any form of compensation in exchange for this content. The contents of this article shall be depicted solely as a means of educating and adding value to its readers.

Comments


bottom of page