What is Node? How Node works in blockchain

Nodes are considered the backbone for maintaining and operating a blockchain network. At the same time, they are also a crucial component in shaping the blockchain as a distributed and decentralized ledger.

What is a Node?

Nodes are electronic devices (computers, laptops, phones, etc.) that can interact and connect with each other to form a blockchain network. They help transmit, store, and manage data on that network.

Nodes play important roles such as maintaining blockchain consensus, validating and recording transactions onto blocks, and monitoring activity to ensure network security.

Theoretically, a blockchain exists based on the interconnection of nodes without the need for a central server. Each node is a separate device that stores the entire blockchain data and continuously communicates with other nodes to ensure that all nodes are updated with the latest data.

Nodes in blockchain are devices that help transmit, store, and manage data on the network.

How do nodes work in a blockchain?

Nodes have three main roles: maintaining, validating, and providing access to the network. You can think of nodes as the supervisors of the blockchain.

Each blockchain is a ledger containing all transaction data that has been encrypted and can record new data. And each node must store a copy of the data in that ledger.

When a user submits a request to perform a transaction on the blockchain, the transaction information is sent to miners or validators to await confirmation. Then, depending on the blockchain’s consensus algorithm, it is decided that:

  • The transaction will be validated and recorded onto a new block by miners or validators.
  • The block information containing the transaction will be sent to all other nodes on the network.

The nodes will then collectively validate the legitimacy and accuracy of the transaction to decide whether to accept or reject the block. If the nodes agree to validate and add the block information to their copies, the blockchain reaches consensus, and the transaction is executed.

At the same time, all nodes must update the information about the new block added to the blockchain to ensure data synchronization within the network.

Read more: What is Blockspace? How does block space affect blockchain?

In summary, nodes in a blockchain network must perform the following tasks:

  • Verify whether a transaction block is valid and accept or reject it.
  • If accepted, nodes store the data about that block.
  • Nodes broadcast and transmit this transaction data to other nodes to update and synchronize with the blockchain.
Importance of Nodes in Blockchain

Nodes play a crucial role in operating and maintaining the integrity and security of the network. Without nodes, the blockchain cannot function properly, and data stored on the network can be manipulated, making it easier for hackers to commit fraud.

The operating mechanism of nodes also helps blockchain ensure properties such as:

  • Accuracy: Multiple nodes validate transactions based on a complex consensus algorithm, which helps maintain the accuracy of data on the blockchain.
  • Transparency: Each node stores a copy of the ledger containing all transaction data on the network, ensuring that the blockchain is transparent and all participants in the node system have access to the same information.
  • Distribution: The blockchain network is maintained by nodes in the system across the globe. This helps distribute computing power across many different computers to ensure better results.
  • Decentralization: Nodes connect to form a blockchain network, which is not controlled by any single entity or intermediary organization. This decentralization makes the blockchain more trustworthy and eliminates data manipulation.
  • Consensus: Nodes must adhere to the blockchain’s consensus mechanism to validate and record data onto blocks, which helps the blockchain prevent malicious actors from hijacking the network.
Blockchain Node Types

Generally, there are two main types of nodes: Full nodes and Light nodes.

  • Full nodes store a copy of the historical transaction data on the blockchain, including data for all blocks that have been created.
  • Light nodes only store block headers, which saves hard drive space for participants in the node system.
Full Node

A full node acts as a server in a decentralized network. The main tasks of a full node include maintaining consensus among other nodes and verifying transactions.

A full node also stores a copy of the blockchain ledger, making it more secure and enabling advanced functions such as voting on blockchain proposals.

If more than 51% of the nodes (or a different percentage depending on the blockchain’s rules) disagree with a proposal, it will not be approved. In some cases, this can lead to a hard fork event and a split into two different blockchains. The most typical example is the Bitcoin Hard Fork event.

Some key characteristics of a full node:

  • Stores the complete blockchain data.
  • Participates in block validation, verifying all blocks and states.
  • All states can be derived from a full node.
  • Provides data on demand to light nodes.
Light Node

A light node, or Simple Payment Verification (SPV) node, is a simplified version of a full node.

Instead of storing the entire blockchain, it relies on other full nodes to validate transactions and query information to generate block headers.

Running a light node saves memory and doesn’t require many resources. However, its ability to validate transactions, participate in the consensus process, and secure the blockchain will be limited compared to a full node.

Therefore, light nodes are often used in applications that require low resources, such as cryptocurrency wallets.

Considerations When Running a Node on a Blockchain
Who can run a node on a blockchain?

Theoretically, anyone can join the system and run a node on the blockchain. However, in reality, the requirements for running a node depend on the consensus algorithm of each blockchain. For example:

  • Proof of Work (PoW): PoW blockchains (such as Bitcoin, Litecoin, Ethereum 1.0, etc.) require mining rigs with powerful hardware and high energy consumption, leading to very high costs.
  • Proof of Stake (PoS): Only a select group of “top holders” have the right to run nodes for PoS blockchains (such as Polkadot, Avalanche, Cardano, etc.).
  • Proof of Authority (PoA): Blockchains using PoA (such as BNB Chain, OKExChain, HECO, etc.) require nodes to be reputable and trusted individuals in the community.

Furthermore, depending on the blockchain network, running a node can bring different rewards to participants, such as transaction fees, tokens, governance rights, etc.

Requirements for Running a Node

To run a node on a blockchain, users need to prepare:

  • Hardware resources: A dedicated computer with sufficient processing power (CPU), storage capacity, and memory (RAM) to meet and handle the demands of running a node. Hardware requirements vary depending on the blockchain.
  • Internet network: A stable and reliable internet connection to ensure that the node is always updated promptly and synchronized with the network. This helps avoid offline risks that can cause network instability and node penalties (slashing).
  • Software: Depending on the requirements of the blockchain, users must download and install appropriate software to run a node.
  • Technical knowledge: Equip yourself with sufficient knowledge about blockchain technology to be able to build a suitable machine configuration and troubleshoot node problems when necessary.
A Detailed Guide to Running a Blockchain Node

Basically, setting up and running a blockchain node involves 5 steps:

  • Rent a VPS: There are many websites that offer VPS rental services; the guide below will use Contabo.
  • Receive and enter login information: The login information is sent to the email address registered on the VPS rental site.
  • Install the tmux function: This function allows the node to continue running even when the computer is turned off.
  • Run the node: Depending on the project’s requirements, users will enter different commands to run the node.
  • Reinstall the node (optional): This is done to delete all data stored in the node.

Step 1: Rent a VPS

A VPS (Virtual Private Server) can be understood as a virtual computer for users to run code. Buying a VPS is like buying another computer but without physical ownership.

So why buy a VPS to run a node? Because it’s impossible to guarantee that every project has good security, and in the worst-case scenario (network attack, hacking, etc.), it could affect the data on the user’s computer.

To rent a VPS on Contabo, users need to:

  • Visit https://contabo.com and select the cheapest VPS server.
  • Choose a specific VPS package (I also choose the cheapest package).
  • Select the term length and region. Choose according to your financial capacity.
  • Scroll down and enter the desired password. Keep the other information unchanged, including 200 GB SSD storage, Ubuntu operating system, etc., and click “Next”.
  • Finally, fill in your personal information and payment card details to complete the VPS rental.

Step 2: Receive Login Information

The system will send you a payment confirmation email. Then, the system will send another email to provide your account and password for login.

Next, visit [this link – insert link to password reset page] and change your password by following these steps:

  1. Select “Your services“.
  2. Click “Manage” → “Control“.
  3. Select “Password Reset“.
  4. Enter a new password to complete the process.

The reason for this password change is that the initial password provided by Contabo may not work for login (the reason is unclear).

Step 3: Enter Login Information

Login information includes:

  • IP address from the email containing the login information.
  • The password changed above.

Depending on your operating system, you’ll need to use different key combinations to log in:

  • For Windows: Press the key combination Start + R, type CMD, and press Enter.
  • For macOS: Press the key combination Command + Space, type Terminal, and press Enter.

Enter the following syntax to log in to the VPS:

Then press Enter. For example:

For VPSs being accessed for the first time, the system will display a question. Simply type yes (lowercase) and press Enter.

Next, enter the password you changed above. Note that the password characters will not be displayed on the Terminal, so just type normally and ensure it is correct.

Once completed, press Enter.

Step 4: Enter the tmux Function

tmux is a function to run a node even when the computer is turned off. A VPS is just a regular computer; when you close the Terminal, the VPS will also shut down, and all activities will stop. This causes the node to stop running.

To overcome this, we need to install the tmux function. A node within tmux will run indefinitely until we actively enter a command to stop it.

After successfully logging in, install tmux using the following comman

Then press Enter.

Enter the following command to access tmux:

Then press Enter.

Step 5: Run the Node

Through the above steps, we have completed the setup and are ready to run the node. The remaining steps depend on each project, which uses different programming languages and designs, and therefore has different commands. Users simply need to follow the project’s instructions to execute the required commands.

Step 6: Reinstall the Node (Optional)

Reinstalling the node is the act of deleting all data within the node. After reinstalling, the node will become a completely new node. Here’s how to reinstall:

After logging in to the VPS, click “Your services”.

Click “Manage“, select “Reinstall“.

Enter the password, click “Start Installation“.

The status bar will change from Pending → Running → Finish. If you wait for about 10 minutes and do not see Finish, you can click “Refresh” to update the status.

Leave a Comment

Your email address will not be published. Required fields are marked *