<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aditya Singh</title>
    <description>The latest articles on DEV Community by Aditya Singh (@adityafav).</description>
    <link>https://dev.to/adityafav</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F511545%2F3f22f637-9f14-428b-831f-c5b4f8507420.jpeg</url>
      <title>DEV Community: Aditya Singh</title>
      <link>https://dev.to/adityafav</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adityafav"/>
    <language>en</language>
    <item>
      <title>The Ethereum Merge: What it Means for Developers</title>
      <dc:creator>Aditya Singh</dc:creator>
      <pubDate>Wed, 16 Nov 2022 13:19:22 +0000</pubDate>
      <link>https://dev.to/adityafav/the-ethereum-merge-what-it-means-for-developers-503i</link>
      <guid>https://dev.to/adityafav/the-ethereum-merge-what-it-means-for-developers-503i</guid>
      <description>&lt;p&gt;The Ethereum merge has succeeded! Ethereum has moved from Proof of Work to the Proof of Stake consensus mechanism. Let's talk about what it means for developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  The New Testnets
&lt;/h2&gt;

&lt;p&gt;The Kiln, Rinkeby, and Ropsten testnets are now being deprecated.&lt;/p&gt;

&lt;h3&gt;
  
  
  Goerli &amp;amp; Sepolia: The two testnets that client developers will maintain post-merge.
&lt;/h3&gt;

&lt;p&gt;Ethereum developers recommend Sepolia for users and developers who want a lightweight chain to sync to and interact with. Goerli is recommended for stakers to test protocol upgrades and developers who want to interact with a large existing state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sepolia Characteristics
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Closed validator set, controlled by client &amp;amp; testing teams.&lt;/li&gt;
&lt;li&gt;New testnet, fewer applications deployed than other testnets.&lt;/li&gt;
&lt;li&gt;Fast to sync and running a node requires minimal disk space.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Follow this guide to setup Sepolia:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://learn.block6.tech/sepolia-testnet-cfe6623f05dc"&gt;https://learn.block6.tech/sepolia-testnet-cfe6623f05dc&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps to deploying on Sepolia:
&lt;/h3&gt;

&lt;p&gt;Initialising the project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir hardhat-add &amp;amp;&amp;amp; cd hardhat-add

npm init -y &amp;amp;&amp;amp; npm install --save-dev hardhat dotenv @nomiclabs/hardhat-ethers &amp;amp;&amp;amp; npx hardhat

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The terminal output should show something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;888    888                      888 888               888
888    888                      888 888               888
888    888                      888 888               888
8888888888  8888b.  888d888 .d88888 88888b.   8888b.  888888
888    888     "88b 888P"  d88" 888 888 "88b     "88b 888
888    888 .d888888 888    888  888 888  888 .d888888 888
888    888 888  888 888    Y88b 888 888  888 888  888 Y88b.
888    888 "Y888888 888     "Y88888 888  888 "Y888888  "Y888

👷 Welcome to Hardhat v2.11.2 👷‍

? What do you want to do? … 
❯ Create a JavaScript project
  Create a TypeScript project
  Create an empty hardhat.config.js
  Quit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose &lt;code&gt;Create an empty hardhat.config.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Generate source files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir contracts &amp;amp;&amp;amp; mkdir scripts

touch contracts/Add.sol &amp;amp;&amp;amp; touch scripts/deploy.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a simple smart contract in Add.sol file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

contract Add {
    function add(uint256 a, uint256 b) public pure returns (uint256) {
        return a + b;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a simple deploy script in deploy.js file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const hre = require("hardhat");

async function main() {

  const Add = await hre.ethers.getContractFactory("Add");
  const add = await Add.deploy();

  await add.deployed();

  console.log(
    `Add deployed to ${add.address}`
  );
}

main().catch((error) =&amp;gt; {
  console.error(error);
  process.exitCode = 1;
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Environment variables setup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch .env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the .env file and enter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SEPOLIA_URL=https://rpc.sepolia.org
PRIVATE_KEY="YOUR_ACCOUNTS_PRIVATE_KEY"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Modify the hardhat.config.js file to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require("dotenv").config();
require("@nomiclabs/hardhat-ethers");

const { SEPOLIA_URL, PRIVATE_KEY } = process.env;

module.exports = {
  solidity: "0.8.9",
  defaultNetwork: "sepolia",
  networks: {
    hardhat: {},
    sepolia: {
      url: SEPOLIA_URL,
      accounts: [`0x${PRIVATE_KEY}`],
    },
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compile the Add.sol file with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx hardhat compile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;We have compiled 1 Solidity file successfully.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deploy the contact with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx hardhat run scripts/deploy.js --network sepolia
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add deployed to 0x1d1C7871a99527A06d0140b04f7e44E3Aff4c20D
// address will be different //
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Go &lt;a href="https://sepolia.etherscan.io/"&gt;here&lt;/a&gt; and search with your wallet account address.&lt;/p&gt;

&lt;p&gt;Click &lt;code&gt;Contract Creation&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Click the contract tab and then click "Verify and Publish."&lt;/p&gt;

&lt;p&gt;After filling out a short form, your contract should be published on the testnet blockchain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Goerli Characteristics
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open validator set, stakers can test network upgrades.&lt;/li&gt;
&lt;li&gt;Large state for testing complex smart contract interactions.&lt;/li&gt;
&lt;li&gt;Longer to sync and requires more storage to run a node.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To get goerliETH, follow these links:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/@ethvalidator/a-quick-guide-on-how-to-get-test-eth-in-the-goerli-network-7066dc915989"&gt;https://medium.com/@ethvalidator/a-quick-guide-on-how-to-get-test-eth-in-the-goerli-network-7066dc915989&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;goerlifaucet.com&lt;/p&gt;

&lt;h3&gt;
  
  
  You'll also need an Alchemy account:
&lt;/h3&gt;

&lt;p&gt;dashboard.alchemy.com&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to deploying on Goerli:
&lt;/h2&gt;

&lt;p&gt;Modify the &lt;code&gt;.env&lt;/code&gt; file to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SEPOLIA_URL=https://rpc.sepolia.org
GOERLI_URL=https://eth-goerli.g.alchemy.com/v2/NiATSzYny1Oy-6sqLiBqo7KZIitQHIh9
PRIVATE_KEY="YOUR_ACCOUNTS_PRIVATE_KEY"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your goerli url may be different according to your dashboard.&lt;/p&gt;

&lt;p&gt;Modify &lt;code&gt;the hardhat.config.js&lt;/code&gt; file to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require("dotenv").config();
require("@nomiclabs/hardhat-ethers");

const { SEPOLIA_URL, GOERLI_URL, PRIVATE_KEY } = process.env;

module.exports = {
  solidity: "0.8.9",
  defaultNetwork: "sepolia",
  networks: {
    hardhat: {},
    sepolia: {
      url: SEPOLIA_URL,
      accounts: [`0x${PRIVATE_KEY}`],
    },
    goerli: {
      url: GOERLI_URL,
      accounts: [`0x${PRIVATE_KEY}`],
    },
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deploy by running the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx hardhat run scripts/deploy.js --network goerli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The contract should now be deployed to the Goerli network, and you should be able to see it in etherscan.&lt;/p&gt;

&lt;p&gt;The rest of the process remains the same as that of sepolia.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing Your Frontend Code and Tooling
&lt;/h2&gt;

&lt;p&gt;Most applications on Ethereum involve much more than on-chain contracts. Now is the time to ensure that your front-end code, tooling, deployment pipeline, and other off-chain components work as intended.&lt;/p&gt;

&lt;p&gt;Now is the time to run a complete testing &amp;amp; deployment cycle on Sepolia or Goerli and report any issues with tools or dependencies to those projects' maintainers.&lt;/p&gt;

&lt;p&gt;You can raise an issue on this &lt;a href="https://github.com/eth-clients/merge-testnets/"&gt;repository&lt;/a&gt; in case of uncertainties.&lt;/p&gt;

&lt;h2&gt;
  
  
  You don't have to do much.
&lt;/h2&gt;

&lt;p&gt;The Ethereum developers designed the Merge to have only minimal impact on a subset of contracts deployed on Ethereum, none of which should be breaking. Most user API endpoints remain stable (unless you use proof-of-work specific methods such as &lt;code&gt;eth_getWork&lt;/code&gt;).&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>opensource</category>
      <category>blockchain</category>
    </item>
  </channel>
</rss>
