How to Setup Ethereum Full Node With POS ON Azure
How to Setup Ethereum Full Node With POS ON Azure
Table of contents
No headings in the article.
Introduction
Ethereum 2.0, also known as Eth2 or Serenity, is a major upgrade to the Ethereum network that includes a shift from a Proof of Work (PoW) consensus mechanism to a Proof of Stake (PoS) consensus mechanism. Ethereum PoS is the new consensus mechanism that will replace the current PoW system used by Ethereum.
In a PoW system, miners use powerful computers to solve complex mathematical problems to validate transactions and add blocks to the blockchain. This requires a significant amount of computational power and energy, which can be costly and environmentally unfriendly. In a PoS system, validators stake their ether to participate in the network and validate transactions. Validators are selected based on their stake, and the amount of new Ether they receive as a reward is proportional to the amount of Ether they have staked.
Ethereum PoS is designed to be more energy-efficient and scalable than PoW, allowing for faster transaction processing times and lower fees. It also provides greater security against certain types of attacks, such as 51% of attacks, where a single entity controls a majority of the mining power.
Overall, the shift to Ethereum PoS is expected to make the Ethereum network more efficient and sustainable and enable the development of new decentralized applications that can scale to meet the needs of a growing user base.
In this article, we will introduce five topics
Ethereum — Ethereum is an open-source, decentralized blockchain platform that features smart contracts. It is the second-largest cryptocurrency by market capitalization after Bitcoin. Ethereum was proposed by Vitalik Buterin in 2013 and launched in 2015. Ethereum enables developers to build decentralized applications (DApps) on top of its blockchain network.
Ethereum Full Nodes — In Ethereum, a full node is a complete implementation of the Ethereum blockchain. It is software that validates and stores all the transactions, smart contracts, and blocks on the Ethereum network.
POS(Proof-of-Stake) — POS stands for Proof of Stake, which is a consensus mechanism or algorithm that is used by blockchain networks, including Ethereum, to validate transactions and add new blocks to the chain.
Azure— The Azure cloud platform is more than 200 products and cloud services designed to help you bring new solutions to life — to solve today’s challenges and create the future. Build, run, and manage applications across multiple clouds, on-premises, and at the edge, with the tools and frameworks of your choice.
Step by Step guide — Guide on how to set up Ethereum Full Node With POS ON Azure.
Step by Step Guide to install, setup, and run Ethereum Full Node With POS ON Azure
This step-by-step guide describes how to launch and connect to Techlatest’s Ethereum Full Node With POS ON Azure
Note
If you want to save time in setting up an Ethereum Full Node with POS fully synced environment, you can opt for Techlatest Ethereum Full Node with POS, available on the Azure marketplace. By launching and connecting to Techlatest’s Ethereum Full Node with POS on Azure, users can set up their synced environment in a few minutes, rather than going through a lengthy installation and syncing process which takes days to sync several GBs of ledger data and costs hundreds of dollars in bandwidth cost.
- Step 1
First, create an Azure account if you don’t have one already.
- Step 2
Open Ethereum Full Node With POS ON Azure listing on Azure Marketplace.
- Step 3
Click on Get It Now.
Select a Resource group for your virtual machine.
Select a Region where you want to launch the VM(such as East US).
Optionally change the number of cores and amount of memory.
Select the Authentication type as Password and enter Username as ubuntu and the Password of your choice.
Optionally change the OS disk type.
Optionally change the network and subnetwork names. Be sure that whichever network you specify has ports 22 (for SSH) and 3389 (for RDP) exposed.
Optionally go to the Management, Advanced and Tags tabs for any advanced settings you want for the VM.
Click on Review + Create and then click on Create when you are done.
Virtual Machine will begin deploying.
- Step 4
A summary page displays when the virtual machine is successfully created. Click on Go to resource link to go to the resource page. It will open an overview page of the virtual machine.
- Step 5
In the left navigation pane, select Run command, select RunShellScript and enter the following command to change the password of the VM.
sudo echo ubuntu:yourpassword | chpasswd
- Step 6
Now the password for Ubuntu users is set, you can connect to the VM’s desktop environment from any local Windows machine using RDP protocol or a local Linux machine using Remmina.
- Step 7
To connect using RDP via Windows Machine, first note the public IP address of the VM from the VM details page as highlighted below.
- Step 8
Then From your local Windows machine, go to the “start” menu, in the search box type and select “Remote desktop connection”.
In the “Remote Desktop Connection” wizard, copy the public IP address and click Connect.
- Step 9
This will connect you to the VM’s desktop environment. Provide the username (e.g. “ubuntu”) and the password set in step 4 to authenticate. Click OK.
- Step 10
Now you are connected to the out-of-box Ethereum Full Node with PoS environment via Windows Machine.
- Step 11
To SSH to the VM, Open putty paste the IP address and click on Open.
- Step 12
Login as ubuntu and provide the password for the ‘ubuntu’ user.
- Step 13
Ethereum Full Node directories:
Ethereum home directory location is /home/ubuntu/ethereum
- Step 14
Ethereum Data directories:
Data directory location is /home/ubuntu/ethereum/datadir
- Step 15
Monitoring and managing node sync process :
The VM automatically starts the sync process on startup. To verify if the sync is in progress, run the below commands.
ps -ef|grep geth
If sync is in progress, you will see the below-highlighted process running.
You can also verify the sync process by monitoring the sync log as shown below.
tail -f /var/log/cloud-init-output.log
You can monitor the lighthouse logs by running the -
Note: If you encounter a JWT authorization error or connection refused error while running the below command, please follow Lighthouse Troubleshooting Guide. to fix them.
sudo journalctl -f -u lighthousebeacon.service -o cat | ccze -A
To stop the sync process, simply run the below command :
sudo killall -HUP geth
To restart the sync process, run the below command.
Note: Make sure the below command is executed from the terminal inside the Remote desktop GUI to avoid process termination.
sudo nohup geth --http --http.addr "0.0.0.0" --http.port "8545" --http.corsdomain "*" --config /home/ubuntu/ethereum/eth_config.toml >> /var/log/cloud-init-output.log 2>&1 &
- Step 16
Tracking sync progress.
You can track the sync progress by attaching it to the running geth console and running the monitoring script as shown below. Note that if the progress is shown as 99% then the node is mostly synced:
sudo geth attach --datadir /home/ubuntu/ethereum/datadir/
this will connect to the console, then run:
loadScript("/home/ubuntu/ethereum/sync_status.js")
- Step 17
Accessing Metamask Ethereum wallet.
The VM comes with Metamask the most popular Ethereum wallet, preinstalled in the Firefox browser.
Connect to the VM via Remote desktop, open the Firefox Browser and you will see the metamask plugin in the browser.
- Step 18
Click on the Metamask icon, and complete the configuration by following the instructions.
Once the Metamask is configured, you will see Metamask is running on Ethereum Mainnet Network.
- Step 19
If you want to connect Metamask on localhost, select localhost 8545 from the Metamask Network dropdown. You should be able to connect to localhost as shown:
- Step 20
If you don’t see localhost and other test network options under the network dropdown, please click on the show/hide link as shown below-
- Step 21
It will take you to the set menu. Here you enable the show test network option and save the changes.
- Step 22
Close the setting page and reopen the network dropdown. Now you should be able to see all the test networks.
Accessing Metamask Ethereum wallet.
The VM comes with Metamask the most popular Ethereum wallet, preinstalled in the Firefox browser.
Connect to the VM via Remote desktop, open the Firefox Browser and you will see the metamask plugin in the browser.
If you want to connect Metamask on localhost, Please add port 8545 to the Security Group of your VM. Follow the below steps to open port 8545:
On your VM’s detail page, click on the networking tab:
It will open the networking details page. Click on Add inbound port rule.
Make changes to the add inbound security rule page as highlighted below. Once done save the changes and restart your VM.
Now select localhost 8545 from the Metamask Network dropdown. You should be able to connect to localhost as shown:
If you don’t see localhost and other test network options under the network dropdown, please click on the show/hide link as shown below-
It will take you to the set menu. Here you enable the show test network option and save the changes.
Close the setting page and reopen the network dropdown. Now you should be able to see all the test networks.
Conclusion
This blog provides a step-by-step guide on how to set up Ethereum Full Node with PoS on Azure by launching and connecting to Techlatest’s Ethereum Full Node with PoS on Azure. The guide includes instructions on how to create an Azure account, select a resource group and region, choose the number of cores and memory, set up authentication, manage the virtual machine, and access the Ethereum Full Node directories and data directories. The guide also includes instructions on how to monitor and manage node sync progress, track sync progress, and access the Metamask Ethereum wallet. Additionally, it provides instructions on how to open port 8545 in the security group of the VM to connect Metamask to localhost. Overall, this blog is a comprehensive guide for anyone interested in setting up Ethereum Full Node with PoS on Azure.