How to set up Cardano Node?
In this context, let’s explore Cardano. Its founders have positioned it as a third-gen blockchain because it has been designed to resolve the limitations of the first and second-gen blockchains by solving pain points like scalability, interoperability, and sustainability.
Cardano is a proof-of-stake blockchain platform that facilitates the development of dApps and systems bearing unparalleled security and sustainability. Though every blockchain platform is unique in its capacities, Cardano has a specialty. It is the first-ever Blockchain developed through peer-reviewed research and evidence-based methods.
- What is Cardano?
- Why use Cardano?
- What is the Cardano node?
- How does Cardano Node work?
- How to set up Cardano nodes?
- How to run the Cardano node.
- What kind of Cardano development services can LeewayHertz offer?
- What’s next?
What is Cardano?
Cardano is a decentralized third-generation proof-of-stake (POS) blockchain protocol designed to address the challenges of the proof-of-work (POW) system. Although Bitcoin and Ethereum are the world’s largest cryptocurrencies, the co-founder of Ethereum, Charles Hoskinson, understood the challenges associated with these two networks. He identified that scalability, sustainability, and interoperability were hard to achieve on the POW-based blockchain system.
High cost, slow transaction processing, high energy consumption, and limited infrastructure were also the shortcomings of proof-of-work consensus. This created the need for a more effective, transparent, and faster blockchain platform – Cardano.
Once done with enough research and having collected expert opinions on the vision, Charles Hoskinson began developing Cardano. He finally came up with a robust Blockchain protocol built around peer-reviewed research and evidence-based methods. Cardano utilizes the Ouroboros consensus protocol, which is fully secure and approved by academic scholars. Ouroboros can run on both permissioned and permissionless blockchain platforms. This feature has been rapidly getting traction across the companies looking for Cardano-based solutions.
Other Key Facts:
- Cardano adopts proof-of-stake consensus protocol, where it appoints slot leaders for mining and validation of transactions. Simply put, miners can put their owned crypto possessions at stake for verification purposes.
- Cardano ecosystem is being deployed in five phases: foundation, decentralization, smart contract integration, scaling, and governance.
- On 13th September 2021, Cardano announced the arrival of Alonzo Hard Fork that facilitates smart contract creation and deployment on the mainnet. The update will help Cardano improve overall functionalities aside from widening the ecosystem through DeFi app development.
Why use Cardano?
Cardano is based on peer-reviewed papers. The protocol does not act on uncertain action plans. Instead, Cardano follows the research work and development methodologies proposed by the community experts that are reviewed by peer-group members, and only when the majority has consented to particular ideas, it gets into implementation. Moreover, Cardano embraces constant evolution through the best engineering and development practices, backed by continuous evolutionary research.
As mentioned, Cardano aims to remove the painful area of previous generation blockchains by concentrating on three main elements, scalability, interoperability, and sustainability.
Cardano achieves scalability by solving problems related to TPS (transaction per second), network bandwidth, data storage, etc. It again adopts the proof-of-stake mechanism and implements a unique technique called RINA that splits the network into various subnetworks to reduce bandwidth usage on each Cardano node. The protocol also tackles data storage issues with techniques like pruning, compression, and partitioning.
To overcome the limitation of blockchain interoperability, Cardano operates as a reliable multi-functional ecosystem. It allows multiple currencies to exist side by side and seamlessly move across multiple chains. For instance, banks, commercial spaces, and businesses can engage with multiple cryptocurrencies with a single blockchain without any hassle.
To ensure the Cardano network’s sustainability and to confirm that it receives technology development support in the future, Cardano has created a treasury. Treasury is a special wallet that receives a certain percentage of funds whenever a transaction rolls down on the network. The treasury fund is used to reward the developers for their Cardano ecosystem or protocol development services.
What is the Cardano node?
Cardano node is the key element inside the blockchain framework that upholds the entire network. Alternatively, the Cardano blockchain network consists of nodes interconnected to drive data exchanges and validate the transactions via the POS consensus mechanism. The definition of consensus differs from network to network. The Cardano network is supported by Ouroboros protocol. To join and contribute to the blockchain platform, users run Cardano nodes. And, in the context of Alonzo testnet, Cardano establishes and manages separate nodes, aside from the mainnet, which makes it easy for the miners to test and verify the ledger.
How does Cardano Node work?
Cardano node acts exactly how banks and authorized entities work in the centralized financial system. It’s basically a service node that authenticates the interaction within the network to impart complete transparency. Nodes further undertake the responsibility to validate transactions and produce blocks.
Cardano produces individually verifiable blocks in a peer-to-peer protocol. The platform employs a robust block-producing system to develop the blockchain. Meanwhile, consensus adds security layers and decides who can participate.
Validation of transactions is a method in which slot leaders ascertain the needed amount for the senders. Their obligation also includes the determination of transactional parameters. Once confirmed, leaders record the data assuming it is an active block, to add it later after cross-verification.
How to set up the Cardano node in simple steps?
Since we have all the crucial information, such as Cardano and Cardano node definition, it’s time to discuss how to set up the Cardano node. We will explain installing the node and running it into multiple operating systems from the source node.
You will need the following for component setup:
Any latest operating system, whether Windows, Linux, or MacOS.
Dual-core CPU, 8GB RAM, and 10GB disk space.
Note:- Do not use a firewalled network. We recommend using TCP/IP 3000 and 3001 to establish an uninterrupted connection between the nodes.
Select the desired operating system
The section is entirely dedicated to explaining Cardano node setup into the Linux operating system. We will go through the download, compilation, and installation process in sheer steps.
Step 1: OS (operating system) dependencies Installation
- In order to download and then built the source code, you should have the
- given tools and packages on the Linux system:
- the version control system git
- the gcc C-compiler
- C++ support for gcc
- developer libraries for the arbitrary precision library gmp
- developer libraries for the compression library zlib
- developer libraries for systemd
- developer libraries for ncurses
- ncurses compatibility libraries
- the Haskell build tool cabal
- the GHC Haskell compiler (version must be 8.10.4 or above)
If you are working on Redhat, Centos, and Fedora, then type the command:
sudo yum update -y sudo yum install git gcc gcc-c++ tmux gmp-devel make tar xz wget zlib-devel libtool autoconf -y sudo yum install systemd-devel ncurses-devel ncurses-compat-libs -y
And, for Debian or Ubuntu, type the following command:
sudo apt-get update -y sudo apt-get install automake build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 libtool autoconf -y
Furthermore, the yum or apt-get package manager won’t be compatible with the different flavors of Linux. In that plot, you need to choose a suitable different package manager after a thorough examination.
Step 2. GHC and cabal installation
GHC Stands for Glassglow Haskell Compiler and Cabal for Common Architecture for Building Applications and Libraries. Using ghcup, one can conveniently and quickly install GHC and Cabal.
Type the given command to install and use ghcup:
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
Now, follow the further instructions properly to equip essential input to the installer. When done right, you will have ghc and cabal installed into your operating system.
You can also ensure if the ghcup is installed properly. For doing so, you need to type the command prompt- ghcup –version in the terminal. The result will appear like this:
The GHCup Haskell installer, version v0.1.14.1
Although ghcup automatically installs the latest ghc version, most blockchain infrastructure experts suggest ghc 8.10.4 to worldwide users. Hence, we will stick to the recommendation and use ghcup to install and swap to the latest version. Here’s the command:
ghcup install ghc 8.10.4 ghcup set ghc 8.10.4
The next step is to validate the versions of ghc and cabal.
Verify ghc version using:
The input will display something similar to this:
The Glorious Glasgow Haskell Compilation System, version 8.10.4
Checking the cabal version:
The command will display something similar to this:
cabal-install version 188.8.131.52 compiled using version 184.108.40.206 of the Cabal library
Note: Before you jump to the next step of Cardano node installation, double-check that your installed version should align with the recommended version. No issues will occur unless you have skipped a few of the previous steps.
Step3: Download and compilation
The section will guide you on the creation of a working directory used to store source-code and builds. Run the command:
mkdir -p ~/cardano-src cd ~/cardano-src
After this, you need to download, compile, and then install libsodium.
Use the command:
git clone https://github.com/input-output-hk/libsodium cd libsodium git checkout 66f017f1 ./autogen.sh ./configure make sudo make instal
We will add the given command into the bottom part of configuration files based on the shell application you use (~/.zshrc or ~/.bashrc). It helps the compiler to determine the libsodium installation in the system.
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
Again, depending on your preferred shell application, we have to reload the shell profile to explore the new variables. For that, start typing source ~/.bashrc or source ~/.zshrc.
Enriching your project with the best of Cardano
LeewayHertz Cardano Blockchain Development Company
Then, download the repository: Cardano-node
git clone https://github.com/input-output-hk/cardano-node.git cd cardano-node git fetch --all --recurse-submodules --tags
Get the latest tag commit on the git repository:
git checkout tags/1.27.0
Step4: Configuration of build option
You must use the same ghc version that we already installed. By doing so, it prevents defaulting the ghc’s system version.
cabal configure --with-compiler=ghc-8.10.4
Now, to use the Libsodium, you will need to revamp the local project:
echo "package cardano-crypto-praos" >> cabal.project.local echo " flags: -external-libsodium-vrf" >> cabal.project.local
Step 5: Building up and installation of the node
You can construct a Haskell-based Cardano-node as it produces feasible binaries.
cabal build all
Proceed to install the generated node and CLI commands into ~/.local/bin directory.
mkdir -p ~/.local/bin cp -p "$(./scripts/bin-path.sh cardano-node)" ~/.local/bin/ cp -p "$(./scripts/bin-path.sh cardano-cli)" ~/.local/bin/
Don’t forget to add the command right below the Shell profile. The command helps the associated terminal to identify cardano-node and cardano-cli as global commands.
Once you saved the shell profile, reload it by writing: source ~/.zshrc or source ~/.bashrc (shell script depends on which application you choose)
Now, check the installed version.
cardano-cli –version cardano-node –version
Kudos! You are done with the installation of Cardano components in Linux.
Here, we will discover how to set up the Cardano node into MacOS. We will go through the download, compilation, and installation process. (Useful for Intel-based hardware).
Step1: OS (operating system) dependencies installation
To download and then built the source code, you should have the given tools and packages on the MacOS system:
Xcode - The Apple Development IDE and SDK/Tools Xcode Command Line Tools, you can install it by typing xcode-select --install in the terminal.
Homebrew – The Missing Package Manager for MacOS (or Linux)
Step2: Homebrew packages installation
For the proper compilation of both cardano-node and cardano-cli, you need to install libraries via brew:
brew install jq brew install libtool brew install autoconf brew install automake brew install pkg-config
Other steps are the same as what we did for Linux. (Refer to step 3 to the final step).
Windows Cardano-node installation is quite similar to MacOs and Linux. All you need is to use WSL (windows subsystem for Linux) to transform the windows environment into Linux.
After that, you can follow the Linux guide to set up and install the Cardano node.
How to run the Cardano Node?
Running the Cardano node requires the implementation of the run command. Type the following in the terminal.
cardano-node run \ --topology path/to/mainnet-topology.json \ --database-path path/to/db \ --socket-path path/to/db/node.socket \ --host-addr x.x.x.x \ --port 3001 \ --config path/to/mainnet-config.json
What kind of Cardano development services can LeewayHertz offer?
LeewayHertz offers a wide range of blockchain development services, including Cardano development services. Our core focus is to provide end-to-end solutions starting from conceptualization to development to maintenance and upgrade. We adopt the emerging technologies of advanced blockchain protocols, combine them with our expertise and develop solutions that meet today’s business needs. Check out a glimpse of our Cardano development services:
Our blockchain developers are proficient in developing powerful Cardano nodes. They have a complete understanding of the Cardano ecosystem, proof-of-stake consensus algorithm, Alonzo testnet, and other components essential for node creation.
We offer Cardano-based app development services to diverse industries. Our developers abide by Cardano’s latest advances and employ them for developing enterprise-grade decentralized applications.
Smart contract development
We develop smart contracts that comply with Cardano’s programming languages and support various dApps. Aside from development, we perform thorough assessments and security audits to ensure proper optimization of the smart contracts.
Our blockchain developers are skilled in developing all types of digital wallets. We can build Cardano wallets apps for storing, delegating, and trading ADA cryptocurrencies, cardano native tokens and any other type of digital currencies.
As evident, Cardano is a highly mutative blockchain network seeking to change the blockchain space and its real-world applications. However, with the latest advances in emerging blockchain technologies like Cardano, the scope of blockchain development and deployment will also experience major changes. Businesses looking forward to leading the competition must acquire more advanced scalable, interoperable and sustainable blockchain solutions by leveraging blockchain development companies’ expertise, experience, and knowledge.
If you are looking for a high-grade & scalable decentralized dApp, you can connect with our Cardano blockchain experts. Our team does its job with keen consideration, from designing to consultation.
Start a conversation by filling the form
All information will be kept confidential.
NFT marketplaces are undoubtedly a profitable business. NFT marketplaces will invariably deliver desired results when developed with certain dos and don’ts in mind.
Play-to-earn games are decentralized games that allow players to earn rewards like cryptocurrencies and NFTs by completing tasks, combating other players, and progressing through different game levels.
We can use the web3 technology stack to create a better internet, which offers greater control and enhances the user experience.