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.
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
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
Preparation
Requirements
Step 1: Set up Ubuntu Server as a Virtual Machine (VM)
Step 2: Adjust the VM Settings
Step 3: Configure Ubuntu Server and OpenSSH
Launch and Configure Ubuntu Server
Set Up the Ubuntu Server Profile
Install OpenSSH Server on the VM
Install Command Line Tools for the Server
Updating the VM and Installing CNTools
Launching the Cardano Node
Install the Node Components
Deploy the Cardano Node
Restoring the Security Settings
PREPARATION
Requirements
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.
Launch VirtualBox.
From the Tools menu, select New.
Name: Ubuntu Server
Machine Folder: {{prefilled; do not change}}
Type: Linux
Version: Ubuntu 64-bit
Select Continue.
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.
Confirm the "Create a virtual hard disk now" option is selected, then click Create.
Select VDI (VirtualBox Disk Image), then Continue.
Select Dynamically allocated, then Continue.
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.
Step 2: Adjust the VM Settings
The virtual machine will require a few adjustments to effectively run the node.
To begin, right-click on the Ubuntu Server thumbnail in the toolbar and click Settings.
Go to System > Processor > Adjust the slider to 4.
Go to Storage
Select the disk labeled 'Empty' > Click the blue disk icon > "Choose a disk file."
Locate/select the Ubuntu Server download (.iso or.dmg file type), then Open.
Go to Network > "Attached to" > Bridged Adapter.
Click OK to apply the changes.
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.
With Ubuntu Server selected in the VirtualBox toolbar, click Start.
Mac OS users may encounter a 'kernel driver not installed' error. To resolve...
Go System Preferences > Privacy & Security. If necessary, click on the padlock icon and enter your administrator password to authorize access.
A message about Oracle may be displayed next to an 'Allow' button. Click Allow and a prompt to restart the system should appear.
Select Restart and wait for the system to reboot. Once it has finished, relaunch VirtualBox and start the Ubuntu Server again.
Perform the following actions on the next screens:
Select your preferred language. > Done (Return key)
Leave Keyboard Configurations unchanged. > Done
Leave Network Connections unchanged. > Done
Leave Configure Proxy unchanged. > Done
Leave Configure Ubuntu Archive Mirror unchanged. > Done
At Guided Storage Configuration, we will add two (2) partitions for the Ubuntu Server. Apply the following settings:
Use the arrow-down key to move the cursor to Custom Storage Layout, then press the Return key.
Move the cursor to Done > Return
The local disk will then be displayed and highlighted, press Return.
Arrow-down to Add GPT Partition > Return
Set the size to 2 - 4G (4G will be used for this example) > Return
For the Format, press Return > arrow-down to Swap > Return
Arrow-down to Create > Return
Next, arrow-down to the local disk > Return
Again, select Add GPT Partition > Return
This time, leave all fields empty, then arrow-down to Create.
Ubuntu Server will now show the two (2) partitions created on the local disk. From here, arrow-down to Done > Return
A popup message that reads Confirm destructive action will appear, arrow-down to Continue > Return
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}}
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.
The cursor next to Install OpenSSH Server is blinking, press Return to select.
Leave Import SSH Identity set to No > arrow-down to Done > Return
Leave Featured Server Snaps unchanged > arrow-down to Done > Return (the installation process will begin).
Once the installation has completed, arrow-down to Reboot Now > Return
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).
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.
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.
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.
Start the Ubuntu Server machine.
Enter the username and password when prompted.
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.
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
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
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
RESTORING THE SECURITY SETTINGS
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.
Quit LiveView (press the Esc or Q key).
Go to the Menu bar > Terminal > Quit Terminal > Terminate.
Power down the Ubuntu Server machine.
Go to the Menu bar > VirtualBox > Quit VirtualBox.
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