How to Setup Ethereum Full Node With POS ON Azure

TechLatest.Net
Coinmonks
10 min readApr 21, 2023

--

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% 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 to 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 a 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 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 advance 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 virtual machine

  • Step 5

In the left navigation pane, select Run command , select RunShellScript and enter following command to change the password of the vm .

sudo echo ubuntu:yourpassword | chpasswd
  • Step 6

Now the password for ubuntu user is set, you can connect to the VM’s desktop environment from any local windows machine using RDP protocol or local linux machine using Remmina.

  • Step 7

To connect using RDP via Windows Machine, first note the public IP address of the VM from VM details page as highlighted below.

  • Step 8

Then From you local windows machine, goto “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 the step4 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 ‘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 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 -

Note: If you encounter 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 below command :

sudo killall -HUP geth

To restart the sync process, run below command.

Note: Make sure below command is executed from terminal inside 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 to the running geth console and running the monitoring script as shown below . Note that if the progress is shown 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 Firefox browser.

Connect to the VM via Remote desktop , open the Firefox Browser and you will see metamask plugin in the browser.

  • Step 18

Click on the Metamask icon, complete the configuration by following the instructions.

Once the Metamask is configured, you wil see Metamask is running on Ethereum Mainnet Network.

  • Step 19

If you want to connect Metamask on localhost, select localhost 8545 from Metamask Network dropdown. You should be able to connect to localhost as shown:

  • Step 20

If you don’t see localhost and other testnetwork options under network dropdown, please click on show/hide link as shown below-

  • Step 21

It will take you to setting menu. Here you enable show test network option and save the changes.

  • Step 22

Close the setting page and reopen 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 Firefox browser.

Connect to the VM via Remote desktop , open the Firefox Browser and you will see 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 below steps to open port 8545:

On your VM’s detail page, click on networking tab:

It will open 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 Metamask Network dropdown. You should be able to connect to localhost as shown:

If you don’t see localhost and other testnetwork options under network dropdown, please click on show/hide link as shown below-

It will take you to setting menu. Here you enable show test network option and save the changes.

Close the setting page and reopen 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.

--

--

Coinmonks
Coinmonks

Published in Coinmonks

Coinmonks is a non-profit Crypto Educational Publication.

TechLatest.Net
TechLatest.Net

Written by TechLatest.Net

TechLatest.net delivers cutting-edge tech reviews, tutorials, and insights. Stay ahead with the latest in technology. Join our community and explore the future!