What are Nodes? 5 basic steps of running a blockchain node
What are Nodes? What role does Node play in the operation of Blockchains? How many main types of nodes are there in a Blockchain? Find out now!!!
It can be said that Blockchain Nodes are the infrastructure of Blockchain, in today's article, we will learn what Blockchain Node is, how it works, as well as the main types of nodes in Blockchain.
What are Nodes?
Nodes are nodes that help store, transmit, and preserve blockchain data, so a blockchain theoretically exists on nodes. The core of Blockchain is based on the principles of P2P (Peer to Peer) network. In most networks, there is no central server, but consensus among nodes.
Node can be any type of device, it can be PC, Laptop, larger servers,... Nodes form the infrastructure of a blockchain. All nodes on a blockchain are connected to each other, they constantly exchange the latest data with each other so that all nodes are always up to date.
How Nodes in Blockchain Work?
When a miner or validator tries to add a new block of transactions to the blockchain, they transmit the block to all (or part, depending on the blockchain consensus algorithm used) nodes on the network.
Based on block legitimacy (signature and transaction validity), nodes can accept or reject that block. When a node accepts a new block of transactions, it stores that block on top of the remaining blocks it has stored. In a nutshell, this is what nodes do:
- Nodes check if a block of transactions is valid and accept or reject it.
- If accepted, the nodes will store transaction blocks (store blockchain transaction history).
- Nodes broadcast and propagate this transaction history to other nodes to synchronize with the blockchain (transaction history updates).
Classification of Nodes in Blockchain
There are two main types of nodes:
- Full nodes (full nodes).
- Lightweight nodes (light nodes).
Full Node acts as a server in a decentralized network. Its main tasks include maintaining consensus among other nodes and verifying transactions.
It also stores a copy of the blockchain, thus being more secure and allowing advanced functions like voting for proposals in the network. Some key characteristics of a Full Node:
- Fully store blockchain data.
- Participate in block confirmation, verify all blocks and status.
- All states can originate from the full node.
- Deliver data on demand to lightweight nodes.
Another type of node used in daily crypto operations, are Lightweight nodes, or Simple Payment Verification (SPV) nodes.
These types of nodes communicate with the blockchain while relying on full nodes to provide them with the necessary information. Since they don't store a copy of the entire blockchain, they just query the current state to process transactions.
Running Lightweight nodes doesn't require a lot of resources, but it sacrifices security for the sake of convenience.
Who can run a Blockchain Node?
Theoretically, anyone can run a blockchain node, but depending on the consensus algorithm of that blockchain there are certain requirements:
However, with Blockchains like BSC, Okexchain, HECO, etc. They use Proof of Authority (PoA) consensus algorithm, a consensus algorithm based on reputation. Meaning, anyone can run a node, but to validate PoA chains you have to be really reputable in that community, which is not suitable for the vast majority of ordinary users.
Or with blockchain using the Delegated Proof of Stake ( DPoS ) consensus algorithm, this is an algorithm based on the value of tokens that users hold, in other words, only “top holders” have the right to run nodes. for these blockchains, this is also not suitable for the vast majority of general users.
There are also more decentralized blockchains with significantly lower entry limits like Ethereum. Ethereum encourages users to run their own node to allow them to use Ethereum reliably and privately, while still supporting the ecosystem.
Some benefits of running an Ethereum Full Node yourself:
- Your node verifies all transactions by itself according to the consensus rules. This means you don't have to rely on any other nodes in the network or trust them completely.
- You won't have to leak your address and wallet balance to random nodes.
- Your dapp can be more secure and private if you use your own node.
- You can program your own custom RPC endpoints.
Some benefits for Ethereum Network:
- A diverse set of nodes is vital to the security and resiliency of Ethereum.
- Full nodes provide access to blockchain data to the lightweight nodes that depend on it.
5 basic steps to run Node for newbies
In addition to staking tokens/coins to become Node, there is another form of running Node through Node. This method is often picky because most crypto players are not familiar with Node.
Usually running Node with code for testnet , because the project has not released the token yet. But also because there is no token, the opportunity to receive Retroactive is great.
There are many sites that provide VPS rental services. One of them is Contabo. In most cases, just buying the cheapest option is enough. Here are the steps I usually do:
- Rent VPS.
- Get login information.
- Import the tmux function.
- Depending on the project, then enter different commands.
Step 1: Rent a VPS
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 not physically owning it.
So why buy a VPS to run Node? Because most testnet projects do not have good security, using the main machine can affect the data.
First, go to contabo.com/en and choose the cheapest VPS.
Next, choose specifically VPS, I also choose the cheapest one.
Choose a time and place. Here I choose 12 months and ASIA.
Update: You DO NOT NEED to choose Asia, just choose European Union for savings.
Scroll down and enter Password. The remaining information remains the same, including 200 GB SSD memory, Ubuntu operating system... and click Next.
Finally, fill in the personal information and payment card to complete the VPS rental.
Step 2: Get login information
Once done, the system will email you.
Wait a moment, there will be a follow-up email providing the login account and password as follows:
Then go to my.contabo.com/account/login to sign in. Change the password in turn according to the following steps: Select Your services .
Next click Manage → Control.
Click Password Reset .
Finally enter the new Password and you're done. The reason there is a step to change the password is because Contabo's initial password cannot be logged in for unknown reasons.
Step 3: Enter login information
The login information includes the IP we got in the login email, along with the changed password above.
To log in, depending on the operating system, there are different ways:
- Windows: Start + R; then search CMD and Enter.
- MacOS: Command + Space; then search Terminal and Enter.
You click the following syntax to log in to VPS:
Then press Enter. For example:
For VPSs logging in for the first time, the system will ask as follows. We press yes (pay attention to lowercase, because sometimes it will be capitalized) and Enter.
Next, you enter the password changed above. Note, the Password characters do not appear on Terminal, so you just press normally. Once done, press Enter .
Step 4: Import the function tmux
tmux is the function to run Node when you shutdown. VPS is just a regular computer, when we turn off Terminal, VPS will also turn off, and all activities will also stop. This stops Node running.
To fix this, we need to install tmux. When running Node in tmux will run forever until we actively stop, without being affected by shutdown.
After successful login, install tmux with the following command:
Then Enter .
To access tmux, press the following command:
Then press Enter .
Step 5: Run Node
Through the above steps, we have gone through the basic steps to run Node. The rest depends on each project using the programming language and design, which has different commands.
Reinstall node (optional)
Reinstall node is the action of deleting ALL data in the node, used when you have a lot of data but don't want, or don't know how to delete it manually. After reinstalling, the node will become a completely new node. How to reinstall as follows:
After logging in to the VPS, click Your services .
Click Manage , select Reinstall .
Then you enter the password, click Star Installation .
The status bar will be Pending → Running → Finish . If you wait about 10 minutes without seeing Finish, you can click Refresh to refresh the status.
So we have learned what Node is, how it works, the main types of Node in a Blockchain and how to log in to VPS to run Node. If you have other questions related to the above topic, please comment below so that FoxCryptoNews can help you right away!
Sep 30, 2022