<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Olubisi Idris Ayinde on Medium]]></title>
        <description><![CDATA[Stories by Olubisi Idris Ayinde on Medium]]></description>
        <link>https://medium.com/@olanetsoft?source=rss-41c6f1ecf0f3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5zHihazbf8USTc1VTKZq0g.png</url>
            <title>Stories by Olubisi Idris Ayinde on Medium</title>
            <link>https://medium.com/@olanetsoft?source=rss-41c6f1ecf0f3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 04:24:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@olanetsoft/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Build a Cross-chain Airdrop Dapp With Solidity, NextJs, and Axelar]]></title>
            <link>https://olanetsoft.medium.com/how-to-build-a-cross-chain-airdrop-dapp-with-solidity-nextjs-and-axelar-b69c28bc9780?source=rss-41c6f1ecf0f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b69c28bc9780</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[axelar]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[crosschain]]></category>
            <dc:creator><![CDATA[Olubisi Idris Ayinde]]></dc:creator>
            <pubDate>Thu, 28 Sep 2023 16:25:14 GMT</pubDate>
            <atom:updated>2023-09-29T11:52:20.960Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wRIomrhtnE_2m4ICEMFBlA.png" /><figcaption>How to Build a Cross-chain Airdrop Dapp With Solidity, NextJs, and Axelar</figcaption></figure><p>Airdrops are part of a strategy for distributing coins or tokens to wallet addresses. In Web3, airdrop serve as a method to reward community members for their contributions and promote adoption, which involves distributing newly minted tokens to thousands of distinct wallet addresses simultaneously. While this has typically been done on a single blockchain in the past, you will learn how to execute a cross-chain airdrop that extends this process across multiple chains.</p><p>In this tutorial, you will learn how to build a cross-chain airdrop decentralized application (dApp) using Solidity, Next.js, and <a href="https://dub.sh/N3LzdKr">Axelar General Message Passing (GMP)</a> for distributing tokens across multiple chains.</p><p>What are we building? This application guides you through a simple four-step process that empowers users to:</p><ul><li>Connect their wallet.</li><li>Authorize the airdrop token amount for spending.</li><li>Add wallet addresses.</li><li>Distribute tokens from Polygon to Avalanche testnet via airdrop.</li></ul><p>To get started quickly, you’ll find the entire code for this tutorial on <a href="https://github.com/axelarnetwork/cross-chain-airdrop-dapp">GitHub</a>. This way, you can explore the application’s inner workings as you follow along.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_huEt4RjAkQWt-Wt.png" /><figcaption>Cross-chain Airdrop DApp with Solidity, Next.js &amp; Axelar</figcaption></figure><h3>Prerequisite</h3><p>Before getting started, you need the following prerequisites:</p><ul><li><a href="https://nodejs.org/en/">Node.js</a> and its package manager NPM, version 18. Verify Node.js is installed by running the following terminal command: node -v &amp;&amp; npm -v</li><li>A basic understanding of <a href="https://www.w3schools.com/js/default.asp">JavaScript</a>, <a href="https://www.tutorialspoint.com/solidity/index.htm">Solidity</a>, and <a href="https://www.w3schools.com/REACT/DEFAULT.ASP">React/Next.js</a>.</li></ul><h3>Project Setup and Installation</h3><p>To start the project setup and installation quickly, clone this <a href="https://github.com/axelarnetwork/cross-chain-airdrop-dapp/tree/start">project on GitHub</a> using the following command:</p><pre>git clone https://github.com/axelarnetwork/cross-chain-airdrop-dapp.git</pre><p>Make sure you’re on the start branch using the following command:</p><pre>git checkout starter</pre><p>Next, change the directory into the cloned folder and install the project locally using npm with the following command:</p><pre>cd cross-chain-airdrop-dapp &amp;&amp; npm i &amp;&amp; npm run dev</pre><p>The npm run dev will start a Next.js hot-reloading development environment accessible by default at <a href="http://localhost:3000/">http://localhost:3000</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FS800a80e_AGA0wO.png" /><figcaption>How to Build a Cross-chain Airdrop DApp with Solidity, Next.js &amp; Axelar</figcaption></figure><p>To successfully create a smart contract for an airdrop using Axelar’s general message passing, it’s important to understand how it enables cross-chain interaction. The following section will explain how it works.</p><h3>Getting Started with Axelar General Message Passing (GMP)</h3><p><a href="https://dub.sh/N3LzdKr">Axelar’s General Message Passing (GMP)</a> feature empowers developers to call any function on interconnected chains seamlessly.</p><p>With GMP, developers gain the ability to:</p><ol><li>Call a contract on chain A and interact with a contract on chain B.</li><li>Execute cross-chain transactions by calling a contract on chain A and sending tokens to chain B.</li></ol><h3>Building a smart contract using Hardhat and Axelar GMP</h3><p>In this section, you will build the smart contract leveraging Axelar GMP to airdrop tokens from the Polygon testnet to the Avalanche testnet.</p><p>Navigate to the project’s root folder you cloned in the previous step, and then run the following commands to create a new Hardhat project.</p><pre>mkdir hardhat cd hardhat npm install --save-dev hardhat</pre><p>Get a sample project by running the command below:</p><pre>npx hardhat</pre><p>Accept the following options:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ES2p69k2oKfPSlNr.png" /><figcaption>Accept the following hardhat options</figcaption></figure><p>The @nomicfoundation/hardhat-toolbox plugin includes all the commonly used packages and recommended Hardhat plugins for starting development with Hardhat.</p><p>In case it wasn’t installed automatically, install this additional requirement using the following command:</p><pre>npm i @nomicfoundation/hardhat-toolbox@3.0.0</pre><p>Next, install @axelar-network/axelar-gmp-sdk-solidity for Axelar General Message Passing SDK in Solidity and dotenv with the following command:</p><pre>npm i @axelar-network/axelar-gmp-sdk-solidity@3.6.1 dotenv</pre><p>To ensure everything functions properly, execute the following command within the hardhat directory.</p><pre>npx hardhat test</pre><p>You will see a passed test result in your console.</p><p>To start building from scratch, it’s important to clean up the directory. To accomplish this task, delete Lock.js from the test folder and remove deploy.js from the scripts directory. After that, navigate to the contracts folder and delete Lock.sol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/0*SA4aMG0bcVhLQxuZ.png" /></figure><p>Delete lock.js file</p><blockquote><em>The folders themselves should not be deleted!</em></blockquote><p>Create an Airdrop.sol file inside the contracts directory and update it with the following code snippet. When using Hardhat, file organization is crucial, so pay attention!</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.9;<br><br>import {AxelarExecutable} from &quot;@axelar-network/axelar-gmp-sdk-solidity/contracts/executable/AxelarExecutable.sol&quot;;<br>import {IAxelarGateway} from &quot;@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGateway.sol&quot;;<br>import {IERC20} from &quot;@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IERC20.sol&quot;;<br>import {IAxelarGasService} from &quot;@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGasService.sol&quot;;<br><br>// Airdrop contract that inherits from AxelarExecutable<br>contract Airdrop is AxelarExecutable {<br>    // Immutable reference to the gas service contract<br>    IAxelarGasService public immutable gasService;<br>    // Variables to track airdrop details<br>    uint256 public amountReceived;<br>    address[] public airdropRecipients;<br>    // Constructor to initialize the contract<br>    constructor(address gateway_, address gasReceiver_) AxelarExecutable(gateway_) {<br>        // Initialize the gas service contract<br>        gasService = IAxelarGasService(gasReceiver_);<br>    }<br><br>    // Function to initiate airdrop to multiple recipients on another chain<br>    function sendToMany(<br>        string memory destinationChain,<br>        string memory destinationAddress,<br>        address[] calldata destinationAddresses,<br>        string memory symbol,<br>        uint256 amount<br>    ) external payable {<br>        // Require a gas payment for the transaction<br>        require(msg.value &gt; 0, &quot;Gas payment is required&quot;);<br>        // Get the token address associated with the provided symbol<br>        address tokenAddress = gateway.tokenAddresses(symbol);<br>        // Transfer tokens from sender to this contract<br>        IERC20(tokenAddress).transferFrom(msg.sender, address(this), amount);<br>        // Approve the gateway to spend tokens on behalf of this contract<br>        IERC20(tokenAddress).approve(address(gateway), amount);<br>        // Encode the recipient addresses into a payload<br>        bytes memory payload = abi.encode(destinationAddresses);<br>        // Pay for native gas using the gas service contract<br>        gasService.payNativeGasForContractCallWithToken{value: msg.value}(<br>            address(this),<br>            destinationChain,<br>            destinationAddress,<br>            payload,<br>            symbol,<br>            amount,<br>            msg.sender<br>        );<br>        // Initiate a contract call on the gateway<br>        gateway.callContractWithToken(<br>            destinationChain,<br>            destinationAddress,<br>            payload,<br>            symbol,<br>            amount<br>        );<br>    }<br><br>    // Function to retrieve the list of airdrop recipients<br>    function getRecipients() public view returns (address[] memory) {<br>        return airdropRecipients;<br>    }<br><br>    // Internal function to execute airdrop on the current chain<br>    function _executeWithToken(<br>        string calldata,<br>        string calldata,<br>        bytes calldata payload,<br>        string calldata tokenSymbol,<br>        uint256 amount<br>    ) internal override {<br>        // Decode the payload to get the recipient addresses<br>        address[] memory recipients = abi.decode(payload, (address[]));<br>        // Get the token address associated with the provided symbol<br>        address tokenAddress = gateway.tokenAddresses(tokenSymbol);<br>        // Set amountReceived and airdropRecipients variables<br>        amountReceived = amount;<br>        airdropRecipients = recipients;<br>        // Calculate the amount of tokens to send to each recipient<br>        uint256 sentAmount = amount / recipients.length;<br>        // Transfer tokens to each recipient<br>        for (uint256 i = 0; i &lt; recipients.length; i++) {<br>            IERC20(tokenAddress).transfer(recipients[i], sentAmount);<br>        }<br>    }<br>}</pre><p>In the code snippet above:</p><ul><li>It defines a Solidity contract named Airdrop that extends the AxelarExecutable contract.</li><li>The contract imports several Solidity interfaces and contracts from the @axelar-network/axelar-gmp-sdk-solidity package.</li><li>The constructor of the contract takes two parameters: gateway_ and gasReceiver_. It initializes the gasService variable with the gasReceiver_ address and calls the constructor of the AxelarExecutable contract with the gateway_ address.</li><li>The contract has a function namesendToMany that is external and payable. It takes several parameters, including destination chain, destination address, destination addresses (array),symbol and amount. It requires that the message value (attached Ether) is greater than 0, transfers tokens from the sender to the contract, approves the transfer to the gateway, and performs a native gas payment using the gasService contract. It then calls the callContractWithToken function of the gateway contract.</li><li>The contract has a public function name and returns the array of airdrop recipients.</li><li>The contract has an internal function name _executeWithToken that is called by theAxelarExecutable contract. It takes parameters including a payload (an array of addresses, which we have chosen in this tutorial, but it can store any other data types) and a token symbol.</li><li>It decodes the payload, transfers tokens to the recipients, and updates the amountReceived and airdropRecipients variables.</li></ul><h3>Set up deployment script</h3><p>Create a deploy.js file in the scripts folder and add the following code snippet:</p><pre>const hre = require(&quot;hardhat&quot;);<br><br>async function main() {<br>  const Airdrop = await hre.ethers.deployContract(&quot;Airdrop&quot;, [<br>    &quot;&quot;,<br>    &quot;&quot;,<br>  ]);<br>  await Airdrop.waitForDeployment();<br>  console.log(`Airdrop contract deployed to ${await Airdrop.getAddress()}`);<br>}<br>// We recommend this pattern to be able to use async/await everywhere<br>// and properly handle errors.<br>main().catch((error) =&gt; {<br>  console.error(error);<br>  process.exitCode = 1;<br>});</pre><p>In the code snippet above:</p><ul><li>The main function has the Airdrop contract deployed using the deployContract, a method with two strings as arguments.</li><li>The await Airdrop.waitForDeployment() statement ensures that the deployment is completed before moving forward.</li><li>The deployed contract’s address is logged into the console.</li></ul><h3>Set up remote procedure call (RPC) to testnet</h3><p>A remote procedure call (RPC) is a protocol used for communication between client and server systems in a network or blockchain environment. It enables clients to execute procedures or functions on remote servers and receive the results. RPC abstracts the underlying network details and allows clients to invoke methods on servers as if they were local.</p><p>Before you proceed to set up RPC, create a .env file using the command below:</p><pre>touch .env</pre><blockquote><em>Ensure you are in the hardhat directory before running the command above.</em></blockquote><p>Inside the .env file you just created, add the following key:</p><pre>PRIVATE_KEY= // Add your account private key here</pre><p>Getting your private account key is easy. If you use MetaMask, take a look at this <a href="https://support.metamask.io/hc/en-us/articles/360015289632-How-to-Export-an-Account-Private-Key">post</a>. Keep in mind that exporting the private key can differ for other wallet providers</p><p>Next, set up RPC for Polygon and Avalanche test networks by updating the hardhat.config.js file with the following code snippet:</p><pre>require(&quot;@nomicfoundation/hardhat-toolbox&quot;);<br>require(&quot;dotenv&quot;).config({ path: &quot;.env&quot; });<br>require(&quot;solidity-coverage&quot;);<br><br>const PRIVATE_KEY = process.env.PRIVATE_KEY;<br>// This is a sample Hardhat task. To learn how to create your own go to<br>// &lt;https://hardhat.org/guides/create-task.html&gt;<br>task(&quot;accounts&quot;, &quot;Prints the list of accounts&quot;, async (taskArgs, hre) =&gt; {<br>  const accounts = await hre.ethers.getSigners();<br>  for (const account of accounts) {<br>    console.log(account.address);<br>  }<br>});<br>// You need to export an object to set up your config<br>// Go to &lt;https://hardhat.org/config/&gt; to learn more<br>/** @type import(&#39;hardhat/config&#39;).HardhatUserConfig */<br>module.exports = {<br>  solidity: &quot;0.8.9&quot;,<br>  networks: {<br>    mumbai: {<br>      url: &quot;&lt;https://rpc.ankr.com/polygon_mumbai&gt;&quot;,<br>      chainId: 80001,<br>      accounts: [PRIVATE_KEY],<br>    },<br>    avalancheFujiTestnet: {<br>      url: &quot;&lt;https://avalanche-fuji-c-chain.publicnode.com&gt;&quot;,<br>      chainId: 43113,<br>      accounts: [PRIVATE_KEY],<br>    },<br>  },<br>};</pre><p>You have successfully configured the RPC for Polygon and Avalanche test networks. In the next step, you will deploy smart contracts to these networks.</p><h3>Deploy smart contract to Polygon and Avalanche networks</h3><p>In this section, you will deploy the smart contract to Polygon and Avalanche testnets. However, before you proceed, you need to specify the Axelar Gateway Service and the Gas Service contract in the hre.ethers.deployContract() method within the deploy.js file you created earlier.</p><p>You can find the list of Axelar Gas Service and Gateway contracts for all the chains currently supported by Axelar <a href="https://dub.sh/wzbLWsT">here</a>.</p><p>To ensure successful contract deployment, you also need a faucet for your Polygon and Avalanche testnet accounts. To get the Polygon faucet, visit this <a href="https://dub.sh/rEUXrYy">link</a>; and for the Avalanche faucet, access it <a href="https://dub.sh/Oxz9PGj">here</a>.</p><h3>Deploy to Polygon testnet</h3><p>Update the deploy.js file inside the scripts folder to deploy to Polygon testnet with the following code snippet:</p><pre>//...<br><br>async function main() {<br>  // Update arguments with the Axelar gateway and<br>  // gas service on Polygon testnet<br>  const Airdrop = await hre.ethers.deployContract(&quot;Airdrop&quot;, [<br>    &quot;0xBF62ef1486468a6bd26Dd669C06db43dEd5B849B&quot;,<br>    &quot;0xbE406F0189A0B4cf3A05C286473D23791Dd44Cc6&quot;,<br>  ]);<br>  //...<br>}<br>//..</pre><p>To deploy the contract on the Polygon testnet, run the following command:</p><pre>npx hardhat run scripts/deploy.js --network mumbai</pre><p>For example, the contract address will be displayed in your console: 0xe66f6e95E3edECe3567290751c024B19DEebAACd.</p><h3>Deploy to Avalanche Fuji testnet</h3><p>Update the deploy.js file inside the scripts folder to deploy to Avalanche testnet with the following code snippet:</p><pre>//...<br><br>async function main() {<br>  // Update arguments with the Axelar gateway and<br>  // gas service on Avalanche testnet<br>  const Airdrop = await hre.ethers.deployContract(&quot;Airdrop&quot;, [<br>    &quot;0xC249632c2D40b9001FE907806902f63038B737Ab&quot;,<br>    &quot;0xbE406F0189A0B4cf3A05C286473D23791Dd44Cc6&quot;,<br>  ]);<br>  //...<br>}<br>//..</pre><p>To deploy the contract on the Avalanche testnet, run the following command:</p><pre>npx hardhat run scripts/deploy.js --network avalancheFujiTestnet</pre><p>The contract address will be displayed on your console; for example, 0x86bE218aD2CC1Dc3270c4A594E7BA52Fd03d6a46. Save both deployed contract addresses, as you will need them for frontend integration.</p><h3>Integrating a Next.js frontend application with smart contract</h3><p>In the previous steps, you successfully built and deployed the smart contract. Now, it’s time to interact with it from the frontend, just as you would typically engage with dApps on the web.</p><p>Having already cloned the Next.js frontend project and set up the configuration for WAGMI and Rainbowkit, you can now move forward with updating the existing application and connecting your smart contract for testing, enabling interaction with it as you would with decentralized web applications.</p><h3>Implementing smart-contract write functionality</h3><p>Interacting with our contract is relatively straightforward from the frontend application, thanks to WAGMI, RainbowKit, and Ethers.</p><p>To interact between the Polygon and Avalanche testnets, you will need the Avalanche Fuji testnet RPC URL, the Polygon contract address and the Avalanche contract address. Create a .env.local file in the root directory by using the command below:</p><pre>touch .env.local</pre><blockquote><em>Ensure you are in the root directory before running the command above.</em></blockquote><p>Inside the .env.local file you just created, add the following:</p><pre>NEXT_PUBLIC_AVALANCHE_RPC_URL=https://avalanche-fuji-c-chain.publicnode.com <br>NEXT_PUBLIC_POLYGON_CONTRACT_ADDRESS=&lt;POLYGON_CONTRACT_ADDRESS&gt; <br>NEXT_PUBLIC_AVALANCHE_CONTRACT_ADDRESS=&lt;AVALANCHE_CONTRACT_ADDRESS&gt;</pre><p>Replace &lt;POLYGON_CONTRACT_ADDRESS&gt; with the contract address, you deployed to the Polygon testnet and replace &lt;AVALANCHE_CONTRACT_ADDRESS&gt; with the contract address you deployed to the Avalanche Fuji testnet earlier in this tutorial.</p><p>Next, you need to implement the write functionality for the smart contract. In this case, you must specify the airdrop amount and approve it by granting the contract permission to spend it. Only then can you input the wallet addresses to receive the airdrop and send it to them.</p><p>To enable the approval and airdrop feature, simply add this code snippet into the pages directory’s index.js file. Be sure to import all essential functions from WAGMI, including the @axelar-network/axelarjs-sdk, Polygon, Avalanche Fuji testnet contract addresses, Airdrop contract and Avalanche Fuji testnet RPC URL.</p><pre>//...<br>import {<br>  useContractWrite,<br>  useContractRead,<br>  usePrepareContractWrite,<br>  useWaitForTransaction,<br>  erc20ABI,<br>  useAccount,<br>} from &quot;wagmi&quot;;<br>import { ethers } from &quot;ethers&quot;;<br>import {<br>  AxelarQueryAPI,<br>  Environment,<br>  EvmChain,<br>  GasToken,<br>} from &quot;@axelar-network/axelarjs-sdk&quot;;<br>import AirdropContract from &quot;../hardhat/artifacts/contracts/Airdrop.sol/Airdrop.json&quot;;<br>const POLYGON_CONTRACT_ADDRESS =<br>  process.env.NEXT_PUBLIC_POLYGON_CONTRACT_ADDRESS;<br>const AVALANCHE_CONTRACT_ADDRESS =<br>  process.env.NEXT_PUBLIC_AVALANCHE_CONTRACT_ADDRESS;<br>const AVALANCHE_RPC_URL = process.env.NEXT_PUBLIC_AVALANCHE_RPC_URL;<br><br><br><br>export default function Home() {<br>//...<br>}</pre><p>Next, create the following state variables and functions to interact with the smart contract you created earlier.</p><pre>//...<br><br>export default function Home() {<br>  const [darkMode, setDarkMode] = useState(false);<br>  const [amount, setAmount] = useState(0);<br>  const [Addresses, setAddresses] = useState(&quot;&quot;);<br>  const { address } = useAccount();<br>  const [isSendButtonVisible, setIsSendButtonVisible] = useState(false);<br>  const [isApproveButtonVisible, setIsApproveButtonVisible] = useState(true);<br>  const [isTextareaVisible, setIsTextareaVisible] = useState(false);<br>  const api = new AxelarQueryAPI({ environment: Environment.TESTNET });<br>  const [gasFee, setGasFee] = useState(0);<br><br><br>const toastOptions = {<br>    position: &quot;top-right&quot;,<br>    autoClose: 8000,<br>    closeOnClick: true,<br>    pauseOnHover: false,<br>    draggable: true,<br>  };<br><br>  // Approve USDC to be spent by the contract<br>  const { data: useContractWriteUSDCData, write: approveWrite } =<br>    useContractWrite({<br>      address: &quot;0x2c852e740B62308c46DD29B982FBb650D063Bd07&quot;, // Address of the USDC contract<br>      abi: erc20ABI,<br>      functionName: &quot;approve&quot;,<br>      args: [<br>        POLYGON_CONTRACT_ADDRESS,<br>        ethers.utils.parseUnits(amount.toString(), 6),<br>      ],<br>    });<br>  const { data: useWaitForTransactionUSDCData, isSuccess: isUSDCSuccess } =<br>    useWaitForTransaction({<br>      hash: useContractWriteUSDCData?.hash,<br>    });<br>  // Check Allowance<br>  const {<br>    data: readAllowance,<br>    isError: isAllowanceError,<br>    isLoading: isAllowanceLoading,<br>  } = useContractRead({<br>    address: &quot;0x2c852e740B62308c46DD29B982FBb650D063Bd07&quot;, // Address of the USDC contract<br>    abi: erc20ABI,<br>    functionName: &quot;allowance&quot;,<br>    args: [address, POLYGON_CONTRACT_ADDRESS],<br>  });<br><br>  // Estimate Gas<br>  const gasEstimator = async () =&gt; {<br>    const gas = await api.estimateGasFee(<br>      EvmChain.POLYGON,<br>      EvmChain.AVALANCHE,<br>      GasToken.MATIC,<br>      700000,<br>      2<br>    );<br>    setGasFee(gas);<br>  };<br>  // Send Airdrop<br>  const { data: useContractWriteData, write } = useContractWrite({<br>    address: POLYGON_CONTRACT_ADDRESS,<br>    abi: AirdropContract.abi,<br>    functionName: &quot;sendToMany&quot;,<br>    args: [<br>      &quot;Avalanche&quot;,<br>      AVALANCHE_CONTRACT_ADDRESS,<br>      Addresses.split(&quot;,&quot;),<br>      &quot;aUSDC&quot;,<br>      ethers.utils.parseUnits(amount.toString(), 6),<br>    ],<br>    value: gasFee,<br>  });<br>  const { data: useWaitForTransactionData, isSuccess } = useWaitForTransaction({<br>    // Calling a hook to wait for the transaction to be mined<br>    hash: useContractWriteData?.hash,<br>  });<br>//...<br>}</pre><p>In the code above,</p><ul><li>The useState hook was utilized to create several state variables, including darkMode, amount, Addresses, isSendButtonVisible, isApproveButtonVisible, isTextareaVisible and gasFee.</li><li>The component utilizes the useAccount hook to get the address variable.</li><li>An instance of AxelarQueryAPI is created with the TESTNET environment and assigned to the api variable.</li><li>The component sets up a toastOptions object used for displaying toast notifications.</li><li>The code uses the useContractWrite hook twice, first to Approve USDC to be spent by the contract and then to sendToMany in the Airdrop contract with various arguments.</li><li>It also uses the useWaitForTransaction hook to wait for the transactions to be mined, checking for success in both cases.</li></ul><p>Next, you can create a function to handle sending the airdrop, managing the Approve functionality, and utilizing the useEffect hook.</p><pre>//...<br><br>export default function Home() {<br>//...<br>// Handle send airdrop button<br>  const handleSendAirdrop = async () =&gt; {<br>    if (!(amount &amp;&amp; Addresses)) {<br>      toast.error(&quot;Please enter amount and addresses&quot;, toastOptions);<br>      return;<br>    }<br>    if (isAllowanceError) {<br>      toast.error(&quot;Error checking allowance&quot;, toastOptions);<br>      return;<br>    }<br>    write();<br>    toast.info(&quot;Sending Airdrop...&quot;, {<br>      ...toastOptions,<br>    });<br>  };<br>  // Handle Approval<br>  const handleApprove = () =&gt; {<br>    if (!amount) {<br>      toast.error(&quot;Please enter amount&quot;, toastOptions);<br>      return;<br>    }<br>    approveWrite();<br>    toast.info(&quot;Approving...&quot;, toastOptions);<br>  };<br> useEffect(() =&gt; {<br>    //...<br>    // The gas estimator<br>    gasEstimator();<br>    isSuccess<br>      ? toast.success(&quot;Airdrop sent!&quot;, {<br>          toastOptions,<br>        })<br>      : useWaitForTransactionData?.error || useContractWriteData?.error<br>      ? toast.error(&quot;Error sending message&quot;)<br>      : null;<br>    if (isUSDCSuccess) {<br>      toast.success(&quot;USDC Approved!&quot;, { toastOptions });<br>      setIsApproveButtonVisible(false);<br>      setIsSendButtonVisible(true);<br>      setIsTextareaVisible(true);<br>    } else if (<br>      useWaitForTransactionUSDCData?.error ||<br>      useContractWriteUSDCData?.error<br>    ) {<br>      toast.error(&quot;Error approving USDC&quot;, { toastOptions });<br>    }<br>  }, [<br>    //...<br>    useContractWriteData,<br>    useWaitForTransactionData,<br>    useContractWriteUSDCData,<br>    useWaitForTransactionUSDCData,<br>  ]);<br><br><br>//...<br><br><br>  return (<br>    //...<br>  )<br>}</pre><p>Update the Approve, Send button and textarea with the following code snippet to approve and send the airdrop cross-chain.</p><pre>//...<br><br><br>export default function Home() {<br>//...<br>  return (<br>    &lt;div className=&quot;container mx-auto px-4 flex flex-col min-h-screen&quot;&gt;<br>      &lt;header className=&quot;py-4&quot;&gt;<br>         {/* ... */}<br>      &lt;/header&gt;<br>      &lt;main className=&quot;flex-grow flex flex-col items-center justify-center&quot;&gt;<br>            {/* ... */}<br>            {isTextareaVisible &amp;&amp; (<br>              &lt;div className=&quot;flex flex-col mb-4&quot;&gt;<br>                &lt;label className=&quot;font-semibold mb-2&quot;&gt;Addresses&lt;/label&gt;<br>                &lt;textarea<br>                  placeholder=&quot;Enter addresses (separate with a comma)&quot;<br>                  className=&quot;border border-gray-300 rounded-lg p-2 h-32&quot;<br>                  onChange={(e) =&gt; setAddresses(e.target.value)}<br>                /&gt;<br>              &lt;/div&gt;<br>            )}<br>            {isApproveButtonVisible &amp;&amp; (<br>              &lt;button<br>                className=&quot;bg-blue-500 hover:bg-blue-600 text-white py-2 px-6 rounded-full mr-5&quot;<br>                onClick={() =&gt; handleApprove()}<br>                display=&quot;none&quot;<br>              &gt;<br>                Approve<br>              &lt;/button&gt;<br>            )}<br>            {isSendButtonVisible &amp;&amp; (<br>              &lt;button<br>                className=&quot;bg-blue-500 hover:bg-blue-600 text-white py-2 px-6 rounded-full&quot;<br>                onClick={handleSendAirdrop}<br>              &gt;<br>                Send<br>              &lt;/button&gt;<br>            )}<br>          {/* . */}<br>      &lt;/main&gt;<br>      &lt;ToastContainer /&gt;<br>      &lt;footer className=&quot;flex justify-center items-center py-8 border-t border-gray-300&quot;&gt;<br>        {/* . */}<br>      &lt;/footer&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>You can test the send functionality to see what you have so far, but you won’t be able to retrieve it on the destination chain because the retrieval functionality hasn’t been implemented yet.</p><p>The image below illustrates this by showing a waiting for response... message. Don&#39;t worry; you&#39;ll implement the retrieval functionality in the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sS6VVoSgxprGGLP8.png" /><figcaption>Integrating a Next.js Frontend Application with Smart Contract</figcaption></figure><h3>Implementing smart-contract read functionality</h3><p>In the previous step, you learned how to write to a smart contract from the frontend, and now this section will guide you through implementing the functionality to read data from a smart contract.</p><p>Update the index.js with the following code snippet to read the airdrop details, including the recipient&#39;s addresses and amount.</p><pre>//...<br><br>export default function Home() {<br>  //...<br> const [amountReceived, setAmountReceived] = useState(0);<br> const [airdropRecipients, setAirdropRecipients] = useState([]);<br>//...<br>// Read data from Avalanche<br>  const provider = new ethers.providers.JsonRpcProvider(AVALANCHE_RPC_URL);<br>  const contract = new ethers.Contract(<br>    AVALANCHE_CONTRACT_ADDRESS,<br>    AirdropContract.abi,<br>    provider<br>  );<br>  async function readDestinationChainVariables() {<br>    try {<br>      const amountReceived = await contract.amountReceived();<br>      const airdropRecipients = await contract.getRecipients();<br>      setAmountReceived(amountReceived.toString());<br>      setAirdropRecipients(airdropRecipients);<br>    } catch (error) {<br>      console.log(error);<br>    }<br>  }<br> useEffect(() =&gt; {<br>    //...<br>  readDestinationChainVariables();<br> }, [ //...<br>]);<br>//...<br>}</pre><p>In the code above,</p><ul><li>Two state variables, amountReceived and airdropRecipients , were set up using the useState hook to store the amount and recipients.</li><li>An instance of ethers.providers.JsonRpcProvider was created to connect to the Avalanche blockchain.</li><li>Defines a contract instance using ethers.Contract with the specified Avalanche contract address and ABI for the AirdropContract.</li><li>The function readDestinationChainVariables is defined to read data from the Avalanche contract, including the amount received and the list of airdrop recipients.</li><li>Inside useEffect, the readDestinationChainVariables function is called to fetch and update the state variables when the component mounts and when other dependencies change.</li></ul><p>Next, update the UI to be rendered.</p><pre>//...<br><br>export default function Home() {<br>&lt;main className=&quot;flex-grow flex flex-col items-center justify-center&quot;&gt;<br>    {/* ... */}<br>          &lt;div className=&quot;border border-gray-300 rounded-lg p-8 m-2 &quot;&gt;<br>            &lt;h2 className=&quot;text-2xl font-bold mb-4&quot;&gt;Airdrop Status 🎉&lt;/h2&gt;<br>            {airdropRecipients.length &gt; 0 ? (<br>              &lt;&gt;<br>                &lt;div className=&quot;flex flex-col&quot;&gt;<br>                  &lt;p className=&quot;font-semibold mb-2&quot;&gt;<br>                    Total Amount:{&quot; &quot;}<br>                    &lt;span className=&quot;font-normal text-gray-500&quot;&gt;<br>                      {amountReceived / 1000000}<br>                    &lt;/span&gt;<br>                  &lt;/p&gt;<br>                  &lt;p className=&quot;font-semibold mb-2&quot;&gt;<br>                    Total Addresses:{&quot; &quot;}<br>                    &lt;span className=&quot;font-normal text-gray-500&quot;&gt;<br>                      {airdropRecipients.length}<br>                    &lt;/span&gt;<br>                  &lt;/p&gt;<br>                  {airdropRecipients.map((recipient, index) =&gt; (<br>                    &lt;div className=&quot;flex flex-col&quot; key={index}&gt;<br>                      &lt;p className=&quot;font-semibold mb-2&quot;&gt;<br>                        Address:{&quot; &quot;}<br>                        &lt;span className=&quot;font-normal text-gray-500&quot;&gt;<br>                          {recipient}<br>                        &lt;/span&gt;<br>                      &lt;/p&gt;<br>                      &lt;p className=&quot;font-semibold mb-2&quot;&gt;<br>                        Amount Received:{&quot; &quot;}<br>                        &lt;span className=&quot;font-normal text-gray-500&quot;&gt;<br>                          {amountReceived / airdropRecipients.length / 1000000}<br>                        &lt;/span&gt;<br>                      &lt;/p&gt;<br>                    &lt;/div&gt;<br>                  ))}<br>                &lt;/div&gt;<br>              &lt;/&gt;<br>            ) : (<br>            &lt;span className=&quot;text-red-500&quot;&gt;Waiting for response...&lt;/span&gt;<br>            )}<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/main&gt;<br>{/* . */}<br>}</pre><h3>Trying the application</h3><p>Hurray 🥳 , you have successfully built a cross-chain airdrop dApp with Solidity, Next.js &amp; Axelar General Message Passing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w4b7f3ziVoJBQ4h3.png" /><figcaption>Testing the cross-chain airdrop dapp</figcaption></figure><p>You can find the complete code for this project on <a href="https://github.com/Olanetsoft/cross-chain-airdrop-dapp">GitHub</a>.</p><h3>What Next?</h3><p>This post covered the utilization of Axelar GMP with callContractWithToken, but that&#39;s not all General Message Passing can do.</p><p>You can always explore other functionalities like <a href="https://docs.axelar.dev/dev/general-message-passing/gmp-tokens-with-messages">callContractWithToken</a>, <a href="https://docs.axelar.dev/dev/send-tokens/overview">SendToken</a>, <a href="https://axelar.network/blog/,https://docs.axelar.dev/dev/send-tokens/overview#get-a-deposit-address">Deposit addresses</a>, <a href="https://docs.axelar.dev/dev/general-message-passing/examples#nft-linker">NFT Linker</a>, <a href="https://docs.axelar.dev/dev/axelarjs-sdk/intro">JavaScript SDK</a>, etc.</p><p>If you’ve made it this far, you’re fantastic! You can <a href="https://twitter.com/intent/tweet?url=https%3A%2F%2Faxelar.network%2Fblog%2Fcross-chain-airdrop-dapp-tutorial%2F&amp;text=Thank%20you%2C%20@olanetsoft%2C%20for%20writing%20this%20helpful%20article.%0A%0AHow%20to%20Build%20an%20Airdrop%20dApp%20with%20@axelarcore,%20Solidity%20,and%20NextJs%20%0A%0A">post about your experience</a> building or following along with this tutorial to show your support to the author and tag <a href="https://twitter.com/axelarcore">@axelarcore</a>.</p><h3>Conclusion</h3><p>In conclusion, this tutorial demonstrated how to create a cross-chain airdrop dApp using Solidity, Next.js, and Axelar GMP. You learned how to deploy a smart contract, interact with multiple blockchains, and build a frontend application to facilitate token distribution.</p><p>As a result, you now better understand how to leverage Axelar’s powerful features to develop cross-chain dApps.</p><h3>Reference</h3><ul><li><a href="https://docs.axelar.dev/dev/general-message-passing/overview">Axelar General Message Passing</a></li><li><a href="https://docs.axelar.dev/">Axelar Documentation</a></li><li><a href="https://hardhat.org/">Hardhat</a></li><li><a href="https://www.rainbowkit.com/">RainbowKit</a></li><li><a href="https://nextjs.org/docs">Next.js</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b69c28bc9780" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Fix React Hydration Error in Nextjs — Practical Guide]]></title>
            <link>https://olanetsoft.medium.com/how-to-fix-react-hydration-error-in-nextjs-practical-guide-9a91a03e9cb8?source=rss-41c6f1ecf0f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a91a03e9cb8</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[Olubisi Idris Ayinde]]></dc:creator>
            <pubDate>Fri, 24 Feb 2023 14:24:16 GMT</pubDate>
            <atom:updated>2023-02-24T15:02:12.931Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Fix React Hydration Error in Nextjs — Practical Guide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*em5GEI-Ju7Pd3bLdqcNU3A.png" /></figure><p>Are you struggling with the React Hydration Error in Nextjs? Don’t worry; you’re not alone! Many developers face this error when rendering their React components on the server and client sides. It can be frustrating, but fear not; we’ve got you covered.</p><p>This is a standard error; you might find a solution online, but I tried most of them, but it didn’t work for me. This article will provide a simple and practical guide on fixing the React Hydration Error in Nextjs with examples of my errors and how I set them.</p><p>Whether you’re a beginner or an experienced developer, this guide will help you understand the error’s causes and provide practical solutions to fix it.</p><p>So, let’s dive in and solve this problem once and for all!</p><h3>Understanding React Hydration</h3><p>It’s essential to understand React hydration as a developer who wants to build efficient and reliable web applications using React and Nextjs.</p><h3>What is a React Hydration?</h3><p>The React hydration process involves attaching event handlers and states to the server-side markup during Server-Side Rendering (SSR). As a page loads, React reconciles the server-generated markup with the client-side markup and attaches event handlers and states.</p><p>The web application must behave correctly and interact with the end user during this process. The application might throw an error if the React Hydration process fails or behave unexpectedly if the operation fails.</p><p>Therefore, it’s crucial to understand how React Hydration works and how to fix any issues that arise during the process.</p><h3>Causes of React Hydration Error in Nextjs</h3><p>React Hydration Errors in Nextjs can be caused by inconsistencies between server and client-rendered markup and mismatched component states.</p><p>When the markup generated on the server side differs from what is generated on the client side, or when the state of a component on the server side doesn’t match the state on the client side, the application can throw errors or behave unexpectedly.</p><p>Identifying and fixing these issues can be challenging, but understanding their causes is essential to improving web application performance and reliability.</p><h3>A Practical Guide to Fix React Hydration Error in Nextjs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/0*DrTFfMU0DYNDmYBD" /><figcaption>Fix React Hydration Error in Nextjs</figcaption></figure><p>There are a couple of ways to fix the Reactjs hydration error, but I will share the standard and the hydration error I encountered while working on this decentralized identity project.</p><h3>Error 🪲</h3><p>I needed to check if the browser window had a valid ethereum object.</p><pre>{connection.status === &quot;connected&quot; ? (<br>    <br>{/* condition when its connected*/}<br>    ) : typeof window !== &quot;undefined&quot; &amp;&amp; &quot;ethereum&quot; in window ? (<br>    {/* condition when ethereum is available */}<br> <br>) : (<br>    &lt;p&gt;<br>     An injected Ethereum provider such as MetaMask<br>    &lt;/p&gt;<br>)}</pre><h3>How to Fix It 🛠️</h3><p>In the problem above, adding typeof window !== &quot;undefined&quot; caused the hydration error, which occurs if the server-rendered HTML does not match the client-rendered HTML.</p><p>Here’s an example of how you can modify the code to avoid a hydration error:</p><pre>import { useEffect, useState } from &#39;react&#39;;</pre><pre>function MyComponent() {<br>  const [isEthereumAvailable, setIsEthereumAvailable] =     useState(false);</pre><pre>  useEffect(() =&gt; {<br>    if (typeof window !== &#39;undefined&#39; &amp;&amp; &#39;ethereum&#39; in window) {<br>      setIsEthereumAvailable(true);<br>    }<br>  }, []);</pre><pre>  return (<br>    &lt;&gt;<br>    {connection.status === &quot;connected&quot; ? (</pre><pre>        {/* condition when its connected*/}<br>      ) : isEthereumAvailable ? (</pre><pre>        {/* condition when ethereum is available */}</pre><pre>      ) : (<br>       {/* condition when ethereum is not available */}<br>      )<br>    }<br>    &lt;/&gt;<br>  );<br>}</pre><h3>Error 🪲</h3><pre>{connection.status === &quot;connected&quot; &amp;&amp; record &amp;&amp; record.content &amp;&amp; (<br>    &lt;div&gt;<br>        {/* condition when ethereum is not available */}<br>    &lt;/div&gt;<br>     ) : (<br>    &lt;p&gt;No profile found.&lt;/p&gt;<br>)}</pre><p>In the code snippet above, connection and record is an object; meanwhile, the record is fetched asynchronously, leading to hydration.</p><h3>How to Fix It 🛠️</h3><pre>{connection.status === &quot;connected&quot; &amp;&amp; record &amp;&amp; record.content ? (<br>    &lt;div&gt;<br>        {/* condition when ethereum is not available */}<br>    &lt;/div&gt;<br>     ) : (<br>    &lt;p&gt;No profile found.&lt;/p&gt;<br>)}</pre><p>record.content It is fetched asynchronously and can differ between the server and client rendering; the initial server-rendered HTML may not match the client-rendered HTML. Changing the last &amp;&amp; operator to a ternary ? fixed the problem.</p><p>I hope you find this helpful post and fix any React hydration error within 3 minutes.</p><h3>Conclusion</h3><p>In conclusion, this post teaches us how a hydration error can occur in Next.js when the server-rendered HTML output doesn’t match the client-rendered HTML output. This can happen when client-side-only code, such as code that depends on the window object, is executed during server rendering.</p><p>Additionally, you can ensure that the data used to render your components is consistent between the server and client, especially when the data is asynchronously fetched.</p><p>By following these best practices, you can ensure that your Next.js application renders correctly without any hydration errors. Always test your application thoroughly to catch any issues before deploying to production.</p><h3>Reference</h3><ul><li><a href="https://nextjs.org/docs/messages/react-hydration-error">Nextjs React Hydration Error</a></li><li><a href="https://www.netlify.com/blog/fix-next-js-react-hydration-error/">Fix Next.js “Text content does not match server-rendered HTML.</a>”</li></ul><p>I’d love to connect with you on <a href="https://twitter.com/olanetsoft">Twitter</a> | <a href="https://www.linkedin.com/in/olubisi-idris-ayinde-05727b17a/">LinkedIn</a> | <a href="https://github.com/Olanetsoft">GitHub</a> | <a href="https://idrisolubisi.com/">Portfolio</a></p><p>See you in my next blog article. Take care!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a91a03e9cb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Say Goodbye to Writers Block with the New Article Idea Generator]]></title>
            <link>https://olanetsoft.medium.com/say-goodbye-to-writers-block-with-the-new-article-idea-generator-b285ff36a088?source=rss-41c6f1ecf0f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b285ff36a088</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[writing]]></category>
            <dc:creator><![CDATA[Olubisi Idris Ayinde]]></dc:creator>
            <pubDate>Mon, 13 Feb 2023 13:46:32 GMT</pubDate>
            <atom:updated>2023-02-13T13:46:32.476Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uk5xW_cBVFtCFOpQIyRkEQ.png" /><figcaption>Say Goodbye to Writers Block with the New Article Idea Generator</figcaption></figure><p>Writer’s Block can be temporary or persistent. Still, it can be overcome using different techniques, such as brainstorming, freewriting, taking breaks, changing surroundings, using the <a href="https://www.articleideagenerator.com/">relevant tools to get article topic inspiration</a>, and seeking inspiration from various sources. It’s essential to be patient with oneself and remember that writing is a creative process that requires time and perseverance to produce meaningful work.</p><p>The <a href="https://articleideagenerator.com/">Article Idea Generator</a> is an open-source tool powered by <a href="https://openai.com/">AI technology</a> designed to help writers overcome the frustration of writer’s Block.</p><p>Whether you’re a seasoned writer or just starting, this generator is the perfect solution for generating new and unique article ideas. It uses advanced algorithms to analyze your topic and suggest a wide range of opinions, from the most straightforward to the most imaginative.</p><p>This post will help you understand writer’s Block and also introduce you to the new tool called <a href="https://articleideagenerator.com/">Article Idea Generator</a>.</p><h3>Inspiration ✨</h3><p>I ran a pool late last year; find the tweet <a href="https://twitter.com/olanetsoft/status/1606650175799365632?s=20&amp;t=cWtpDx1NFiAx3Lzo3RBSzw">here</a> called the Article Streak challenge, specifically to encourage content creators to discover their strengths and consistently produce quality articles.</p><p>I often get questions like; I don&#39;t know what to write, How can I find a topic to write about, I think I can&#39;t do this because it&#39;s tough getting a topic, How can I get inspiration for what to write about</p><p>However, I came across <a href="https://twitter.com/nutlope">Hassan El Mghari’s</a> project <a href="https://www.twitterbio.com/">Twitterbio Generator</a> then I got the inspiration to help solve the writer&#39;s issue I mentioned earlier using the approach that leverage OpenAI giving birth to <a href="https://www.articleideagenerator.com/">Article Idea Generator</a>.</p><h3>Understanding Writer’s Block ✍️</h3><h3>Causes of writer’s Block ✅</h3><ol><li>Lack of inspiration or ideas — Article Idea Generator fix this</li><li>Overwhelming self-doubt or negative self-criticism</li><li>Fear of failure or not meeting expectations and perfectionism or pressure to produce perfect work</li><li>Excessive stress or burnout &amp; difficulty balancing work and personal life</li><li>Distractions or lack of focus or discipline</li><li>Burnout or fatigue from excessive writing.</li></ol><p>It is crucial to remember that every writer has a different experience with writer’s Block, and other people may have various causes.</p><h3>Effects of writer’s Block on the writing process ✅</h3><ol><li>Delay in completing writing projects and meeting deadlines</li><li>Decreased productivity, creativity, frustration and dissatisfaction with one’s writing</li><li>Increased stress and anxiety and loss of confidence in one’s writing abilities</li><li>Difficulty generating new ideas or finding inspiration</li><li>Stagnation in personal and professional growth as a writer</li><li>Financial loss, in case the writer is unable to deliver work on time</li></ol><p>It’s essential to address writer’s Block promptly, as it can cause long-term damage to a writer’s career and personal well-being.</p><h3>Common strategies to overcome writer’s Block ✅</h3><ul><li>Concentrating on frequently writing, even if that means setting modest objectives initially.</li><li>Taking breaks and caring for oneself</li><li>Altering the context or atmosphere for writing</li><li>Brainstorming or free writing to come up with new ideas</li><li>Trying out new writing prompts or activities</li><li>Working with other authors or asking for critiques from others.</li><li>Reassessing the writing project’s objectives and priorities.</li><li>Dividing the writing process into more manageable, smaller segments.</li><li>Refusing to be critical of oneself and adopting a growth mentality</li><li>Trying out various writing types or styles</li></ul><p>Finding what works best for each writer is crucial, as is persevering in attempting several methods until the Block is removed.</p><h3>Introduction to the Article Idea Generator ⭐️</h3><h3>What is the Article Idea Generator ✅</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*foYwI77zogeEhLeV" /></figure><p>The <a href="https://www.articleideagenerator.com/">Article Idea Generator’s</a> user-friendly interface makes it easy to get started, regardless of your technical expertise. Enter a few keywords related to your topic and hit Enter. The generator will then produce a list of potential article ideas you can use to inspire your writing.</p><p>The open-source nature of the Article Idea Generator ensures that it’s always up-to-date and constantly improving, so you can be confident that you’re getting the best possible results. The tool is also highly customizable, allowing you to refine your results and generate ideas that are explicitly tailored to your needs.</p><p>Whether you’re a blogger, content marketer, freelance writerIt is the perfect solution for anyone looking to improve their writing. If you&#39;re struggling with writer&#39;s Block, why not try it out today and discover the power of AI-driven inspiration? With the Article Idea Generator, you&#39;ll always have ideas!</p><h3>How the Article Idea Generator works ✅</h3><ol><li>Enter anything you may want to write about</li><li>Click Enter</li><li>Optionally you can check the “Enable SEO and Clickbait Feature.”. This feature would help tailor your idea to relevant search and make it SEO-compatible and a Clickbait approach to driving more traffic to your blog.</li><li>That’s it 🥳</li></ol><h3>Key features and benefits of the Article Idea Generator ✅</h3><p>By coming up with fresh and original ideas for articles, blog posts, and other writing assignments, the Article Idea Generator is a tool that assists writers in getting over writer’s Block.</p><p>Some key features and benefits of the Article Idea Generator include:</p><ul><li>Quick and easy idea generation: The Article Idea Generator provides a list of potential article topics, saving writers time and effort in brainstorming.</li><li>Diverse ideas: The Article Idea Generator offers a wide selection of views across various industries and hobbies by drawing from millions of datasets used to train the AI model of prospective article ideas.</li><li>Customization: Allowing users to filter their results based on particular SEO keywords or categories would help them find more ideas pertinent to their writing tasks.</li><li>Inspiration: The Article Idea Generator helps to spark inspiration and creativity by presenting ideas that writers may not have thought of on their own.</li><li>Overcoming writer’s Block: By providing a steady stream of new and unique article ideas, the Article Idea Generator helps writers overcome writer’s Block and maintain their productivity.</li><li>Time-saving: The Article Idea Generator saves writers necessary time and allows them to concentrate on the writing process by removing the need for lengthy brainstorming sessions.</li></ul><h3>Using the Article Idea Generator to Overcome Writer’s Block 🔥</h3><p>To use the Article Idea Generator to overcome writer’s Block, follow these steps:</p><ol><li>Choose a reliable and reputable <a href="https://www.articleideagenerator.com/">Article Idea Generator</a>.</li><li>Enter keywords or phrases related to your writing project.</li><li>Review the list of ideas generated by the tool and select one that interests you.</li><li>Use the concept as a springboard to develop more concepts or modify the concept to suit your writing project.</li><li>Start your article, blog post, or other writing assignments using the topic as a guide.</li></ol><p>It’s crucial to remember that numerous tools are available for overcoming writer’s Block, and the Article Idea Generator is simply one of them. Additionally, it’s critical to be flexible and open to the tool’s suggestions.</p><p>The Article Idea Generator can be used with other techniques like taking breaks, trying various writing styles, and adopting a development mindset to help authors get over writer’s Block and continue to be productive.</p><h3>How Article Idea Generator has helped writers overcome writer&#39;s Block. 💙</h3><h3>Jide ⚡️ on Twitter: &quot;How I wrote my new article in &lt; 1hr. 🟡💛Took @olanetsoft &#39;s Article Idea generator app for a spin, I used an issue I had faced earlier in the day as my proposed topic. pic.twitter.com/KDSzYHpl27 / Twitter&quot;</h3><p>How I wrote my new article in &lt; 1hr. 🟡💛Took @olanetsoft &#39;s Article Idea generator app for a spin, I used an issue I had faced earlier in the day as my proposed topic. pic.twitter.com/KDSzYHpl27</p><h3>I D R I S 💙 on Twitter: &quot;📢📢📢I am excited to announce the launch of &quot;Article Idea Generator&quot;, a new project I&#39;ve worked on for the past few days. This tool is powered by the incredible technology of @OpenAI &amp; @vercel Edge Functions, Inspired by @nutlope.1/nhttps://t.co/DeYlY0ts0Z / Twitter&quot;</h3><p>📢📢📢I am excited to announce the launch of &quot;Article Idea Generator&quot;, a new project I&#39;ve worked on for the past few days. This tool is powered by the incredible technology of @OpenAI &amp; @vercel Edge Functions, Inspired by @nutlope.1/nhttps://t.co/DeYlY0ts0Z</p><h3>MOVI🌼 on Twitter: &quot;This is so cool @olanetsoft I know so many technical writers will find this useful.#technicalwriting #contentcreation #WritingCommunity https://t.co/c5634Z9QQT / Twitter&quot;</h3><p>This is so cool @olanetsoft I know so many technical writers will find this useful.#technicalwriting #contentcreation #WritingCommunity https://t.co/c5634Z9QQT</p><h3>yarn add Austin 😎💥 on Twitter: &quot;Now this is what I call looking for a problem encountered by many and providing a solution. Nice job @olanetsoft . Looking forward to contributing 😊✌️ https://t.co/Pe7sIsWNma / Twitter&quot;</h3><p>Now this is what I call looking for a problem encountered by many and providing a solution. Nice job @olanetsoft . Looking forward to contributing 😊✌️ https://t.co/Pe7sIsWNma</p><p>I wish I could share all the feedback, but check this <a href="https://twitter.com/olanetsoft/status/1619355130041864193?s=20&amp;t=cWtpDx1NFiAx3Lzo3RBSzw">tweet</a> reply and quote retweet to see how this tool is changing lives, helping people to be more creative, and overcoming writer’s Block easily.</p><h3>The Tech Stack 🛠️</h3><p><a href="https://nextjs.org/">NextJS</a> — React application framework</p><p><a href="https://tailwindcss.com/docs/guides/nextjs">TailwindCSS</a> — For styling the project</p><p><a href="https://www.typescriptlang.org/">TypeScript</a> — A strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.</p><p><a href="https://vercel.com/docs/concepts/functions/edge-functions/streaming">Vercel Function</a> — For streaming responses from OPEN AI</p><p><a href="https://github.com/">GitHub</a> — To host the <a href="https://github.com/Olanetsoft/article-idea-generator">code</a></p><p><a href="https://vercel.com/">Vercel</a> — To deploy and host the project</p><h3>Contributing 🤝</h3><p>Please read the <a href="https://github.com/Olanetsoft/article-idea-generator/blob/develop/CONTRIBUTING.md">contributing guide</a> if you want to contribute to this project. If you have any ideas or suggestions, feel free to open an issue or a pull request.</p><blockquote>If you like <a href="https://github.com/Olanetsoft/article-idea-generator/">this project</a>, please give it a star ⭐️</blockquote><p><a href="https://github.com/Olanetsoft/article-idea-generator">GitHub — Olanetsoft/article-idea-generator: Generate your next article idea with ease. Powered by OpenAI.</a></p><h3>Conclusion</h3><p>This post teaches us about writer’s Block, its causes, and shared strategies to overcome it. It also introduces you to the <a href="https://www.articleideagenerator.com/">Article Idea Generator tool,</a> how it works, overcoming writer’s Block using it, and feedback on how it has helped writers.</p><h3>Reference</h3><ul><li><a href="https://www.articleideagenerator.com/">Article Idea Generator</a></li><li><a href="https://www.twitterbio.com/">Twitterbio Generator</a></li><li><a href="https://openai.com/">OpenAI</a></li><li><a href="http://vercel.com/">Vercel</a></li></ul><p>I’d love to connect with you on <a href="https://twitter.com/olanetsoft">Twitter</a> | <a href="https://www.linkedin.com/in/olubisi-idris-ayinde-05727b17a/">LinkedIn</a> | <a href="https://github.com/Olanetsoft">GitHub</a> | <a href="https://idrisolubisi.com/">Portfolio</a></p><p>See you in my next blog article. Take care!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b285ff36a088" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easily Create An NFT App Using The New Infura NFT SDK TypeScript]]></title>
            <link>https://olanetsoft.medium.com/easily-create-an-nft-app-using-the-new-infura-nft-sdk-typescript-479269500f5f?source=rss-41c6f1ecf0f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/479269500f5f</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web3]]></category>
            <dc:creator><![CDATA[Olubisi Idris Ayinde]]></dc:creator>
            <pubDate>Fri, 20 Jan 2023 14:18:28 GMT</pubDate>
            <atom:updated>2023-01-20T14:18:28.717Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8WNx6PpsSQGJVCXHn6S5w.png" /><figcaption>Easily Create An NFT App Using The New Infura NFT SDK TypeScript</figcaption></figure><p>If you know typescript, it’s easy to add the ability to create, mint, and manage non-fungible tokens (NFTs) to your app. The <a href="https://docs.infura.io/infura/infura-custom-apis/nft-sdk">Infura NFT SDK</a> wraps REST calls to Ethereum nodes, abstracting away the technical compilations and making it possible to work with NFTs with just an Infura account, some configuration, and a few lines of code. The Infura NFT SDK also doesn’t require the overhead of learning Solidity, importing ABIs, etc. Whether new to web3 or highly experienced, Infura NFT SDK makes NFTs easy.</p><p>Let’s jump in, build, and deploy an ERC721 NFT to see how it works.</p><h3>What is the Infura NFT SDK?</h3><p>The <a href="https://docs.infura.io/infura/infura-custom-apis/nft-sdk">Infura NFT SDK</a> is an SDK that allows you to build and interact with NFTs easily. It’s implemented in TypeScript, a programming language that is a strict superset of JavaScript. The SDK includes creating, minting, and managing NFTs and query information about them.</p><p>The significant part is that it abstracts away the technical details so you can focus on the core functionality of your dApp instead of the (often difficult) details. It’s all about ease of use with Infura SDKs!</p><p>Supported chains include:</p><p><strong>Write</strong></p><ul><li>Ethereum: Mainnet, Goerli, Sepolia</li><li>Polygon: Mainnet, Mumbai</li></ul><p><strong>Read</strong></p><ul><li>Ethereum: Mainnet, Goerli, Sepolia</li><li>Polygon: Mainnet, Mumbai</li><li>BSC: Mainnet</li></ul><p>By using the Infura NFT SDK, you also get access to Infura’s core functionality and infrastructure, which provides access to Ethereum (and other blockchains) without requiring you to run a full node. With the SDK, you can leverage many capabilities, making it easier to build and scale your dApps.</p><p>So let’s build an NFT and see what the SDK can do.</p><h3>Building and Deploying ERC721 NFT</h3><p>We will build a dApp and smart contract on Ethereum and use the SDK to create a new NFT. We’ll do all this on the Ethereum Goerli testnet, so we don’t have to worry about defects or the cost of deploying to the mainnet.</p><h4>Prerequisite</h4><p>Before getting started, you need the following prerequisites:</p><ul><li><a href="https://nodejs.org/en/">Node.js</a> and its package manager NPM. Verify you have Node.js installed by using the following terminal command: node -v &amp;&amp; npm -v</li><li><a href="https://www.npmjs.com/package/typescript">TypeScript</a> installed</li><li><a href="https://docs.infura.io/infura/getting-started">An Infura account</a></li><li>A basic understanding of TypeScript and JavaScript</li><li><a href="https://consensys.net/docs/consensys-nft/en/latest/tutorials/tuto_1/tuto_1_4/">MetaMask</a></li></ul><h3>Infura</h3><p>The Infura NFT SDK is really simple to use. In fact, most of this tutorial is just the setup and configuration needed to create a dApp. Let’s start by <a href="https://infura.io/login">logging in</a> to your Infura account. You should be on your dashboard, where you can create a new key, as shown below. We’ll create a new key for this project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RF_Q5R_EP-IhKhfo" /></figure><p>Click the “Create a New Key” button and fill in the required information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0fJ2dEy43_V-dadQ" /></figure><p>After creating your key, your project ID will be visible on your dashboard under the API KEY section, as shown below. Copy and keep it somewhere; you’ll need it later in this tutorial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RrzlmtVywrgZrp5I" /></figure><h3>Set up IPFS project on Infura Dashboard</h3><p>Now, let’s create an IPFS project. <a href="https://ipfs.tech/">IPFS</a> is a P2P distributed file system for storing and accessing files (and other data). It works well with blockchain. We’ll need IPFS (and these credentials) to upload and store the metadata of our NFT project.</p><p>Head to your dashboard and create another new key by clicking “Create a Key”, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FHhv7Onl33GEUBGS" /></figure><p>This time we’ll choose IPFS as the network. This project will work on the mainnet and (what we will use it for) testnet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*no8upyzZ1wRcllKB" /></figure><p>After creating your key, you’ll see your project ID and API key secret under the API KEY section of your dashboard. You’ll need this later as well, so copy it and keep it somewhere safe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7-NOr9npezY_PQXR" /></figure><h3>Project Setup and Installation</h3><p>Next, we’ll set up and initialize a node.js Typescript project. Use the following commands in your console:</p><pre>mkdir typescript-nft-demo &amp;&amp; cd typescript-nft-demo</pre><pre>npm init -y</pre><pre>npm install -D typescript ts-node</pre><pre>npx tsc --init</pre><p>Open the project in your preferred development environment. For example, if you are using Visual Studio Code, use the following command to open the project automatically:</p><pre>code .</pre><h3>Install the Project Libraries</h3><p>Next, we need to install the Infura SDK and dotenv library for reading the environment variables.</p><p>Use the following command:</p><pre>npm install @infura/sdk dotenv</pre><p>Your project should have something similar to what is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/0*q9-hNHPDn1_L3KEm" /></figure><p>Create a .env file at your project&#39;s root and add the following variables to it:</p><pre>INFURA_PROJECT_ID=&lt;YOUR-INFURA-PROJECT-ID&gt;<br>INFURA_PROJECT_SECRET=&lt;YOUR-INFURA-PROJECT-API-KEY&gt;<br><br>WALLET_PRIVATE_KEY=&lt;YOUR-WALLET-MNEMONIC/PRIVATE-KEY&gt;<br>EVM_RPC_URL=https://goerli.infura.io/v3/&lt;YOUR-PROJECT-API-KEY&gt;<br><br>INFURA_IPFS_PROJECT_ID=&lt;YOUR-INFURA-IPFS-PROJECT-ID&gt;<br>INFURA_IPFS_PROJECT_SECRET=&lt;YOUR-INFURA-IPFS-PROJECT-SECRET-KEY&gt;<br><br>WALLET_PUBLIC_ADDRESS=&lt;YOUR-WALLET-ADDRESS&gt;</pre><ul><li>Replace &lt;YOUR-INFURA-PROJECT-ID&gt; and &lt;YOUR-INFURA-PROJECT-API-KEY&gt; with the ID and API key from the Infura project created earlier in this tutorial.</li><li>Replace &lt;YOUR-INFURA-IPFS-PROJECT-ID&gt; and &lt;YOUR-INFURA-IPFS-PROJECT-SECRET-KEY&gt; with the ID and API key from the <em>IPFS</em> project created earlier in this tutorial.</li><li>On the line starting with EVM_RPC_URL, replace &lt;YOUR-PROJECT-API-KEY&gt; with your Infura API key.</li><li>&lt;YOUR-WALLET-ADDRESS&gt; should be replaced with your public blockchain address.</li><li>&lt;YOUR-WALLET-MNEMONIC/PRIVATE-KEY&gt; is your wallet&#39;s private key. <em>Note: Never share your private keys</em> <em>(mnemonic)</em> <em>with anyone, and keep them secure.</em></li></ul><p>You can find your wallet address and private key to your wallet on MetaMask in the following steps:</p><ul><li>Open MetaMask by clicking on the browser extension icon or visiting the MetaMask website.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/0*On3NbuI0zGOmm0vr" /></figure><ul><li>Click on the three dots in the top right corner of the MetaMask window.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/0*u08Bwq6eSD8BMYOX" /></figure><ul><li>Select “Account Details” from the drop-down menu, and click on the “Export Private Key” button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/0*oU92DIJyQd1XRMym" /></figure><ul><li>A pop-up window will appear, asking you to enter your password. Enter your password and click on the “Unlock” button.</li><li>Once your account is unlocked, you can see your private key.</li></ul><p>Remember: keep your private key safe and <em>never </em>share your private key with anyone else. Also, be sure you’re connected to the Goerli testnet, not the mainnet, as shown in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/0*tjNI_U763L9WLlLM" /></figure><p>Now that we’ve successfully configured our project, create a new TypeScript file nft.ts at the root level.</p><p>Your project structure should look similar to the one below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/0*ms3hIS9qVBHUGJuY" /></figure><h3>Setup Infura Authentication</h3><p>Authentication from inside our dApp requires our PROJECT_ID and PROJECT_SECRET. We’ll load these from our new .env file.</p><p>Create an auth object inside the nft.ts using the following code snippet:</p><pre>import { config as loadEnv } from &quot;dotenv&quot;;<br>import { SDK, Auth, Metadata, TEMPLATES } from &quot;@infura/sdk&quot;;<br><br>// load environment variables from .env file<br>loadEnv();<br>// Create an instance of the Auth class <br>const auth = new Auth({<br>  // set the projectId taken from the INFURA_PROJECT_ID environment variable <br>  projectId: process.env.INFURA_PROJECT_ID,<br>  // set the secretId taken from the INFURA_PROJECT_SECRET environment variable <br>  secretId: process.env.INFURA_PROJECT_SECRET,<br>  // set the private key taken from the WALLET_PRIVATE_KEY environment variable <br>  privateKey: process.env.WALLET_PRIVATE_KEY,<br>  // set the rpcUrl taken from the EVM_RPC_URL environment variable <br>  rpcUrl: process.env.EVM_RPC_URL,<br>  // set the chainId for the Goerli testnet<br>  chainId: 5, // Goerli<br>  // set the options for IPFS<br>  ipfs: {<br>    // set the project Id taken from the INFURA_IPFS_PROJECT_ID environment variable<br>    projectId: process.env.INFURA_IPFS_PROJECT_ID,<br>    // set the API key secret taken from the INFURA_IPFS_PROJECT_SECRET environment variable<br>    apiKeySecret: process.env.INFURA_IPFS_PROJECT_SECRET,<br>  },<br>});<br>// Instantiate the SDK<br>const sdk = new SDK(auth);</pre><p>Configure the tsconfig.json file as shown. (You might get an error but keep going.) tsconfig.json is a configuration file for TypeScript projects. It’s used to specify the compiler options and files that should be included in the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/0*7uDRcx6CSRirtB1p" /></figure><p>Configure your tsconfig.json with the following code snippet:</p><pre>{<br>        &quot;compilerOptions&quot;: {<br>          &quot;target&quot;: &quot;ESNext&quot;, /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */<br>          &quot;module&quot;: &quot;ES2022&quot;, /* Specify what module code is generated. */<br>          // &quot;rootDir&quot;: &quot;./&quot;,                                  /* Specify the root folder within your source files. */<br>          &quot;moduleResolution&quot;: &quot;node&quot;, /* Specify how TypeScript looks up a file from a given module specifier. */<br>          &quot;esModuleInterop&quot;: true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables &#39;allowSyntheticDefaultImports&#39; for type compatibility. */<br>          &quot;forceConsistentCasingInFileNames&quot;: true, /* Ensure that casing is correct in imports. */<br>          /* Type Checking */<br>          &quot;strict&quot;: true, /* Enable all strict type-checking options. */<br>          &quot;skipLibCheck&quot;: true /* Skip type checking all .d.ts files. */<br>      }<br>}</pre><p>Next, add the type module to the package.json file using the following code snippet:</p><pre>//...<br>&quot;type&quot;: &quot;module&quot;,<br>&quot;scripts&quot;: {},<br>//...</pre><h3>Create Token Metadata</h3><p>Now we’re done configuring. Let’s get to the exciting stuff!</p><p>First, we’ll create the token metadata.</p><p>Token metadata refers to additional information or data associated with a token (typically an ERC-721 or ERC-1155 token on the Ethereum blockchain). This metadata can include information such as the token’s name, symbol, image, and other attributes that describe the token or give it context.</p><p>The metadata is stored on the blockchain and is typically represented as a URI or a URL that points to a JSON file containing the metadata.</p><p>Inside the nft.ts file, add the following code snippet. It will create and store the token metadata. The metadata class is from the Infura NFT SDK.</p><p>(Note: The <a href="http://consensys.net/">consensys.net</a> external_url is just for demo purposes here and can be replaced.)</p><pre>//...<br><br><br>// Define the properties of the token, including its description, external URL, image, name, and attributes<br>const tokenMetadata = Metadata.openSeaTokenLevelStandard({<br><br>  description: &quot;Fantastic creature of different emojis&quot;,<br>  external_url: &quot;https://consensys.net/&quot;,<br>  image: await sdk.storeFile({<br>    // Store the image from the given URL<br>    metadata: &quot;https://res.cloudinary.com/olanetsoft/image/upload/c_pad,b_auto:predominant,fl_preserve_transparency/v1672327921/demo.jpg&quot;,<br>  }),<br>  name: &quot;Kandy Jane&quot;,<br>  attributes: [],<br>});<br>// Log the token metadata object to the console<br>console.log(&quot;Token Metadata: &quot;, tokenMetadata);<br><br>// Store the token metadata and log the result<br>const storeTokenMetadata = await sdk.storeMetadata({ metadata: tokenMetadata });<br>console.log(&quot;Store Token Metadata: &quot;, storeTokenMetadata);</pre><h3>Create the Contract Metadata</h3><p>Contract metadata refers to additional information or data associated with a smart contract on a blockchain network. This metadata can include information such as the contract’s name, symbol, version, and other attributes that describe the contract or give it context.</p><p>The metadata is stored on the blockchain and is typically represented as a URI or a URL that points to a JSON file containing the metadata.</p><p>Create contract metadata using the following code snippet:</p><pre>//...<br><br>// Define the properties of the collection, including its description, external URL, image, name, and attributes<br>const collectionMetadata = Metadata.openSeaCollectionLevelStandard({<br>  name: &quot;Emojis collection&quot;, // Sets the name of the collection to &quot;Emojis collection&quot;<br>  description:<br>    &quot;A small digital image or icon used to express an idea or emotion in electronic communication. Emoji&#39;s come in many forms, such as smiley faces, animals, food, and activities. &quot;, // Sets the description of the collection<br>  image: await sdk.storeFile({<br>    // Sets the image property of the collection using the storeFile method<br>    metadata:<br>&quot;https://res.cloudinary.com/olanetsoft/image/upload/c_pad,b_auto:predominant,fl_preserve_transparency/v1672327921/demo.jpg&quot;, // The URL of the image file<br>  }),<br>  external_link: &quot;https://google.com/&quot;, // Sets the external link property of the collection<br>});<br><br>// Logs the collection metadata to the console<br>console.log(&quot;Collection Metadata:- &quot;, collectionMetadata); <br><br>// stores the metadata using the storeMetadata method<br>const storeMetadata = await sdk.storeMetadata({ metadata: collectionMetadata }); <br><br>// Logs the store metadata to the console<br>console.log(&quot;Store Metadata: &quot;, storeMetadata);</pre><p>This code snippet above creates an object collectionMetadata using the openSeaCollectionLevelStandard method from the Metadata class. The openSeaCollectionLevelStandard method creates standard collection-level metadata compatible with <a href="https://opensea.io/">OpenSea</a>, a leading marketplace for NFTs. It sets the collection&#39;s name, description, image, and external link properties; stores the metadata using the storeMetadata method; then logs it and stores it in the console for debugging.</p><h3>Create a New Contract and Mint an NFT</h3><p>Add the following code to create a new contract and mint an NFT using the Infura NFT SDK. Most of this functionality comes to us from our new NFT SDK!</p><pre>//...<br><br>// Create a new contract<br>const newContract = await sdk.deploy({   // deploys a new contract using the sdk.deploy method<br>  template: TEMPLATES.ERC721Mintable,     // sets the template for the contract to ERC721Mintable<br>  params: {<br>    name: &quot;1507Contract&quot;,                  // sets the name of the contract as &quot;1507Contract&quot;<br>    symbol: &quot;EMOJI&quot;,                        // sets the symbol of the contract as &quot;EMOJI&quot;<br>    contractURI: storeMetadata,             // sets the contract URI with the storeMetadata<br>  },<br>});<br><br>console.log(&quot;Contract Address: \n&quot;, newContract.contractAddress);  // logs the contract address to the console<br><br>// mint an NFT<br>const mint = await newContract.mint({  // mints a new NFT using the mint method from the new contract<br>  publicAddress:<br>    process.env.WALLET_PUBLIC_ADDRESS ??<br>    &quot;0x510e5EA32386B7C48C4DEEAC80e86859b5e2416C&quot;, // sets the public address of the wallet, if not set it will use the given address<br>  tokenURI: storeTokenMetadata,                // sets the token URI with the storeTokenMetadata<br>});<br><br>const minted = await mint.wait();            // waits for the minting process to complete<br><br>console.log(&quot;Minted: &quot;, minted);               // logs the minted NFT to the console</pre><p>This code creates a new contract using the sdk.deploy method and sets the template for the contract to ERC721Mintable. Then it sets the contract&#39;s name, symbol, and contract URI. The contract address is logged for debugging.</p><p>It then mints a new NFT using the mint method from the new contract and sets the wallet&#39;s public address. If not specified, it uses the given address and then sets the token URI with the storeTokenMetadata.</p><p>Finally, it waits for the minting process to complete and logs the minted NFT to the console.</p><p>Let’s test it out</p><pre>ts-node-esm nft.ts</pre><p>You should see something similar to what is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WsLlMfD3If2EZIsK" /></figure><h3>Verify Contract on Account and Goerli Etherscan</h3><p>Finally, let’s verify the contract using a blockchain explorer on the <a href="https://goerli.etherscan.io/">Goerli Etherscan</a>. Go to the <a href="https://goerli.etherscan.io/">Goerli Ethereum testnet site</a> and paste the transaction hash from your output above (as shown below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qFWVsakKJuzDszhE" /></figure><p>You should see the details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9alaEeI8Q6KJ7Suh" /></figure><p>That was easy! We successfully utilized the Infura NFT SDK to build, deploy, and mint an NFT on the Goerli testnet.</p><h3>Import token on MetaMask</h3><p>Let’s look at our new NFT from a front-end perspective using MetaMask. First, we have to import our wallet to MetaMask. Click “Import Tokens”, as shown in MetaMask. (Be sure you are connected to the Goerli Testnet as shown.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/0*6ePjOUwWY6HPUycl" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/0*_7-lBjV_liIzvSIb" /></figure><p>Copy and paste the contract address to import your token on MetaMask, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/0*kTPsjidLW8o3cIp7" /></figure><p>And there it is! An easy and fast way to add NFTs to your dApps. You can use the SDK now to manage the NFTs and more (<a href="https://docs.infura.io/infura/infura-custom-apis/nft-sdk">see the docs for current capabilities</a>).</p><h3>Verify Minted NFT on OpenSea</h3><p>We’ve successfully imported the minted NFT on MetaMask, but now let’s verify on <a href="https://testnets.opensea.io/">OpenSea tesnet</a>. Connect your wallet and view your new NFT. You should have something similar to what is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TllHtYLwKp3tRU_0" /></figure><p>For reference, <a href="https://testnets.opensea.io/assets/goerli/0x7d29d142ca8e60139d14fe2ebf1e353e579ed8f6/0">here’s the OpenSea link</a> to the NFT created. You can find the complete code on a GitHub repository <a href="https://github.com/Olanetsoft/nft-demo-with-typescript">here</a>.</p><h3>Conclusion</h3><p>In conclusion, the new Infura NFT SDK for TypeScript is a powerful tool for developers looking to incorporate NFTs into their dApps. With its easy-to-use functions and comprehensive features, this SDK makes it simple to deploy, mint, and manage NFTs on the Ethereum blockchain. <a href="https://www.npmjs.com/package/@infura/sdk">Sign up and start building</a>!</p><p>I’d love to connect with you on <a href="https://twitter.com/olanetsoft">Twitter</a> | <a href="https://www.linkedin.com/in/olubisi-idris-ayinde-05727b17a/">LinkedIn</a> | <a href="https://github.com/Olanetsoft">GitHub</a> | <a href="https://idrisolubisi.com/">Portfolio</a></p><p>See you in my next blog article. Take care!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=479269500f5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cost-Efficient Ways To Roll Out Your MVPs and Prototypes]]></title>
            <link>https://medium.com/techtrument/cost-efficient-ways-to-roll-out-your-mvps-and-prototypes-d2c426b38f1c?source=rss-41c6f1ecf0f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2c426b38f1c</guid>
            <category><![CDATA[mvp]]></category>
            <category><![CDATA[prototyping]]></category>
            <category><![CDATA[appwrite]]></category>
            <dc:creator><![CDATA[Olubisi Idris Ayinde]]></dc:creator>
            <pubDate>Fri, 23 Dec 2022 23:14:41 GMT</pubDate>
            <atom:updated>2022-12-23T23:14:41.470Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qEg7u_FmcKvdyNutAzIsw.jpeg" /><figcaption>Cost-Efficient Ways To Roll Out Your MVPs and Prototypes</figcaption></figure><p>“Minimum Viable Product” (MVP) refers to a prototype that helps you test your idea prior to investing your resources. Creating an MVP is a typical strategy helpful in project or startup planning in the modern IT sector. An MVP must be completed before a product launch if you intend to create your product.</p><p>In this post, you’ll discover everything there is to know about MVPs, including what they are, why they’re essential, and how to roll them out and affordably prototype them.</p><h3>What is an MVP?</h3><p>An MVP is a simple version of the product that focuses on the essential demands and features of the end users. Software engineers can streamline the development process using MVP. However, the product is evaluated in the marketplace to determine its viability.</p><p>One of the significant elements of MVP development is ensuring the product’s viability. A product’s functionality is far more crucial than its design. <a href="https://www.linkedin.com/pulse/why-45-all-software-features-production-never-used-david-rice/">On average, just 40% of a product’s capabilities are utilized;</a> therefore, reaching the 100% complete goal can often be seen as a waste of developmental resources. A viable product fulfills one primary function to satisfy user needs.</p><h3>Why MVP?</h3><p>The goal of creating an MVP is to swiftly and inexpensively launch a product based on a proven concept.</p><p>Businesses can get user feedback for the core product using MVP development solutions and incorporate it into subsequent revisions. Finding the correct audience, pulling ideas based on experience, and saving time are all possible with an MVP.</p><p><strong>Here are some essential factors to consider while creating a great MVP and why MVPs are crucial:</strong></p><p><strong>Verifying Market Demand</strong></p><p>Testing is the key to developing a Minimum Viable Product — finding out what works and doesn’t. In some ways, an MVP is less about selling or attracting clients and more about understanding market demand.</p><p>You can determine if potential customers need and use your product without making a significant financial commitment. Then, based on your research, you may either redesign your product to differentiate it from competitors’ offerings further or come up with an entirely new idea.</p><p><strong>Market Growth</strong></p><p>It is simple to comprehend that a project, application, or product won’t succeed if there is no market. Additionally, future growth is expected to be very strong for eCommerce, Education, Gaming, Medical, and AI applications.</p><p>Therefore, developing an idea and creating an MVP for these applications is preferable.</p><p><strong>Validating Business Concepts</strong></p><p>You can ascertain that your product concept is appealing to your target market by providing the essential features rather than a fully loaded, feature-heavy product. This allows you to modify a product’s design based on your discoveries.</p><p><strong>Long-term Financial Success</strong></p><p>According to research, <a href="https://www.cbinsights.com/research/startup-failure-post-mortem/">29% of businesses fail</a> because they run out of money. This is one of the advantages an MVP provides. By releasing a simplified version of the software, you can learn more about its functionality and save money that you might have yet to be able to.</p><h3>Cost-Efficient Ways To Roll Out Your MVPs and Prototypes</h3><p>An MVP strategy prevents the product from becoming overly complex and necessitating more complex code and solutions. You can start investing more wisely as you attract more users and acquire more data to guide the course of the product from the MVP.</p><p>Developing a Minimum Viable Product is only one aspect of MVP software development. You must first cross off a few tasks from your list to build an MVP efficiently.</p><p>The essential phases needed to build an MVP efficiently considering cost are as follows:</p><ol><li>Early Phase of Discovery</li><li>Product Design and Prototype</li><li>Release Plan</li><li>Building the Product (MVP)</li><li>Reiterate Based on Beta user’s Feedback</li></ol><h3>Benefits of Using the Appwrite APIs to Build an MVP</h3><p>With the help of the self-hosted backend-as-a-service platform <a href="https://appwrite.io/?utm_source=hackmamba&amp;utm_medium=hackmamba-blog">Appwrite</a>, developers can create an MVP for any application — it offers all the essential APIs.</p><p>The following essential APIs are provided by Appwrite and can be used to develop your MVP:</p><ul><li>Account service API that enables user account management and authentication. The account service allows you to modify user data, access user sessions across various devices, and retrieve user security records with their most current activity.</li><li>The databases service enables you to manage a sophisticated set of read and write access permissions, create structured collections of documents, query and filter lists of documents, and more.</li><li>Teams service API allows you to group users of your project and enable them to share <a href="https://appwrite.io/docs/permissions?utm_source=hackmamba&amp;utm_medium=hackmamba-blog">read and write</a> access to your project resources, such as database documents or storage files.</li><li>You may manage the users of your project using the Users service. Use this service to search, block, and examine information about your users, their active sessions, and recent activity logs.</li><li>You can manage your project files using the Storage service. Using the Storage service, you can upload, browse, download, and query every project file.</li><li>The Locale service enables you to modify your app according to the location of your users.</li><li>A functions service that enables you to design unique behavior that can be activated in response to any supported Appwrite system event or by a predetermined schedule.</li><li>The Health service is made to enable you to, among other things, verify and keep track of the uptime and responsiveness of your Appwrite server instance and all of its internal components.</li></ul><h3>Leveraging JAMStack Solution to Build a Cost-Effective MVP with Appwrite</h3><p>Before leveraging JAMStack solutions to build a cost-effective MVP with Appwrite, let’s highlight some top tech-related challenges in building an MVP and how you can easily plug in an Appwrite solution to fix it cost-effectively.</p><ol><li>Perfectionism:</li></ol><ul><li>Perfectionism is a noble trait, but obsessing about it can cost you a lot of time, money, and effort before the MVP has even been tested in the real world. You will waste your most valuable time and possibilities if you try to put more emphasis on perfecting your MVP than releasing it into the market with the essential characteristics of your ultimate product.</li><li>Appwrite makes it easier to iterate through the process of building and testing your application utilizing the provided APIs, making the process seamless even after it’s been released.</li></ul><p>2. Inappropriate Tech Stack:</p><ul><li>Building an MVP is sometimes tricky since the wrong tech stack prevents you from employing the proper tool for the job. This struggle will almost guarantee delivery delays and ultimately impacts the product’s long-term scaling.</li><li><a href="https://appwrite.io/docs?utm_source=hackmamba&amp;utm_medium=blog&amp;utm_campaign=hackmamba">Getting started with Appwrite utilizing their documentation</a> shows different stacks that can be utilized to communicate with their APIs seamlessly. As a developer, you can understand how Appwrite plugs in, which helps define the appropriate technology to build an MVP.</li></ul><p>3. Inadequate Skill set:</p><ul><li>Even while a staff with insufficient expertise may be acceptable when you have a limited budget, you will ultimately end up with a poor product. This is one of the biggest challenges businesses, and startups face today.</li><li>Even if your team is very motivated, designing and developing your MVP and the final product will require a highly skilled team. Do you know what’s fascinating about it? <a href="https://appwrite.io/docs?utm_source=hackmamba&amp;utm_medium=blog&amp;utm_campaign=hackmamba">Appwrite offers some of the best and most thorough documentation</a> to get developers up to speed and ship MVPs quickly.</li></ul><p>4. Too Many features:</p><ul><li>Adding many features to your app is an ambitious goal for many software developers, but would likely require more money, time, effort, and possibly user data that you don’t even have yet. The most crucial components and features of your product are included in an MVP to assess how well the product will hold up when put to the test in the market.</li><li>An MVP involves an iterative approach. Your MVP, which you were launching in preparation for your finished product, will likewise be delayed if you delay. And to top it all off, you may have used your patience and resources.</li><li>Prioritizing the crucial elements to include in your MVP is significantly wiser than tolerating such turmoil. For an MVP, feature prioritization helps to focus on the functionality rather than over-pack your MVP.</li></ul><p><a href="https://appwrite.io/?utm_source=hackmamba&amp;utm_medium=hackmamba-blog">Sign up</a> to get started using the Appwrite platform.</p><h3>Conclusion</h3><p>You can start small with a Minimum Viable Product and grow it over time to create a better, more polished product. By doing this, you can use user intelligence to inform your product decisions.</p><p>This article describes what MVPs are, why they’re important, how to roll them out, and how to prototype them inexpensively.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2c426b38f1c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtrument/cost-efficient-ways-to-roll-out-your-mvps-and-prototypes-d2c426b38f1c">Cost-Efficient Ways To Roll Out Your MVPs and Prototypes</a> was originally published in <a href="https://medium.com/techtrument">Hackmamba</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Super Useful Metrics to Track Your Server Expenses]]></title>
            <link>https://medium.com/techtrument/super-useful-metrics-to-track-your-server-expenses-39c92f7e8881?source=rss-41c6f1ecf0f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/39c92f7e8881</guid>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web]]></category>
            <dc:creator><![CDATA[Olubisi Idris Ayinde]]></dc:creator>
            <pubDate>Wed, 02 Nov 2022 08:26:45 GMT</pubDate>
            <atom:updated>2022-11-02T08:26:45.220Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X0a7cnM_0y6MrHQHqQdFGQ.jpeg" /></figure><p>Metrics for websites include the information you may use to track how well your website is performing.</p><p>However, it’s important to note that performance is not just about speed. Metrics may aid in understanding and enhancing everything from lead conversion to traffic volume.</p><p>Understanding the server’s function becomes increasingly important as an application’s user base grows in a production setting. It’s a best practice to collect performance measurements for the servers hosting your web applications to assess your applications’ health.</p><p>In this article, you’ll learn about some super valuable metrics for tracking your server expenses.</p><h3>Server availability and uptime</h3><p>When serving your app, your servers must be up and operating; thus, alerting in advance to availability can help you save the day before problems arise.</p><p>The duration of the server’s uptime, which hosts your application, is measured. Customers may have a negative experience due to unreliable server system uptime metrics.</p><p>There may be instances where the service operating on your servers hosting an app is unavailable, even if the servers themselves are up and functioning.</p><p>Ideally, single points of failure should be eliminated to provide high availability.</p><p>However, uptime above 99% is acceptable, but it also means that it will cost more server expenses during the active or peak period.</p><h3>Application server monitoring</h3><p>Standard server monitoring metrics can offer vital clues about how effectively your application performs.</p><p>The average response time shows how long a server typically needs to handle an application’s request. <a href="https://www.nngroup.com/articles/response-times-3-important-limits/">According to studies</a>, response times should be kept to under one second to ensure user involvement. The longest response time in a given period is known as the peak response time. The value should be interpreted in light of the typical response time.</p><p>A slow average response time can signal that the server’s components aren’t performing at their best and must be fixed.</p><p>For a particular kind of request, if the gap between the two is noticeably more significant, then it might point to a performance bottleneck. However, it might also be a temporary problem.</p><p>On the other hand, consistently higher values for one or both of these metrics may point to underlying server performance issues, resulting in closer proximity of server response and increasing server busy time and expense.</p><h3>Server load sharing</h3><p>These metrics inform you about how effectively your backend servers handle application load. Server load sharing is essential in high-availability designs, where user requests are handled by numerous servers protected by a load balancer.</p><p>How can one find out how many requests are being processed at any time? That is the <a href="https://docs.oracle.com/cd/E19159-01/819-3681/abefn/index.html#:~:text=The%20Thread%20Count%20parameter%20specifies,drops%20below%20the%20maximum%20amount.">thread count</a>. You can learn important details about a server’s capacity here.</p><p>Once the maximum threshold is reached, the requests are kept until there is adequate time to process them. The postponed requests will time out if they take too long.</p><p>The maximum number of threads per process that a single server can manage is frequently throttled, and if the limit is surpassed, issues may result.</p><p>As a result, it’s crucial to monitor and manage the thread count by scaling requests to extra servers hidden behind a load balancer.</p><h3>Server capacity</h3><p>Although guaranteeing your server’s availability and uptime could increase the dependability of your application, if the server cannot handle the volume of requests, then your users may still have a bad experience.</p><p>The situation can be saved by implementing a scaling strategy based on this indicator’s information. Before choosing a scaling procedure, it is essential to consider the server’s average response time and the requests per second.</p><p>Data input and output, which gauge the request payload size received by the server and should be kept modest for better efficiency, are nevertheless crucial to take into account.</p><p>The application might request more data than the server can handle if it has a large payload and receives many requests, which affects the server’s expense.</p><h3>System-level performance</h3><p>You receive no information about the health of your server through server performance monitoring metrics. In your list of server performance metrics to monitor, you should include server utilization metrics and operating system (OS) logs in addition to server availability monitoring and metrics.</p><p>OS logs provide details about any faults occurring in the environment that must be fixed.</p><p>Additionally, you may develop alerts based on strict OS error codes to identify problems quickly. With so many operations linked to applications running simultaneously, it can be challenging to ascertain what is being written to or changed on the server operating systems.</p><p>However, since several fundamental but significant metrics, such as CPU/memory utilization, disk I/O, and disk usage, are used to assess hardware utilization and significantly impact server performance, it may be beneficial to analyze these logs.</p><p>These parameters should be considered to ensure thorough performance monitoring and drastically lower server costs because any of them could be throttled.</p><h3>Tracking server expenses with Appwrite</h3><p>With the help of the self-hosted backend-as-a-service platform <a href="https://appwrite.io/?utm_source=hackmamba&amp;utm_medium=hackmamba-blog">Appwrite</a>, developers can create any application — it offers all the essential APIs.</p><p><a href="https://appwrite.io/?utm_source=hackmamba&amp;utm_medium=hackmamba-blog">Sign up</a> to get started using the Appwrite platform.</p><h3>Conclusion</h3><p>A large-scale infrastructure with numerous servers can be challenging to monitor. To start, you must carefully consider which server metrics are essential for your environment to track.</p><p>This post showed several helpful metrics for tracking your server costs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39c92f7e8881" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtrument/super-useful-metrics-to-track-your-server-expenses-39c92f7e8881">Super Useful Metrics to Track Your Server Expenses</a> was originally published in <a href="https://medium.com/techtrument">Hackmamba</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started on StarkNet with Infura]]></title>
            <link>https://olanetsoft.medium.com/getting-started-on-starknet-with-infura-8abaf66d2e06?source=rss-41c6f1ecf0f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/8abaf66d2e06</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[starknet]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Olubisi Idris Ayinde]]></dc:creator>
            <pubDate>Tue, 04 Oct 2022 15:55:23 GMT</pubDate>
            <atom:updated>2022-10-05T21:58:50.425Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GBm-qdY_5OSjIrT6sUYhZg.png" /><figcaption>Getting Started on StarkNet with Infura</figcaption></figure><p>Over the past year, we have seen an increase in layer two scaling solutions for Ethereum, with ZK-rollups being some of the most promising.</p><p>Thanks to the Stark rollup, any decentralized application can achieve a limitless computing scale, which keeps the Ethereum network secure and stable. This is made feasible by the fact that the STARK cryptographic proof system, which is the most flexible and scalable of all cryptographic proof systems, is used by StarkNet.</p><p>And Infura, Web3’s top node provider, now offers StarkNet compatibility through its node-providing service! By providing StarkNet RPC endpoints, Infura helps bridge the gap for Ethereum developers and facilitates a composable Web3 ecosystem.</p><p>This article covers what StarkNet is, how it contributes to Ethereum scalability, and how developers can get started by launching a smart contract to the network using Infura. You also learn how to access StarkNet with Infura RPC endpoints and deploy your own ERC-20 tokens on the network.</p><h3>Ethereum Scaling</h3><p>Adding a bridge to a layer two network is one of the most effective strategies to maximize the value of crypto assets. Lower transaction fees, more throughput, and improved customer experience are all benefits of doing this.</p><p>Rollups are some of the most widely used options for layer two scaling solutions. They function by processing transactions off-chain. They can also guarantee transaction data storage on the Ethereum chain, boosting layer one network security.</p><p><a href="https://ethereum.org/en/developers/docs/scaling/zk-rollups/">Zero-knowledge rollups</a> create cryptographic proofs that demonstrate the legitimacy of a transaction. It’s interesting to note that each batch of transactions would have a unique “validity proof” filed on the main chain. <a href="https://ethereum.org/en/developers/docs/scaling/optimistic-rollups/">Optimistic rollups</a>, on the other hand, assume that all transactions are valid and can submit batches of transactions without any calculations.</p><p>The ZK rollups’ ability to assess transaction integrity would rely on cryptographic proofs. Conversely, the time between submitting the rollup and its acceptance on the base chain is difficult for optimistic rollups.</p><h3>StarkNet and STARKs</h3><p><a href="https://starkware.co/">StarkNet</a> is a permissionless decentralized ZK-rollup. It functions as an L2 network on top of Ethereum, allowing any dapp to reach an infinite scale for processing without affecting Ethereum’s security and composability.</p><p>By utilizing <a href="https://link.springer.com/chapter/10.1007/978-3-662-49099-0_2">quasi-linear probabilistically checkable proofs (PCPs)</a>, interactive oracle proofs (IOPs), and fast algebraic local coding protocols like FRI, StarkNet’s cryptographic hashing functions are the quickest. They outperform all other ZK technology.</p><p>The Solidity to Cairo compiler also enables faster builds for Solidity developers using the ZK rollup, facilitating the use of established Solidity tools in the developer’s stack.</p><h3>StarkNet Endpoints with Infura</h3><p>Infura, a Web3 Infrastructure-as-a-Service (IaaS) provider, offers various services and tools for blockchain developers. The Infura Application Programming Interface (API) suite is part of this.</p><p>Any project pushing a lot of traffic through the Ethereum network, or one that plans to, can benefit from Infura’s modular scaling solutions. The network of hosted Ethereum clients, which supports mainnet and testnets via client-compatible JSON-RPC over HTTPS and WSS, is the most well-known component of the Infura infrastructure.</p><p>StarkNet endpoints are now widely available and supported by Infura. StarkNet enables indefinite scalability of any commercial use case, backed by STARKs, the most potent zero-knowledge proofs in the Ethereum ecosystem.</p><h3>How To Launch a Project on StarkNet with Infura</h3><h3>Prerequisites</h3><p>Before getting started, we need the following prerequisites:</p><ul><li><a href="https://nodejs.org/en/">Node.js</a> and its package manager NPM.</li><li>Verify we have Node.js installed by using the following terminal command:node -v &amp;&amp; npm -v</li><li><a href="https://docs.infura.io/infura/getting-started">An Infura account</a></li><li>Basic understanding of JavaScript</li></ul><h3>Create an Infura account to access the StarkNet network</h3><p>To access a StarkNet node and execute requests, we will need an Infura endpoint.</p><p>Visit the Infura website to<a href="https://infura.io/register"> sign up</a> for a new account or<a href="https://infura.io/login"> log in</a> if you already have one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*3yHDNKGVTIFvjj7f.png" /></figure><p>After successfully signing up, the page redirects to our dashboard, where we can create a new key, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*f9FiaRQT6Jx_beAg.png" /></figure><p>Click the “Create a New Key” button and fill in the required information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*a-4HTcxy9-J7676s.png" /></figure><p>Next, click the “MANAGE KEY” button, scroll down to the Starknet section, select Goerli network, and copy the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*2yj8WdYjpBuy-L_S.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*xstVk3adqgSQV2pv.png" /></figure><h3>Building a project on StarkNet with Infura</h3><p>This section will build our application from scratch to implement<a href="https://github.com/0xs34n/starknet.js"> StarkNet</a> account creation, deployment, minting and transferring tokens.</p><h3>Project setup and installation</h3><p>We’ll create an empty project and install the<a href="https://github.com/0xs34n/starknet.js"> starknet.js</a> library dependency using the following commands.</p><pre>mkdir deploy-erc-20-token-with-starknet<br>cd deploy-erc-20-token-with-starknet <br>npm init -y <br>npm install starknet dotenv <br>touch index.js</pre><p>Next, create a .env file and paste the StarkNet URL we copied from our Infura dashboard.</p><pre>STARKNET_TESTNET_ENDPOINT=https://starknet-goerli.infura.io/v3/&lt;API-KEY&gt;</pre><h3>Download the account contract ABI</h3><p>Head to the <a href="https://github.com/Olanetsoft/deploy-erc2o-token-with-Starknet/tree/main/contracts">contract folder in this repository</a> to download the contract ABI for<a href="https://github.com/Olanetsoft/deploy-erc2o-token-with-Starknet/blob/main/contracts/ERC20.json"> ERC-20</a> and<a href="https://github.com/Olanetsoft/deploy-erc2o-token-with-Starknet/blob/main/contracts/OZAccount.json"> OZAccount</a>.</p><p>Create a new folder called contracts. Then, create two new files inside the folder, ERC20.json and OZAccount.json.</p><p>Next, we will paste the contract ABI we copied into those files. Our project folder structure should look similar to what we have below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/348/0*VlMZao11U9ct_qY1.png" /></figure><h3>Setup provider</h3><p>We may communicate with the StarkNet network through the Provider API without signing any transactions or messages. We will set up a provider via the Infura API endpoint, but in some cases, we may also want to use the default provider.</p><p>Inside the index.js file, add the following code snippet.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f31a1f498a1ff97e90219b277936c1f3/href">https://medium.com/media/f31a1f498a1ff97e90219b277936c1f3/href</a></iframe><p>In the code snippet above, we</p><ul><li>Imported the starknet, fs, and dotenv libraries</li><li>Initialized the provider URL</li><li>Created a new instance of the Provider from the starknet library</li></ul><h3>Generate private and public key pairs</h3><p>Since StarkNet does not support Externally Owned Accounts (EOA), all accounts on its network are contracts. In contrast to Ethereum, where public and private key pairs facilitate accounts, StarkNet accounts are the only means to sign transactions and communications and confirm signatures. Consequently, a Contract-Account interface is required.</p><p>Let us generate public and private key pairs with the following code snippet.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b1bd562476e7a46e7c67b0fe50b74b3a/href">https://medium.com/media/b1bd562476e7a46e7c67b0fe50b74b3a/href</a></iframe><p>To test our application in the next step and every step afterwards, use the following command:</p><p>node index</p><p>We will use the command above each time we need to run the project locally.</p><p><strong>Note:</strong> If you are getting a SyntaxError stating you can’t use the import statement outside of a module, add “type”: “module” to your package.json file.</p><p>We should have something similar to the output below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*nscnQG6qHObnsvZQ.png" /></figure><p>Write down both keys in case we need to use them again for other procedures in the future. <strong>Never share your private keys with anyone, and keep them secure.</strong></p><h3>Deploy a new account on StarkNet</h3><p>By utilizing the deployContract provider method and passing the previously produced public key as input, we can deploy the pre-compiled account contract to StarkNet.</p><p>Add the following code snippet to deploy the account contract, and we will wait for it to be verified on StarkNet.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/753454d3e2f9f7f396d0fb8dcc530b2a/href">https://medium.com/media/753454d3e2f9f7f396d0fb8dcc530b2a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*FxF3f6gQ4bu1o_YQ.png" /></figure><p>This operation may require a few minutes to complete, but we can always track its progress via the explorer URL logged on the console. To avoid creating multiple accounts each time we run the command to start the project, be sure to fill out the rest of the code in the project.</p><h3>Fund the new account</h3><p>Before anything else, we must add some code to pause the execution and resume it after all of the above actions are completed. Once launched, this pause is necessary because our function won’t stop; we’ll need time to fund our account and confirm the transaction.</p><p>Hence, we will include the following method in the index.js file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c0b80ddb92dc25d96d91d4d3a3895b19/href">https://medium.com/media/c0b80ddb92dc25d96d91d4d3a3895b19/href</a></iframe><p>**Note: **Before running the program again, be sure to fill out the rest of the code in the project. This will avoid having to fund multiple accounts.</p><p>After running the code again, we should have a prompt similar to what we have below, pausing the execution while adding some faucets to our account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*99S4k3lFH6AJhV1m.png" /></figure><p>We need to put some gas in our tank before executing transactions on the StarkNet network (just like we can on Ethereum). Using the official<a href="https://faucet.goerli.starknet.io/"> StarkNet Goerli Faucet</a>, we can fund our account by pasting in the account address from the terminal output.</p><p>Once the transaction is approved, hit enter to continue with the rest of the code.</p><h3>Deploy ERC-20 contract</h3><p>We have successfully created a provider, generated private and public key pairs for our Contract-Account interface, deployed account contracts, and funded our account in the previous steps.</p><p>This section will deploy the ERC-20 contract using the following code snippet.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ad909b7e105d206ed06f35a56f851497/href">https://medium.com/media/ad909b7e105d206ed06f35a56f851497/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*-UyC8YPJcr8pgmos.png" /></figure><h3>Minting tokens</h3><p>Next, we will mint our tokens utilizing the mint transaction, which will take the account address of the recipient and the number of tokens.</p><p>Let us implement that functionality using the following code snippet.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8afd10422fadf1ec8534518da488b4e2/href">https://medium.com/media/8afd10422fadf1ec8534518da488b4e2/href</a></iframe><h3>Transfer tokens</h3><p>Now that we have minted tokens let’s transfer some to confirm they exist and are transferable.</p><p>In the last section of the code, we check the balance of our account. As you can see from the output, our transactions were successful, and we hold a balance of our tokens.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0964df1c8e0cc7d906df98fc00d50003/href">https://medium.com/media/0964df1c8e0cc7d906df98fc00d50003/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*I_vcyO4SGAPBy0rR.png" /></figure><p>Voila! 🥳 We have minted our first ERC-20 tokens on StarkNet with Infura!</p><p>To follow up, you can find the entire code for this project on a GitHub repository<a href="https://github.com/Olanetsoft/deploy-erc2o-token-with-Starknet"> here</a>.</p><h3>Conclusion</h3><p>In this article, you learned about the StarkNet layer two ZK-rollup, how to access it with Infura RPC endpoints, and how to create and deploy your own ERC-20 tokens on the network. Infura helps bridge the gap for Ethereum developers and facilitates a composable Web3 ecosystem by providing these endpoints.</p><p>To learn more about StarkNet and how to build on it using Infura, visit the following resources:</p><h3>Resources</h3><ul><li><a href="https://docs.infura.io/infura/networks/starknet">Infura documentation</a></li><li><a href="https://starknet.io/docs/">StarkNet documentation</a></li><li><a href="https://www.starknetjs.com/">StarkNet.js documentation</a></li><li><a href="https://docs.openzeppelin.com/contracts-cairo/0.3.1/accounts">OpenZeppelin Account Cairo contract documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8abaf66d2e06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[100+ Web 3.0 Common Terminology]]></title>
            <link>https://olanetsoft.medium.com/100-web-3-0-common-terminology-a9b95cc809c2?source=rss-41c6f1ecf0f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9b95cc809c2</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web3]]></category>
            <dc:creator><![CDATA[Olubisi Idris Ayinde]]></dc:creator>
            <pubDate>Fri, 15 Apr 2022 14:08:16 GMT</pubDate>
            <atom:updated>2022-04-15T14:08:16.998Z</atom:updated>
            <content:encoded><![CDATA[<p>Unicorns, complex acronyms, and language changes faster than a well-executed rug pull abound in the web3 world.</p><p>The internet as we know it is evolving right in front of our eyes. It’s all over the news and Twitter feeds, and it’s starting to creep into ordinary conversation. A new era necessitates a new lexicon, andWeb3 has its own set of terminology.</p><p>This post will go through common web3 terminology and its usage.</p><p><strong>Blockchain</strong></p><p>Blockchain is a decentralized digital ledger that anyone can access and can be used to store and transfer data without the need for a central authority. Blockchains are the underlying technology that allows cryptocurrency systems like Bitcoin and Ethereum to function.</p><p><strong>Bitcoin</strong></p><p>Satoshi Nakamoto, a pseudonym, developed the first decentralized, peer-to-peer digital money in 2009. The person or people responsible for the technology are still unknown.</p><p>Unlike government-issued currencies, Bitcoin boasts lower transaction fees than existing online payment options and is managed by a decentralized authority.</p><p><strong>Block</strong></p><p>A block is a group of transactions that have been recorded on the blockchain. Every block has information about the block preceding it, allowing them to communicate with one another.</p><p><strong>Airdrop</strong></p><p>Airdrop is a marketing strategy in which crypto projects send their native tokens directly to their users’ wallets to enhance adoption and awareness.</p><p><strong>Block Explorer</strong></p><p>Block Explorer is a tool for browsing blockchain data, including transactions, wallet addresses, market capitalizations, and hash rates.</p><p><strong>Bridge</strong></p><p>A protocol allows different blockchains to interact, allowing data, coins, and other information to be transferred between systems.</p><p><strong>Burn</strong></p><p>Burning entails withdrawing several tokens from circulation for good. The burning process is accomplished by moving the tokens in question to a burn address, a wallet from which they cannot be retrieved. However, It is often referred to as token destruction.</p><p><strong>Decentralized Autonomous Organization (DAO)</strong></p><p>DAO is an open-source organization that its users manage. DAOs are focused on a single project or objective, and they substitute the traditional hierarchical processes of legacy organizations for blockchain-based principles.</p><p><strong>Decentralized Application (Dapp)</strong></p><p>A Dapp is a blockchain-based application built with open-source technology. Dapps live independently of centralized groups or figures, and they frequently use awarded tokens to incentivize users to keep them up to date.</p><p><strong>WAGMI</strong></p><p>“We’re All Gonna Make It,” a famous phrase in crypto and trading circles, denotes friendship and optimism.</p><p><strong>Web1.0</strong></p><p>Web1 is the earliest version of the internet, also known as the “read-only web.” Information-based static websites defined web1. User interaction and user-generated material were minimal.</p><p><strong>Web2.0</strong></p><p>The “read-write web,” which began in the 1990s, is distinguished by user-generated content and enhanced user interfaces. As a result, blogs, social media platforms, and Wikipedia and YouTube were born.</p><p>Web2 emphasizes user experience and interoperability across different applications and websites, resulting in the extensive network of linked websites and resources we are acquainted with today.</p><p><strong>Ethereum</strong></p><p>Ethereum is a decentralized application platform built on a public blockchain for digital money, international payments, and applications. The community has created a thriving digital economy and innovative new ways for creators to make money online.</p><p><strong>Coin</strong></p><p>A coin, such as BTC, ETH, etc., is a cryptocurrency developed on a native blockchain and meant to be used as a store of value and medium of exchange inside that ecosystem.</p><p><strong>Collateral</strong></p><p>Collateral can be a tangible asset like real estate or a digital investment like an NFT, and it can be used as collateral for a loan. In traditional banking, a typical example of collateral is a mortgage.</p><p><strong>Decentralized Finance (DeFi)</strong></p><p>Decentralized Finance (DeFi) is an ecosystem of borderless, trustless, peer-to-peer financial instruments developed on public blockchains without banks. DeFi applications are designed to be open and networked, allowing them to work together.</p><p>Learn more about Defi</p><p><strong>Smart Contract</strong></p><p>A smart contract is a self-executing code that is deployed on a blockchain. Smart contracts eliminate the requirement for a central authority, legal system, or external enforcement mechanism to carry out trustworthy transactions and agreements between distant, anonymous participants.</p><p><strong>Wallet</strong></p><p>This software application or hardware device holds the private keys to blockchain assets and accounts. Unlike a typical wallet, a blockchain wallet does not contain the currencies or tokens themselves. Instead, they save the private key that certifies a digital asset’s ownership. Metamask, Coinbase Wallet, Ledger, and Trezor are just a few examples.</p><p><strong>DEX (Decentralized Exchange)</strong></p><p>DEX (Decentralized Exchange) is a blockchain-based peer-to-peer cryptocurrency exchange. Instead of an intermediary person or centralized institution, a DEX is run by its users and smart contracts.</p><p><strong>Decentralized</strong></p><p>It’s a system that runs without the supervision of a central figure of authority instead of relying on a distributed peer-to-peer network.</p><p><strong>DYOR (Do Your Own Research)</strong></p><p>This phrase reminds people to do their research before investing in a specific asset.</p><p><strong>Slippage</strong></p><p>Slippage is the difference between the listed price of a cryptocurrency and the price at which a deal executes.</p><p><strong>Fork</strong></p><p>A fork is a modification to the protocol of a blockchain. It results in a soft fork when the changes are minor. When the improvements are more fundamental, a hard fork may occur, resulting in the development of a second chain with its own set of rules.</p><p><strong>Fork (Hard)</strong></p><p>A fork is a significant alteration to a blockchain that is incompatible with the current protocol and necessitates the creation of a new chain.</p><p><strong>Fork (Soft)</strong></p><p>A soft fork is a blockchain upgrade that is backward compatible. These changes do not necessitate the formation of a new chain, unlike a hard fork.</p><p><strong>Transaction Hash (Txn Hash)</strong></p><p>Transaction Hash (Txn Hash) is a long string of letters and digits that serves as a unique identifier for a given transaction.</p><p>You may find the specifics of a transaction by pasting a txn hash into a block explorer like Etherscan.</p><p><strong>Stablecoin</strong></p><p>Stablecoin is a token whose value is linked to a different asset. These coins are usually backed by a fiat currency, such as the US dollar. Still, they can also be supported by tangible assets such as precious metals or even other cryptocurrencies, such as Bitcoin.</p><p><strong>Full Node</strong></p><p>This blockchain node verifies and relays transactions while also storing the blockchain’s entire history.</p><p><strong>Fractionalize</strong></p><p>Fractionalization encodes an NFT in a smart contract and breaks it into smaller pieces distributed as fungible tokens. It decreases ownership costs and allows a community to own artwork and other digital assets.</p><p><strong>Slashing</strong></p><p>Slashing is the process of a validator’s staked bitcoin being burned or redistributed as a penalty for allowing fraudulent charges or otherwise damaging the network.</p><p><strong>Token</strong></p><p>A token is a digital asset established on a blockchain that already exists. Tokens represent digital and physical assets and interact with decentralized applications (Dapps).</p><p><strong>Transaction</strong></p><p>A transaction is a data that has been added to a blockchain. Nodes on the network verify new transactions before broadcasting them to other nodes. The transaction is considered genuine and added to a block if enough nodes have validated it.</p><p><strong>P2P (peer-to-peer)</strong></p><p>P2P refers to a network of two or more computers that communicate directly without a central server or entity.</p><p><strong>Metaverse</strong></p><p>People inhabit the metaverse as avatars in a speculative or emergent networked online universe with digitally permanent environments.</p><p>Virtual reality, augmented reality, game consoles, mobile devices, and traditional PCs are utilized to access the shared virtual area for synchronous interactions and experiences.</p><p><strong>Testnet</strong></p><p>Testnet is a software environment that resembles the mainnet blockchain and is used to test network upgrades and smart contracts before they are deployed to the mainnet.</p><p><strong>Wallet Address</strong></p><p>Like a bank account number, a wallet address is an alphanumeric identifier that serves as the address for a blockchain wallet.</p><p>Other users can send digital assets to your wallet using your public key, but the contents of your wallet are only accessible using your private key.</p><p><strong>Wei</strong></p><p>Wei is the smallest ether denomination, named afterWei Dai, a cypherpunk and cryptocurrency pioneer. One ether = 10¹⁸ gwei</p><p><strong>SHA-256</strong></p><p>The Secure Hashing Algorithm (SHA) is a set of cryptographic hashing functions developed by the National Security Agency (NSA). SHA-256 takes an input of data and generates a hash, which is a long series of letters and numbers. This hash is then used to represent the data securely.</p><p><strong>Sharding</strong></p><p>Sharding is a technique for breaking down a network’s nodes into smaller groups (shards) to improve scalability. These shards can then reach a consensus on behalf of the entire network, eliminating the requirement for each node to execute each transaction.</p><p><strong>Rug Pull</strong></p><p>Rug pulling is a scam technique in which a crypto enterprise takes the monies invested in its protocol and runs with them. Pump-and-dump work on the inside, if you will. Rug pulls can also happen in assets with a centralized ownership structure. If someone can sell a significant amount of the circulating supply, the supply will rapidly expand, causing the asset’s price to drop.</p><p><strong>Protocol</strong></p><p>A program’s basic software layer is called a protocol. A protocol has become a catch-all phrase for both layer one blockchain networks and the layer two applications developed on top of them. Protocols include Bitcoin, Ethereum, Uniswap, and Lightning Network.</p><p><strong>Consensus</strong></p><p>Consensus is an algorithm that aims to make decentralized record-keeping more centralized database-like.</p><p>The state of agreement among the nodes on a blockchain is often called consensus. A consensus is required to confirm new transactions and add new blocks to the blockchain.</p><p><strong>Mechanism of Consensus</strong></p><p>The consensus mechanism is how nodes on a blockchain agree on a transaction or the network’s current state.</p><p><strong>Minting</strong></p><p>Minting confirms and registers information on the blockchain, such as domain ownership.</p><p><strong>Public key</strong></p><p>The public key is used to point to your wallet address, an alphanumeric code similar to a bank account number that acts as the address for a blockchain wallet. Other users can send digital assets to your wallet using your public key, but only you have access to the contents of your wallet using the private key.</p><p><strong>Private Key</strong></p><p>A private key is an alphanumeric passcode that may be used to withdraw funds from a blockchain wallet and approve digital transactions. Because these private keys are long and difficult to recall, wallets usually associate them with a seed or recovery phrase.</p><p><strong>Oracle</strong></p><p>Oracle is a service that provides data from the outside world to smart contracts. Smart contracts can’t access data off-chain; thus, they rely on oracles like Chainlink and Band Protocol to retrieve, verify, and distribute external data.</p><p><strong>Mining</strong></p><p>Mining is a Proof of Work (PoW) system. Confirming transactions, grouping them into blocks, and adding blocks to the blockchain is block verification. Miners are those who participate in this procedure.</p><p><strong>PoW (Proof of work )</strong></p><p>PoW is a consensus process in which miners must solve complicated mathematical problems to verify transactions and mint blocks. When miners solve a challenge correctly, they acquire permission to mint the next block and receive the block reward and transaction fees.</p><p><strong>Node</strong></p><p>Any device connecting to a blockchain network is referred to as a node. Different nodes have different levels of responsibility and may be used to validate transactions, maintain the blockchain’s history, transmit data, and perform other tasks.</p><p>Nodes come together to construct the network’s infrastructure since blockchains are dispersed peer-to-peer networks.</p><p><strong>NFT (Non-fungible token)</strong></p><p>A digital certificate of authenticity, or NFT, is used to assign and verify a single digital or physical item ownership. NFTs are not convertible with each other, unlike fungible tokens.</p><p><strong>To the moon</strong></p><p>This term suggests that the value of an asset will rise to the point where it will reach the moon. This is utilized by shills, bulls, and virtually everyone during a bull market.</p><p><strong>Mainnet</strong></p><p>In contrast to a testnet or layer two solutions, the mainnet is a main layer one blockchain.</p><p><strong>Market Capitalization</strong></p><p>The entire worth of an asset is determined by its current market price. The market capitalization of a cryptocurrency is calculated by multiplying the price of a single coin by its circulating supply.</p><p><strong>Liquidity Pool</strong></p><p>The Liquidity Pool collects user-provided funds locked into a smart contract to make trading on a DeFi platform easier.</p><p>Users must offer liquidity on decentralized exchanges and lending protocols because there is no central bank or figure to do so.</p><p><strong>Liquidity</strong></p><p>Liquidity refers to how easily an item can be bought, sold, or traded in a given market. Market liquidity and accounting liquidity are the two most common forms of liquidity. Cash is the most liquid asset, whereas tangible assets are less so.</p><p><strong>ERC-1155</strong></p><p>ERC-1155 is an Ethereum token standard that allows a single, smart contract to manage fungible, non-fungible simultaneously, and semi-fungible tokens. These are often employed in gaming and collector trading to reduce the number of transactions required.</p><p><strong>ERC-20</strong></p><p>Tokens represent many digital assets in the Ethereum system, including vouchers, IOUs, and even real-world, actual objects. ERC-20 is the Ethereum token standard, which provides fungible tokens with a standardized innovative contract structure.</p><p><strong>ERC-721</strong></p><p>ERC-721 is an Ethereum token standard that enables the creation of non-fungible tokens, sometimes known as NFTs.</p><p>ERC-721 tokens, unlike the ERC-20 standard, have distinct attributes that allow them to be identified and priced independently of one another.</p><p><strong>FOMO (Fear Of Missing Out )</strong></p><p>FOMO is a sensation of worry caused by missing out on a chance. It usually occurs when investors acquire an asset after it has already experienced a significant price increase, hoping to get in and out before a pullback occurs.</p><p><strong>Genesis Block</strong></p><p>Genesis Block is the first block of a blockchain network.</p><blockquote>We might have noticed it’s not up to 100 :( I will be updating this post as I come across more web3.0 terms.</blockquote><p><strong>Conclusion</strong></p><p>This post covers vital web3.0 terminologies and their definitions.</p><p>I’d love to connect with you on <a href="https://twitter.com/olanetsoft">Twitter</a> | <a href="https://www.linkedin.com/in/olubisi-idris-ayinde-05727b17a/">LinkedIn</a> | <a href="https://github.com/Olanetsoft">GitHub</a> | <a href="https://idrisolubisi.com/">Portfolio</a></p><p>See you in my next blog article. Take care!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9b95cc809c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2021 in Review: The Good, the Bad, and the Ugly]]></title>
            <link>https://olanetsoft.medium.com/2021-in-review-the-good-the-bad-and-the-ugly-e417e4b8a755?source=rss-41c6f1ecf0f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e417e4b8a755</guid>
            <category><![CDATA[content]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[year]]></category>
            <dc:creator><![CDATA[Olubisi Idris Ayinde]]></dc:creator>
            <pubDate>Tue, 15 Feb 2022 20:24:14 GMT</pubDate>
            <atom:updated>2022-02-15T20:24:14.298Z</atom:updated>
            <content:encoded><![CDATA[<p>Uh yeah, 2021 is indeed a wonderful year.</p><p>For me, the tradition of publishing annual reviews began last year (<a href="https://blog.idrisolubisi.com/2020-year-in-review">2020</a> in review). I’m also glad for the opportunity to write another review this year.</p><p>I’ll start with a list of things I expected to get done but didn’t.</p><blockquote>Failure is simply the opportunity to begin again, this time more intelligently. — Henry Ford</blockquote><h4>The Bad and Ugly</h4><p>This list contains some things I hoped to achieve or failed to do or some rejections in 2021. 🥲</p><ul><li>Got about 150+ rejections, and some didn’t even respond</li><li>a San Francisco based Company rejected me after the hack week test, which was meant to be the final step to get on board as a full-time software engineer</li><li>Got introduced to a Startup, became the CTO and was betrayed after it was silently acquired(a story for another day)</li><li>I wanted to engage in more speaking opportunities than writing, but I failed; I hope to do more in 2022</li><li>I was depressed at some point but thanked God I found my love(Technical writing)</li><li>Applied to speak at several events but was rejected for some reasons I don’t understand 🥲</li></ul><h4>The Good</h4><h4>Growth</h4><ul><li>I got a new job as a Backend Engineer with a startup in the US.</li><li>I Started Building several solutions for GT Bank and Contributed / Co-founded some projects, both paid and unpaid.</li><li>Finally, i bought a new Macbook 2018 15&#39; (16gb, 512 SSD, corei7, 4gb dedicated).</li><li>Got several calls and referrals on Backend Engineering Role.</li><li>One of my favourite projects that I actively/currently contribute to went live <a href="https://fundmylaptop.com/">FundmyLaptop</a>.</li><li>Another Big WIN, I was Nominated as a GitHub Star. <a href="https://twitter.com/olanetsoft/status/1431212394894827522?s=20">Announced here</a></li><li>I Became <a href="https://angelhack.com/">AngelHack</a> Country Ambassador, a San Francisco based global hackathon Organization</li><li>Became <a href="https://www.section.io/engineering-education">Section.io</a> spotlight member with over 66k+ views on the <a href="https://www.section.io/engineering-education/authors/idris-olubisi/">articles published</a></li><li>Creator Spotlight interviewed by Taelfeed, <a href="https://tealfeed.com/creators-spotlight-write-enjoy-write-currently-iy4gu">check here</a></li><li>Got five interview requests in the last quarter of the year on a Developer Advocate / Technical writing / Full-stack JavaScript Engineer Role. (More info later)</li><li>I was Promoted at my current workplace to a Backend Lead ( Got Fresh news too✌️)</li><li>Won 2 awards (Top 10 Writer 2021 and Top Reader 2021) on @hashnode with over 50k active members</li></ul><h4>Content Creation</h4><ul><li>Made my first million (NGN) from content creation</li><li>Wrote over 69+ articles this year, including paid articles</li><li>I became a FreecodeCamp author, and I wrote solid technical content <a href="https://www.freecodecamp.org/news/author/idris/">Check Here</a>. Big thanks to the FreecodeCamp Editorial team for making the process seamless</li><li>I started writing for <a href="https://www.section.io/engineering-education/authors/idris-olubisi/">Section Engineering</a> I was paid in $$(Big Win 😌)</li><li>I started writing more articles on my <a href="https://blog.idrisolubisi.com/">blog</a></li><li>I became an Author at <a href="https://www.linkedin.com/company/hackmamba-io/mycompany/">HackMamba</a>, and I was also part of their editorial team during the Content Creation Hackathon sponsored by Auth0 and Cloudinary.</li><li>I was invited to join <a href="https://profile.idrisolubisi.com/">Showwcase</a> founding creator.</li><li>I did live coding building a NodeJs app using HarperDB as the database. <a href="https://youtu.be/13YHkG7F6oQ?t=501">Link to Video</a></li><li>I became a contributing Author at Aviyel, Did a live coding demo and finally, I got a beautiful swag box from Aviyel. <a href="https://www.youtube.com/watch?v=Q4YJzPlRQ-8">Link to Video</a>.</li><li>Wrote an article on <a href="https://dev.to/olanetsoft">dev to</a> that got 40k+ views within 48hrs and topped the trending list on day 5.</li><li>Got an invite to write a paid Content ($$ of course) from 3 different companies worldwide within a week.</li><li>Participated in the <a href="https://content.hackmamba.io/content-hackathon">Auth0 and Cloudinary hackathon</a></li><li>I accepted an invitation to become an author of Contentlab.io and <a href="https://www.appsmith.com/blog/upload-and-manage-files-on-cloudinary-with-the-filepicker-widget">AppSmith</a></li><li>Hit 160k+ views on <a href="https://dev.to/olanetsoft">dev.to</a> 🥳🥳🥳</li><li>I was Featured on global <a href="https://tech-blogs.dev/">Teach Blogs</a> created by @<a href="https://medium.com/@denic">Marko Denic</a></li></ul><h4>Community Engagement</h4><ul><li>I got accepted as Open Source Africa Hero in Yaba, Lagos. (One of the things I love to do more in 2022)</li><li>Became a mentor in the Nodejs track at DSC X SCA OAU Mentorship Program.</li><li>After mentoring for months, I Became the backend development channel lead @ <a href="https://shecodeafrica.org/">SheCodeAfrica</a>.</li><li>Volunteered at the Unstack 3.0 tech event/workshop on the 6th of November 2021</li></ul><p><a href="https://medium.com/@franklinoladipo/unstack-africa-conference-3-0-everything-you-need-to-know-d4decc6ba49">All the Experience captured here</a></p><ul><li>Volunteered at the GDG DevFest in Lagos on the 3rd of December, 2021</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FSqLF5Idmd1Y%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DSqLF5Idmd1Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FSqLF5Idmd1Y%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b42471f56d7e79ac75c6bb240b156752/href">https://medium.com/media/b42471f56d7e79ac75c6bb240b156752/href</a></iframe><h4>Speaking Engagement</h4><ul><li>I spoke at the Frontstack.io event. Super excited about this because it was my first speaking event for the year and my second speaking engagement.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FLzyoqRNVzsI%3Fstart%3D2318&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DLzyoqRNVzsI&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FLzyoqRNVzsI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8e34f2bd400e6558d95d7a9633a3a9b3/href">https://medium.com/media/8e34f2bd400e6558d95d7a9633a3a9b3/href</a></iframe><ul><li>Another Speaking Engagement at Solo learn: About Burnout(On telegram)</li><li>Invited to speak on “Job Opportunities for Junior Developers” organised/coordinated by @<a href="https://medium.com/@unclebigbay">Ayodele Samuel Adebayo</a> and <a href="https://www.w3schools.com/">W3Schools</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FNY6_2ozQilE%3Fstart%3D2971%26feature%3Doembed%26start%3D2971&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNY6_2ozQilE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNY6_2ozQilE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/251e11f82f6fa521c52796eecc98f305/href">https://medium.com/media/251e11f82f6fa521c52796eecc98f305/href</a></iframe><h4>Gifts</h4><ul><li>Received my first international gift(swags) from daily.dev</li><li>Received another beautiful SWAG box from <a href="https://aviyel.com/">Aviyel</a></li></ul><p>And lots more.</p><blockquote>I created a link to view all my contents, both paid and unpaid; check it out 👇</blockquote><p><a href="https://linktr.ee/olanetsoft">@olanetsoft | Linktree</a></p><h4>Conclusion</h4><p>Thank you for going through this content. We will go harder in the year 2022. ✌️</p><p>I’d love to connect with you at <a href="https://twitter.com/olanetsoft">Twitter</a> | <a href="https://www.linkedin.com/in/olubisi-idris-ayinde-05727b17a/">LinkedIn</a> | <a href="https://github.com/Olanetsoft">GitHub</a> | <a href="https://idrisolubisi.com/">Portfolio</a></p><p>See you in my next blog article. Take care!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e417e4b8a755" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Mini Buymeacoffee dApp Using Solidity + Ethereum Smart Contract + ReactJs + TailwindCSS]]></title>
            <link>https://olanetsoft.medium.com/build-a-mini-buymeacoffee-dapp-using-solidity-ethereum-smart-contract-reactjs-tailwindcss-a28d9d17e204?source=rss-41c6f1ecf0f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a28d9d17e204</guid>
            <category><![CDATA[web3]]></category>
            <dc:creator><![CDATA[Olubisi Idris Ayinde]]></dc:creator>
            <pubDate>Tue, 15 Feb 2022 20:24:08 GMT</pubDate>
            <atom:updated>2022-02-15T20:24:08.895Z</atom:updated>
            <content:encoded><![CDATA[<p>Blockchain is typically one of the highest-paying programming industries, with developers earning between $150,000 and $175,000 per year on average as salaried employees. Sound interesting, right?</p><p>To learn more about a developer roadmap and how to get started, <a href="https://blog.idrisolubisi.com/web-3-a-developer-roadmap-and-resources-to-get-started">Check here</a>.</p><p>In this article, we will Build a Mini Buymeacoffee dAPP Using Solidity, Ethereum Smart Contract, ReactJs, and tailwind CSS. It’ll be a platform where anyone on the internet can learn a little about us and send us money to purchase coffee + a note, with the information being kept on the blockchain via an Ethereum smart contract. (A smart contract is essentially code that stays on the blockchain and can be read and written from; we’ll go over this in more detail later.)</p><p>We’ll create the smart contract and deploy it. We will also build a website that will allow people to connect their wallets and engage with our smart contract.</p><p>Here is a link to the <a href="https://buymeacoffee.vercel.app/">Live Demo</a> and the GitHub Repositories 👉 <a href="https://github.com/Olanetsoft/buymeacoffee-fe">Frontend</a> and <a href="https://github.com/Olanetsoft/buymeacoffee-be">Backend/Smart Crontract</a></p><h4>Prerequisite</h4><ul><li>Let us ensure we have Node/NPM installed on our PC. If you don’t have it, head over <a href="https://hardhat.org/tutorial/setting-up-the-environment.html">here</a> to for a guide</li></ul><h4>Project Setup and Installation</h4><p>Next, let’s head over to the terminal. We’ll need to cd into the directory we wish to work with and then run the following commands:</p><pre>mkdir mini-buymeacoffee-be<br>cd mini-buymeacoffee-be<br>npm init -y<br>npm install --save-dev hardhat</pre><p>Now, we should have a hardhat. Let’s get a sample project going by running the command below:</p><pre>npx hardhat</pre><p>We’ll go with the option of creating a sample project. Accept all requests. Installing hardhat-waffle and hardhat-ethers is required for the sample project. These are some of the other things we’ll be using later:).</p><p>Just in case it didn’t do it automatically, we will install these other requirements.</p><pre>npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers</pre><p>To make sure everything is working, run:</p><pre>npx hardhat test</pre><p>We will see a passed test result in our console.</p><p>It is now possible for us to Delete sample-test.js from the test folder. Delete sample-script.js from the scripts directory as well. After that, go to contracts and delete Greeter.sol.</p><blockquote>The folders themselves should not be deleted!</blockquote><p>Next, under the contracts directory, we’ll create a file called CoffeePortal.sol. When using Hardhat, file layout is really crucial, so pay attention! We’re going to start with the basic structure of every contract.</p><pre>// SPDX-License-Identifier: UNLICENSED<br><br>pragma solidity ^0.8.0;<br><br>import &quot;hardhat/console.sol&quot;;<br><br>contract CoffeePortal {<br><br>    constructor() payable {<br>        console.log(&quot;Yo! Smart Contract&quot;);<br>    }<br>}</pre><p>To build and deploy our smart contract, navigate to the scripts folder, create a new file called run.js, and update it with the following code snippet:</p><pre>const main = async () =&gt; {<br><br>// This will actually compile our contract and generate the necessary files we need to work with our contract under the artifacts directory.<br>  const coffeeContractFactory = await hre.ethers.getContractFactory(&#39;CoffeePortal&#39;);<br>  const coffeeContract = await coffeeContractFactory.deploy();<br><br>  await coffeeContract.deployed(); // We&#39;ll wait until our contract is officially deployed to our local blockchain! Our constructor runs when we actually deploy.<br><br> console.log(&quot;Coffee Contract deployed to:&quot;, coffeeContract.address);<br>};<br><br>const runMain = async () =&gt; {<br>  try {<br>    await main();<br>    process.exit(0);<br>  } catch (error) {<br>    console.log(error);<br>    process.exit(1);<br>  }<br>};<br><br>runMain();</pre><p>Let’s run it!</p><pre>npx hardhat run scripts/run.js</pre><p>You should see something similar to what we have below:</p><figure><img alt="hardhat compilation result" src="https://cdn-images-1.medium.com/max/1024/0*7otJKzLkD9xk06Ew.png" /></figure><p>We have a working smart contract 🥳 Let us deploy it to a network by making it available to everyone worldwide.</p><p>Under the scripts folder, create a file called deploy.js. Here&#39;s the code for it. It looks super similar to run.js.</p><pre>const main = async () =&gt; {<br>  const [deployer] = await hre.ethers.getSigners();<br>  const accountBalance = await deployer.getBalance();<br><br>  console.log(&quot;Deploying contracts with account: &quot;, deployer.address);<br>  console.log(&quot;Account balance: &quot;, accountBalance.toString());<br><br>  const Token = await hre.ethers.getContractFactory(&quot;CoffeePortal&quot;);<br>  const portal = await Token.deploy();<br>  await portal.deployed();<br><br>  console.log(&quot;CoffeePortal address: &quot;, portal.address);<br>};<br><br>const runMain = async () =&gt; {<br>  try {<br>    await main();<br>    process.exit(0);<br>  } catch (error) {<br>    console.error(error);<br>    process.exit(1);<br>  }<br>};<br><br>runMain();</pre><p>Now the command below we’re going to deploy locally using the localhost network for test:</p><pre>npx hardhat run scripts/deploy.js --network localhost</pre><p>We should have something similar to what we have below:</p><figure><img alt="Rinkeby Network" src="https://cdn-images-1.medium.com/max/1024/0*zxSU5hx6bY4gwLTH.png" /></figure><h4>Building and Deploying CoffeeContract to Blockchain</h4><p>Everything is now in place, including the test script and the ‘deploy.js’ file. With the following code snippet, we’ll update the Smart Contract, run.js, and deploy.js files:</p><p>contracts/CoffeePortal.sol</p><p>%[https://gist.github.com/Olanetsoft/a9105c734228f9e15965ef8a36ab825c]</p><p>Update scripts/run.js</p><p>%[https://gist.github.com/Olanetsoft/f8ea2716f18a6f9bb7e1fe1fb62b13fe]</p><p>Update scripts/deploy.js</p><p>%[https://gist.github.com/Olanetsoft/5c9d3e8275fcde262dfe17a0508858ae]</p><p>Now it’s time to get down to business, deploying to the real blockchain.</p><p>We’ll need to sign up for an <a href="https://alchemy.com/?r=37c4f8545ef30da7">Alchemy account</a> before we can deploy to the blockchain.</p><p>Alchemy basically allows us to broadcast our contract creation transaction so that miners can pick it up as soon as possible. The transaction is then broadcasted to the blockchain as a legitimate transaction once it has been mined. After that, everyone’s copy of the blockchain is updated.</p><p>We’ll create an app as shown below after signing up. Remember to change the network selection to Rinkeby because that’s where we’ll be deploying.</p><p>We switched it from mainnet to Rinkeby for a reason. Because it’s real money, and it’s not worth squandering! We’ll start with a “testnet,” which is a clone of “mainnet” but utilizes fictitious money so we can experiment as much as we like. However, it’s crucial to note that testnets are operated by genuine miners and are designed to simulate real-world conditions.</p><figure><img alt="Alchemy App" src="https://cdn-images-1.medium.com/max/1024/0*tD9Y3ZBvQWGSXTLg.png" /></figure><p>Afterward, we will need to grab our keys as shown below, and store them for later use:</p><figure><img alt="Alchemy keys" src="https://cdn-images-1.medium.com/max/1024/0*9UGVraNzfp08AFq5.png" /></figure><p>We’ll need some fake ETH in our testnet account, and we’ll have to request some from the network. This fake ETH can only be used on this testnet. Rinkeby can get some phony ETH by using a faucet.</p><p>| Name | Link | Amount | Time | | — — — | — — — — — — — — — — — — | — — — | — — | — — | | MyCrypto | <a href="https://app.mycrypto.com/faucet">https://app.mycrypto.com/faucet</a> | 0.01 | None | | Buildspace | <a href="https://buildspace-faucet.vercel.app/">https://buildspace-faucet.vercel.app/</a> | 0.025 | 1d | | Ethily | <a href="https://ethily.io/rinkeby-faucet/">https://ethily.io/rinkeby-faucet/</a> | 0.2 | 1w | | Official Rinkeby | <a href="https://faucet.rinkeby.io/">https://faucet.rinkeby.io/</a> |3 / 7.5 / 18.75 |8h / 1d / 3d |</p><p>Table by <a href="https://buildspace.so/">Buildspace</a></p><p>Our hardhat.config.js file needs to be updated. This can be found in the smart contract project’s root directory.</p><pre>require(&quot;@nomiclabs/hardhat-waffle&quot;);<br>require(&quot;dotenv&quot;).config();<br><br>// This is a sample Hardhat task. To learn how to create your own go to<br>// https://hardhat.org/guides/create-task.html<br>task(&quot;accounts&quot;, &quot;Prints the list of accounts&quot;, async (taskArgs, hre) =&gt; {<br>  const accounts = await hre.ethers.getSigners();<br><br>  for (const account of accounts) {<br>    console.log(account.address);<br>  }<br>});<br><br>// You need to export an object to set up your config<br>// Go to https://hardhat.org/config/ to learn more<br><br>/**<br> * @type import(&#39;hardhat/config&#39;).HardhatUserConfig<br> */<br>module.exports = {<br>  solidity: &quot;0.8.4&quot;,<br>  networks: {<br>    rinkeby: {<br>      url: process.env.STAGING_ALCHEMY_KEY,<br>      accounts: [process.env.PRIVATE_KEY],<br>    },<br>  },<br>};</pre><p>If we look at the code snippet above, we can see that some keys were read from the .env file, as well as the import at the top of require(&quot;dotenv&quot;).config(), which implies we&#39;ll need to install the dotenv package and also create a .env file using the command below:</p><pre>npm install -D dotenv<br><br>touch .env</pre><p>Inside the .env file, add the following keys:</p><pre>STAGING_ALCHEMY_KEY= // Add the key we copied from the Alchemy dashboard here<br>PRIVATE_KEY= // Add your account private key here</pre><p>To get our account private key is easy, check out this <a href="https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-Export-an-Account-Private-Key">post</a>.</p><p>Now we can run the command to deploy our contract to a real blockchain network</p><pre>npx hardhat run scripts/deploy.js --network rinkeby</pre><p>Here’s what our output should look like:</p><figure><img alt="Rinkeby Output" src="https://cdn-images-1.medium.com/max/1024/0*DHcppSSpehwu1pF8.png" /></figure><p>Yay 🥳 we just deployed our contract.</p><h4>Set up Frontend React Client</h4><p>It’s time to get our website up and running! Our smart contract is completed, but we need to figure out how our front end can interact with it as soon as possible!</p><p>To create a new project, we use the npx create-next-app -e with-tailwindcss command to scaffold a new project in a directory of our choice.</p><p>This command creates a Next.js project with TailwindCSS set up. TailwindCSS is a utility-first CSS framework packed with classes to help us style our web page.</p><p>To install the dependencies, we use the commands:</p><pre>cd &lt;project name&gt; <br>npm install ethers react-toastify</pre><p>Once the app is created and the dependencies are installed, we will see a message with instructions for navigating to our site and running it locally. We do this with the command.</p><pre>npm run dev</pre><p>Next.js will start a hot-reloading development environment accessible by default at <a href="http://localhost:3000/">http://localhost:3000</a></p><p>We need to connect our wallet to the blockchain in order for our website to communicate with it. Our website will have permission to call smart contracts on our behalf after we connect our wallet to our website. Remember, it’s the same as logging into a website.</p><p>All of our work will be done in index.js, which can be found under pages.</p><p>%[https://gist.github.com/Olanetsoft/6c8270d4e174e0e3a43170c51e314ef3]</p><p>We need to import abi and update our contractAddress in the code sample above. Let’s start by creating a folder named utils, then using the following command to create a file called CoffeePortal.json inside the utils folder.</p><pre>mkdir utils<br>touch CoffeePortal.json</pre><p>Following that, we’ll need our contract address as well as the content that will be updated in the CoffeePortal.json file. What&#39;s the best way to get it?</p><p>Let’s go back to the smart contract project we worked on before, then navigate to artifacts/contracts/coffeePortal.json and copy the entire content inside it, as well as our contract address, which was displayed in our terminal when we deployed our contract to the blockchain.</p><p>We will update the CoffeePortal.json file with what we copied and also update index.js as shown below:</p><pre>// ...<br><br>import Head from &quot;next/head&quot;;<br><br>// Import abi<br>import abi from &quot;../utils/CoffeePortal.json&quot;;<br><br>export default function Home() {<br>  /**<br>   * Create a variable here that holds the contract address after you deploy!<br>   */<br>  const contractAddress = &quot;&quot;;  // Add contract address here<br><br>   // ...<br>  return (<br>    &lt;div className=&quot;flex flex-col items-center justify-center min-h-screen py-2&quot;&gt;<br>      [...]<br>    &lt;/div&gt;<br>  );<br>}</pre><p>Its time to test our app, we should have something similar to what we have below when we visit <a href="http://localhost:3000/">http://localhost:3000</a></p><figure><img alt="DApp landing page" src="https://cdn-images-1.medium.com/max/1024/0*Ue3szJihEBuAWBfa.png" /></figure><p>Next, clicking connect wallet button should redirect us to the MetaMask UI where we will grant the site access as shown below:</p><figure><img alt="MetaMask" src="https://cdn-images-1.medium.com/max/1024/0*fHF03dhZknnUiHnX.png" /></figure><figure><img alt="MetaMask Connecting" src="https://cdn-images-1.medium.com/max/1024/0*2s5LWyHcvrU01n5E.png" /></figure><p>Then our UI should look similar to what is shown below:</p><figure><img alt="Buy Me A Coffee - DApp" src="https://cdn-images-1.medium.com/max/1024/0*CgYhC0-dweLO2zFJ.png" /></figure><p>We can now support, by buying a coffee worth $5 and also providing our name and any preferred message to the owner 😊</p><figure><img alt="Buy A Coffee" src="https://cdn-images-1.medium.com/max/1024/0*Z-SSpAHSCKBJ0vRB.png" /></figure><p>Next,</p><figure><img alt="Connect MetaMask" src="https://cdn-images-1.medium.com/max/1024/0*uMwADwMKlUhjLeda.png" /></figure><figure><img alt="Minning" src="https://cdn-images-1.medium.com/max/1024/0*B649QDyBXaMjraOm.png" /></figure><p>Completed…</p><figure><img alt="Transaction Completed" src="https://cdn-images-1.medium.com/max/1024/0*nJQzjqRcTnzMjfzO.png" /></figure><p>Another coffee support:</p><figure><img alt="Blockchain Transaction" src="https://cdn-images-1.medium.com/max/1024/0*UJnDq6rhnckdesZO.png" /></figure><p>If we observe, the page updates in real-time once a transaction is completed; this is the result of the event we introduced to our smart contract, and React, of course, effortlessly updates the UI.</p><h4>Conclusion</h4><p>In this article, we learned how to build a mini buymeacoffee dAPP using solidity, ethereum smart contract, react, and tailwind CSS.</p><h4>References</h4><ul><li><a href="https://ethereum.org/en/developers/docs/">Ethereum</a></li><li><a href="https://dev.to/dabit3/the-complete-guide-to-full-stack-ethereum-development-3j13">Fullstack Dapp</a></li><li><a href="https://unsplash.com/photos/jpsocjU9R7s">Cover Photo</a></li></ul><p>I’d love to connect with you at <a href="https://twitter.com/olanetsoft">Twitter</a> | <a href="https://www.linkedin.com/in/olubisi-idris-ayinde-05727b17a/">LinkedIn</a> | <a href="https://github.com/Olanetsoft">GitHub</a> | <a href="https://idrisolubisi.com/">Portfolio</a></p><p>See you in my next blog article. Take care!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a28d9d17e204" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>