<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Dhaiwat Pandya</title>
        <link>https://paragraph.com/@dhaiwat</link>
        <description>DevRel @ Ankr
Building devtools and educational content for web3
Developer DAO and Moonshot Collective</description>
        <lastBuildDate>Thu, 16 Jul 2026 06:51:48 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>Dhaiwat Pandya</title>
            <url>https://storage.googleapis.com/papyrus_images/7e4ba19dccf623783698f1dfe0a4c01ff622a711b3cbd725d10fa3c4032092a1.jpg</url>
            <link>https://paragraph.com/@dhaiwat</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[Permanently deploy decentralized React frontends to Arweave]]></title>
            <link>https://paragraph.com/@dhaiwat/permanently-deploy-decentralized-react-frontends-to-arweave</link>
            <guid>PGz9a1vVen49nnirjE74</guid>
            <pubDate>Wed, 22 Jun 2022 15:06:08 GMT</pubDate>
            <description><![CDATA[The need for permanent and decentralized frontend deploymentsMost frontend devs I know in web3 use Next.js + Vercel for their frontends. Probably for good reason, too. Next.js is fast & feature-packed, and no other platform has a better developer experience than Vercel.While this stack serves well for most, it is a very centralized solution. Your frontend will be at the mercy of Vercel, who use AWS behind the scenes. Not very web3. To be fair, most people don&apos;t need a decentralized front...]]></description>
            <content:encoded><![CDATA[<h2 id="h-the-need-for-permanent-and-decentralized-frontend-deployments" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">The need for permanent and decentralized frontend deployments</h2><p>Most frontend devs I know in web3 use <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nextjs.org/">Next.js</a> + <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vercel.com">Vercel</a> for their frontends. Probably for good reason, too. Next.js is fast &amp; feature-packed, and no other platform has a better developer experience than Vercel.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6147df2589a2fbf1160069e20d9f8ba38c61315627f0a3d7e617d9ecc284b57f.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>While this stack serves well for most, it is a very centralized solution. Your frontend will be at the mercy of Vercel, who use AWS behind the scenes. Not very web3.</p><p>To be fair, most people don&apos;t need a decentralized frontend setup. But in some cases, it is an absolute necessity. For example, a decentralized exchange like <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://uniswap.org">Uniswap</a> should never <em>solely</em> rely on a centralized provider. (not saying Uniswap uses Vercel, just an example. I have no idea what they use lol)</p><p>It makes sense to use a centralized provider as the primary option for speed &amp; scale, but it is vital to have a backup that is <em>permanent</em> and <em>decentralized</em> to fight censorship. So if Vercel doesn&apos;t <em>like</em> Uniswap anymore, it doesn&apos;t mean Uniswap becomes inaccessible via the web right away. The idea here is to have a decentralized deployment ready, at least as a fallback.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/fb3f96985c8f655dfda36a101e23a8aae7778c46ff46ddb672a7af9624ef321b.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://arweave.org">Arweave</a> lets you permanently deploy webpages to a decentralized network. This is why we will be going through the process of setting up a React app for deployment to Arweave in this article.</p><h2 id="h-what-we-will-be-building" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What we will be building</h2><p>We will be building a very simple React app that lets people connect their wallets, and deploy it to Arweave.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ad4669467b42175b833eec3f971bd78ffcdec4eb5d8422701fe81a215c7d1cb7.gif" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>You can also visit the live deployed page and try it out yourself: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://arweave.net/wI-CGD-uca4Dx_KNODXPg1ypjd5acWQ0ZM4UHZRh99Q">https://arweave.net/wI-CGD-uca4Dx_KNODXPg1ypjd5acWQ0ZM4UHZRh99Q</a></p><h2 id="h-tech-stack" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Tech stack</h2><p>We will be using <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vitejs.dev/">Vite</a> instead of Next.js for this project, for several reasons:</p><ol><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=KCrXgy8qtjM">Vite is FAST</a> ⚡️ (follow along and you&apos;ll find out)</p></li><li><p>Next.js is basically a server that serves webpages. On the other hand, Vite runs fully on the client-side i.e. in the browser. For a frontend to be <em>really</em> decentralized, it should ideally be running fully on the client. We are going for an extreme here, but why not?</p></li><li><p>It is super-easy to generate a fully static site using Vite. Using Next.js, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nextjs.org/docs/advanced-features/static-html-export">it&apos;s a bit of a pain in the ass</a>.</p></li></ol><p>Apart from that, we will be using <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.rainbowkit.com/">Rainbowkit 🌈</a> to setup our connect wallet functionality.</p><p>Make sure you have <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nodejs.org/en/">Node.js</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://yarnpkg.com/">Yarn</a> installed.</p><h2 id="h-project-setup" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Project setup</h2><p>Let&apos;s start off by setting up some boilerplate using Vite&apos;s handy CLI tool. In your terminal, run the following command:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0cfc0a4cecb68f9fd4b9e28ff08790a6651d404f9e477eacedee3c7b603cccea.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Select the options just like in the screenshot above and hit Enter. The next thing we want to do is <code>cd</code> into our newly-created project&apos;s directory and install our dependencies. We will also initialize an empty local git repo in the folder while we&apos;re at it.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/13d7c86c8b73c2d66e9ea9b6af86db99c29097c1f5d2a939c10e1141c3efc2bd.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Awesome! Let&apos;s now try running our app by running <code>yarn dev</code>. Your app will be live on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://localhost:3000">http://localhost:3000</a>. It should look like this:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bb7e5bfc3ae12ef9b36dff31068a2802a8f8006b02099a59375f5980cd5aa09d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>You see how fast that was? 😄 Vite means speed.</p><h2 id="h-building-out-the-ui" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Building out the UI</h2><p>Let&apos;s add a connect wallet button to our app now. We will need to install some dependencies for that:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c013202af88e0479ef0fcd00e126233a3e403900f45a15939a895f0740d2dd1d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Once that&apos;s done, let&apos;s setup Rainbowkit in our code. I&apos;m just following the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.rainbowkit.com/docs/installation">Rainbowkit installation docs</a> here, nothing fancy!</p><p>Make sure your <code>main.jsx</code> looks like this:</p><pre data-type="codeBlock" text="import React from &apos;react&apos;;
import ReactDOM from &apos;react-dom/client&apos;;
import App from &apos;./App&apos;;
import &apos;./index.css&apos;;

import &apos;@rainbow-me/rainbowkit/styles.css&apos;;
import { getDefaultWallets, RainbowKitProvider } from &apos;@rainbow-me/rainbowkit&apos;;
import { chain, configureChains, createClient, WagmiConfig } from &apos;wagmi&apos;;
import { jsonRpcProvider } from &apos;wagmi/providers/jsonRpc&apos;;
import { publicProvider } from &apos;wagmi/providers/public&apos;;

const { chains, provider } = configureChains(
  [chain.mainnet],
  [
    jsonRpcProvider({
      rpc: () =&gt; {
        return {
          http: &apos;https://rpc.ankr.com/eth&apos;,
        };
      },
    }),
    publicProvider(),
  ]
);

const { connectors } = getDefaultWallets({
  appName: &apos;My RainbowKit App&apos;,
  chains,
});

const wagmiClient = createClient({
  autoConnect: true,
  connectors,
  provider,
});

ReactDOM.createRoot(document.getElementById(&apos;root&apos;)).render(
  &lt;React.StrictMode&gt;
    &lt;WagmiConfig client={wagmiClient}&gt;
      &lt;RainbowKitProvider chains={chains}&gt;
        &lt;App /&gt;
      &lt;/RainbowKitProvider&gt;
    &lt;/WagmiConfig&gt;
  &lt;/React.StrictMode&gt;
);
"><code><span class="hljs-keyword">import</span> <span class="hljs-title">React</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'react'</span>;
<span class="hljs-keyword">import</span> <span class="hljs-title">ReactDOM</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'react-dom/client'</span>;
<span class="hljs-keyword">import</span> <span class="hljs-title">App</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'./App'</span>;
<span class="hljs-keyword">import</span> <span class="hljs-string">'./index.css'</span>;

<span class="hljs-keyword">import</span> <span class="hljs-string">'@rainbow-me/rainbowkit/styles.css'</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">getDefaultWallets</span>, <span class="hljs-title">RainbowKitProvider</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'@rainbow-me/rainbowkit'</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">chain</span>, <span class="hljs-title">configureChains</span>, <span class="hljs-title">createClient</span>, <span class="hljs-title">WagmiConfig</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'wagmi'</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">jsonRpcProvider</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'wagmi/providers/jsonRpc'</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-title">publicProvider</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'wagmi/providers/public'</span>;

const { chains, provider } <span class="hljs-operator">=</span> configureChains(
  [chain.mainnet],
  [
    jsonRpcProvider({
      rpc: () <span class="hljs-operator">=</span><span class="hljs-operator">></span> {
        <span class="hljs-keyword">return</span> {
          http: <span class="hljs-string">'https://rpc.ankr.com/eth'</span>,
        };
      },
    }),
    publicProvider(),
  ]
);

const { connectors } <span class="hljs-operator">=</span> getDefaultWallets({
  appName: <span class="hljs-string">'My RainbowKit App'</span>,
  chains,
});

const wagmiClient <span class="hljs-operator">=</span> createClient({
  autoConnect: <span class="hljs-literal">true</span>,
  connectors,
  provider,
});

ReactDOM.createRoot(document.getElementById(<span class="hljs-string">'root'</span>)).render(
  <span class="hljs-operator">&#x3C;</span>React.StrictMode>
    <span class="hljs-operator">&#x3C;</span>WagmiConfig client<span class="hljs-operator">=</span>{wagmiClient}<span class="hljs-operator">></span>
      <span class="hljs-operator">&#x3C;</span>RainbowKitProvider chains<span class="hljs-operator">=</span>{chains}<span class="hljs-operator">></span>
        <span class="hljs-operator">&#x3C;</span>App <span class="hljs-operator">/</span><span class="hljs-operator">></span>
      <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span>RainbowKitProvider<span class="hljs-operator">></span>
    <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span>WagmiConfig<span class="hljs-operator">></span>
  <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span>React.StrictMode>
);
</code></pre><p>And your <code>App.jsx</code> like this:</p><pre data-type="codeBlock" text="import { ConnectButton } from &apos;@rainbow-me/rainbowkit&apos;;

function App() {
  return (
    &lt;div&gt;
      &lt;div
        style={{ display: &apos;flex&apos;, justifyContent: &apos;center&apos;, marginTop: &apos;20px&apos; }}
      &gt;
        &lt;ConnectButton /&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  );
}

export default App;
"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">ConnectButton</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'@rainbow-me/rainbowkit'</span>;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    <span class="hljs-operator">&#x3C;</span>div<span class="hljs-operator">></span>
      <span class="hljs-operator">&#x3C;</span>div
        style<span class="hljs-operator">=</span>{{ display: <span class="hljs-string">'flex'</span>, justifyContent: <span class="hljs-string">'center'</span>, marginTop: <span class="hljs-string">'20px'</span> }}
      <span class="hljs-operator">></span>
        <span class="hljs-operator">&#x3C;</span>ConnectButton <span class="hljs-operator">/</span><span class="hljs-operator">></span>
      <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">></span>
    <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">></span>
  );
}

export default App;
</code></pre><p>Your app should now look like this:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7f45f4316ea6dd5782e3733ad0267b179603ef951fc762c536c598880eedb737.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Try clicking that button and connecting your wallet. It should work perfectly fine. Rainbowkit is great! 🌈❤️</p><p>That&apos;s all I&apos;m going to do for the UI but feel free to get create and add whatever you want! I am moving on to the deployment setup now.</p><h2 id="h-prep-for-deployment-to-arweave" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Prep for deployment to Arweave</h2><p>To make sure our Vite app gets built and deployed to Arweave correctly, we need to make small adjustments to two files.</p><ol><li><p>File: <code>vite.config.js</code></p></li></ol><pre data-type="codeBlock" text="import { defineConfig } from &apos;vite&apos;;
import react from &apos;@vitejs/plugin-react&apos;;

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
++  base: &apos;&apos;,
});
"><code><span class="hljs-keyword">import</span> { defineConfig } <span class="hljs-keyword">from</span> <span class="hljs-string">'vite'</span>;
<span class="hljs-keyword">import</span> react <span class="hljs-keyword">from</span> <span class="hljs-string">'@vitejs/plugin-react'</span>;

<span class="hljs-comment">// https://vitejs.dev/config/</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-title function_">defineConfig</span>({
  <span class="hljs-attr">plugins</span>: [<span class="hljs-title function_">react</span>()],
++  <span class="hljs-attr">base</span>: <span class="hljs-string">''</span>,
});
</code></pre><ol><li><p>File: <code>package.json</code></p></li></ol><pre data-type="codeBlock" text="{
  &quot;name&quot;: &quot;vite-arweave&quot;,
  &quot;private&quot;: true,
  &quot;version&quot;: &quot;0.0.0&quot;,
  &quot;scripts&quot;: {
    &quot;dev&quot;: &quot;vite&quot;,
    &quot;build&quot;: &quot;vite build&quot;,
    &quot;preview&quot;: &quot;vite preview&quot;,
++  &quot;deploy&quot;: &quot;yarn build &amp;&amp; arweave deploy-dir dist --key-file wallet.json&quot;
  },
  &quot;dependencies&quot;: {
    &quot;react&quot;: &quot;^18.0.0&quot;,
    &quot;react-dom&quot;: &quot;^18.0.0&quot;,
  },
  &quot;devDependencies&quot;: {
    &quot;@types/react&quot;: &quot;^18.0.0&quot;,
    &quot;@types/react-dom&quot;: &quot;^18.0.0&quot;,
    &quot;@vitejs/plugin-react&quot;: &quot;^1.3.0&quot;,
    &quot;vite&quot;: &quot;^2.9.9&quot;
  },
++  &quot;homepage&quot;: &quot;./&quot;
}
"><code>{
  <span class="hljs-string">"name"</span>: <span class="hljs-string">"vite-arweave"</span>,
  <span class="hljs-string">"private"</span>: <span class="hljs-literal">true</span>,
  <span class="hljs-string">"version"</span>: <span class="hljs-string">"0.0.0"</span>,
  <span class="hljs-string">"scripts"</span>: {
    <span class="hljs-string">"dev"</span>: <span class="hljs-string">"vite"</span>,
    <span class="hljs-string">"build"</span>: <span class="hljs-string">"vite build"</span>,
    <span class="hljs-string">"preview"</span>: <span class="hljs-string">"vite preview"</span>,
<span class="hljs-operator">+</span><span class="hljs-operator">+</span>  <span class="hljs-string">"deploy"</span>: <span class="hljs-string">"yarn build &#x26;&#x26; arweave deploy-dir dist --key-file wallet.json"</span>
  },
  <span class="hljs-string">"dependencies"</span>: {
    <span class="hljs-string">"react"</span>: <span class="hljs-string">"^18.0.0"</span>,
    <span class="hljs-string">"react-dom"</span>: <span class="hljs-string">"^18.0.0"</span>,
  },
  <span class="hljs-string">"devDependencies"</span>: {
    <span class="hljs-string">"@types/react"</span>: <span class="hljs-string">"^18.0.0"</span>,
    <span class="hljs-string">"@types/react-dom"</span>: <span class="hljs-string">"^18.0.0"</span>,
    <span class="hljs-string">"@vitejs/plugin-react"</span>: <span class="hljs-string">"^1.3.0"</span>,
    <span class="hljs-string">"vite"</span>: <span class="hljs-string">"^2.9.9"</span>
  },
<span class="hljs-operator">+</span><span class="hljs-operator">+</span>  <span class="hljs-string">"homepage"</span>: <span class="hljs-string">"./"</span>
}
</code></pre><p>The <code>base</code> and <code>homepage</code> options make sure that our app gets built and loaded on Arweave correctly.</p><p>We also added a <code>deploy</code> script that we will run when we want to deploy our app to Arweave.</p><p>The next step is to create an Arweave account if you don&apos;t have one already and grab some test funds from the faucet. Go to this link: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://faucet.arweave.net/">https://faucet.arweave.net/</a> and follow the instructions.</p><p><strong>IMPORTANT</strong>: Don&apos;t forget to download your wallet during the step I&apos;ve shown in the screenshot below and keep that file handy. You will need this later on.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4e5450581ed68bc86af870226e60cbf67eaba3cc2417169afdda0f7a50dd76b2.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>After following all the instructions on the faucet page, install the <code>arweave-deploy</code> CLI. We will make use of this tool to deploy our app. Run the following command to install it:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c25a5056b34aef80d9e63f71b7f42eddbacc78d4979b0a75af23591085d4f0f6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Quickly verify if the installation was successful or not by running this:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/19b326497e045ed501be1f07d926eec7885f59c6370d6786d48e83d60cb7a692.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>If all looks good, create a new file called <code>wallet.json</code> at the root of your project. Copy and paste the contents of the wallet file you downloaded from the faucet into this file.</p><p>The <code>wallet.json</code> file contains the seed phrase/private key for your Arweave wallet so let&apos;s make sure it does not get committed to Git. Add this line to the bottom of your <code>.gitignore</code> file:</p><pre data-type="codeBlock" text="wallet.json
"><code>wallet.json
</code></pre><p>Now we&apos;re all set. It is time to yeet our app straight to the Arweave network! 🚀</p><h2 id="h-arweave-deployment" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Arweave deployment</h2><p>All you need to do now is to run <code>yarn deploy</code> at the root of your project:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b84fbc6ad1147965fc6fcf14a1c52174a35f8df203bf4d0d041e8bec7341e889.gif" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Remember to type in <code>CONFIRM</code> when prompted! Now all you have to do is sit back and wait for your files to get uploaded to Arweave!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/576e2b97c38ecb2329ec5790ba1f40cdfb54949daf5d97c6a98bdcfa5108e866.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>You will see a message similar to that if the deployment was successful. Let&apos;s check out what our app looks like. Click on that URL!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/832be386c99e483a5acb0469832e016d3693ad4a25c9c10494757636a2e8b807.gif" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>LFGG! 🎉 YOU JUST PERMANENTLY DEPLOYED A REACT APP TO ARWEAVE! 🫡</p><p>Give yourself a pat on the back. This page will now live on Arweave <strong>FOREVER</strong>. No one can take this down. That right there is extremely powerful. 💪</p><p>You can find the final code in this repo for reference: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Dhaiwat10/vite-arweave">https://github.com/Dhaiwat10/vite-arweave</a></p><p>Don&apos;t forget to <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dhaiwat10">follow me on Twitter</a> or I&apos;ll be very sad :&apos;(</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ed2deab9a6709ba8bdb280fceb69fb4f413bf8b969b2651eabc4e9f54224dec1.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Thanks for reading and feel free to DM me if you need help! Ciao! :)</p>]]></content:encoded>
            <author>dhaiwat@newsletter.paragraph.com (Dhaiwat Pandya)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/13eba5373e4bf7df4d9428d3ce69ff1c14dbb9f36b1f37597a68c36d1038f179.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[How my DAO experience changed my life - leaving home for the first time with Developer DAO for EthDubai]]></title>
            <link>https://paragraph.com/@dhaiwat/how-my-dao-experience-changed-my-life-leaving-home-for-the-first-time-with-developer-dao-for-ethdubai</link>
            <guid>M1fyUnUCZCiWyvXanrZX</guid>
            <pubDate>Mon, 11 Apr 2022 23:41:18 GMT</pubDate>
            <description><![CDATA[In 2021, I was a 20-year-old kid studying at a shitty college and doing miserable random freelance gigs for pocket money. Traveling the world and exploring the mysteries it had to offer was something I had always dreamed of. But dreaming is where it had to stop. I come from a middle-class Indian family so I could never afford to travel abroad. In 2022, everything changed. I got a job because people saw me building some cool stuff with this new DAO I joined. I earned a scholarship to an Ethere...]]></description>
            <content:encoded><![CDATA[<p>In 2021, I was a 20-year-old kid studying at a shitty college and doing miserable random freelance gigs for pocket money. Traveling the world and exploring the mysteries it had to offer was something I had always dreamed of. But dreaming is where it had to stop. I come from a middle-class Indian family so I could never afford to travel abroad.</p><p>In 2022, everything changed. I got a job because people saw me building some cool stuff with this new DAO I joined. I earned a scholarship to an Ethereum conference in Dubai and left home for the first time in my life to meet my &apos;online&apos; friends. This trip turned out to be a life-changing experience.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/developer_dao">Developer DAO</a> made all of this happen for me. This is my story.</p><h3 id="h-getting-to-fly-to-ethdubai" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Getting to fly to EthDubai</h3><p>I joined D_D back in September. I was still fairly new to web3. Minting the D_D NFT was my first ever mainnet contract interaction - that says enough. D_D gave me a safe place to meet new friends who wanted to build open source software together. And that&apos;s exactly what we did.</p><p>I started working on a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/developer-DAO/web3-ui">React UI library for web3</a> with some friends at D_D and started tweeting about it. People loved this. This did lots of good for me, but also for D_D since this was one of our first &apos;projects&apos;. I made friends with many people in web3 because they liked my work.</p><p>This project also <em>literally</em> got me my current job. When I say this project changed my life, it&apos;s not an overstatement.</p><p>Meanwhile, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.ethdubaiconf.org/">EthDubai</a> announced a scholarship program. I applied. My application was backed only by my work with D_D. <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dabit3">Nader</a>, the founder of Developer DAO, was going to be speaking at the event and I already &apos;knew&apos; him by this time. He had seen the stuff I was building at D_D and was kind enough to support all of it whenever he could. Nader was in touch with the organizers of the event and he put in a good word for me when I told him that I had applied. This along with my work at D_D was enough for me to secure the scholarship.</p><p>I had no expectations when I applied. I thought, ‘this cannot be real’, but it was. I was flying overseas for the first time ever. You could bet I was the happiest guy on the planet.</p><h3 id="h-meeting-my-dd-friends-and-making-new-ones-in-dubai" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Meeting my D_D friends and making new ones in Dubai</h3><p>My time in Dubai was exciting and...chaotic - isn&apos;t that just what crypto conferences are anyways? D_D already had a gathering planned for lunch on the day I landed. On my very first day away from home in a foreign country, I was going to meet some of my friends that I had known only through Discord.</p><p>Six months ago none of us knew each other. During these six months, we shared lots of laughs, built some awesome stuff that we were insanely proud of, built some silly shit, and had gone through our fair share of tough times together.</p><p>We had built Developer DAO together from nothing. I was now going to meet these people IRL. I was extremely excited, but also nervous. Even though my English is honestly quite good, I was not at all used to being in an environment where everyone around me spoke this language. The way you greet people, the way you share stories, the way you make jokes - all of those little things were very different.</p><p>Learning how to socialize with people from different cultures was one of my biggest challenges and learnings in Dubai. It was new, it was exciting but it was also not all pretty. Sometimes it could get really difficult, but I knew I had to put myself through this at one point. As a result, I feel like I did come out of Dubai feeling much more confident about myself socially. The struggle was worth it in the end.</p><p>But hey! Let&apos;s get back to the fun part. I was meeting my friends from the DAO IRL and that was the best thing EVER! I cannot stress this enough. I was so happy to be finally able to share a beer with these amazing people that I had the pleasure to know. Some of us couldn&apos;t even recognize each other at first which was awkward at first but of course, we laughed about it later.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/cb4686cf0c404821883450e158c033e388c0caed1838054a1886b26ecd37a76c.jpg" alt="Meeting Nader - the founder of D_D " blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Meeting Nader - the founder of D_D</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a8fd9cd499cf8c60e37ca9620b4d2e558798af4088eebbeac39a88f1d421103d.jpg" alt="Meeting Austin - one of my &apos;web3 teachers&apos;" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Meeting Austin - one of my &apos;web3 teachers&apos;</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/649889bb892684921e4b0f9e2ce4a367df559d8bf4273f11658814aa14f8e6ed.jpg" alt="qedk, Kemp and Manny - my D_D frens" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">qedk, Kemp and Manny - my D_D frens</figcaption></figure><p>The other great thing about all of this was that I didn&apos;t only get to meet people from the DAO, but also people from other places. Many of these people already knew about the work I was doing at D_D from Twitter. I was quite literally blushing on multiple occasions!</p><p>Both at the D_D lunch and at other parties that I crashed in Dubai all week long - I made new friends. All of them had their own interesting stories to share and I am very glad I got the chance to get to know these people. You know who you are!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e93789310fda63c65cfb973f43a49d479f041a2069080264a5ba4372b62308d5.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Meeting people from different parts of the world, hearing their stories, seeing how they do things in life, and learning from them is something I genuinely got to love during my time in Dubai. I had always wanted to travel the world, but this gave me just one more reason to do it. I believe this realization will leave a lasting impact on my life.</p><p>Apart from the conference and the numerous parties, almost all of us from the D_D group saw Dubai together as well. Seeing some of the jawdropping architectural marvels of Dubai together with my &apos;online&apos; friends was quite weird, in a good way. I&apos;m <em>sure</em> I sound like a broken record at this point, but I couldn&apos;t believe this was real, that this was actually happening to me. I was <em>still</em> struggling to take all of this in.</p><p>Standing at the coast with the cold breeze at night with my DAO friends looking at the beautifully-lit Dubai skyline and talking about all things life is a memory I will never forget. I will always cherish moments like these from Dubai.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e96715d7e2373756c4462a44194311c97eb2141186a7763d2e0cce336ffdf462.jpg" alt="The Moonswap squad! qedk, Ryan, Miral, Nazeeh" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">The Moonswap squad! qedk, Ryan, Miral, Nazeeh</figcaption></figure><p>I returned from Dubai with new friends, new learnings, and full of life. My DAO made all of this happen for me. My DAO changed my life for the good.</p><p>I&apos;m grateful. Here’s to Developer DAO. Here’s to changing lives!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8dd9ff0b97d4b61929f7ca3e51a8b3f7b5a928d856799acae8a29b1aa78160b5.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure>]]></content:encoded>
            <author>dhaiwat@newsletter.paragraph.com (Dhaiwat Pandya)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/8726027196065fd5ed6a8eabed69aceb24def22bf507016fb0570fe1923e8903.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[A guide to Web3 for Web2 frontend devs]]></title>
            <link>https://paragraph.com/@dhaiwat/a-guide-to-web3-for-web2-frontend-devs</link>
            <guid>ntfwP7pjlnOhJwAip65W</guid>
            <pubDate>Sun, 30 Jan 2022 13:10:08 GMT</pubDate>
            <description><![CDATA[With all the hype around, web3 can be overwhelming if you’re looking to get started. Luckily if you are a frontend dev coming from web2, you already have most of the skills you need to get started in web3. I can say this because I come from a web2 frontend background myself and I made the move to web3 last year. I now work full-time in web3. In this post, I’ll try to give you an overview of the web3 space so that you can make a decision on whether you want to switch to web3 and how you can do...]]></description>
            <content:encoded><![CDATA[<p>With all the hype around, web3 can be overwhelming if you’re looking to get started. Luckily if you are a frontend dev coming from web2, you already have most of the skills you need to get started in web3. I can say this because I come from a web2 frontend background myself and I made the move to web3 last year. I now work full-time in web3.</p><p>In this post, I’ll try to give you an overview of the web3 space so that you can make a decision on whether you want to switch to web3 and how you can do it.</p><h2 id="h-what-stays-the-same" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What stays the same</h2><p>The one thing that stays the same between web2 and web3 apps is that all of them are just websites (or mobile apps) to begin with. So if you know how to build UIs with React, you can build UIs for both web2 and web3 apps. Nothing changes. You’re just manipulating the DOM after all. The difference lies in how web2 and web3 apps handle data and authentication. Let’s talk about that next.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/69106c8a12721ddec3aff989560153f4cacba1d48b8e0f07a7ae71d6c306bdba.jpg" alt="It really is that simple" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">It really is that simple</figcaption></figure><h2 id="h-whats-different" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">What’s different</h2><p>There is a big paradigm shift in how web2 and web3 apps handle data and authentication.</p><p>Instead of managing passwords and access tokens, you will be dealing with wallet connections and signed messages in the web3 world. Your wallet is a store of identity and value owned by <em>you</em> that you use across <em>all</em> dapps.</p><p>Instead of making network requests to a centralized API server somewhere, you will be reading data from the blockchain directly, usually from smart contracts. As a web3 frontend engineer, you will be interacting with smart contracts on a daily basis. Make sure you have a solid understanding of what&apos;s a smart contract, how it works, what&apos;s a smart contract&apos;s ABI, etc.</p><p>Data mutation in web3, on the other hand, is exceptionally different from web2. Each time you mutate a smart contract’s data, you pay a fee (infamously known as gas). So you need to be extra careful with your smart contract calls in your frontend code. You need to ensure that you interact with the correct smart contract and send the valid data in the correct format. Smart contracts and anything on the blockchain is immutable in nature. Once it&apos;s there, it&apos;s there. If you want to change it, it usually costs money, and sometimes it&apos;s impossible - depending on the nature of the smart contract you&apos;re interacting with.</p><p>Data mutation in web3 also takes much longer than web2. POST requests in web2 usually take a few hundred milliseconds. Data mutation in web3, or smart contract calls/transactions, can take anywhere between a few minutes and forever.</p><p>This is because the nodes on the blockchain network have to add each transaction to a new block on the chain. The delay between submitting the transaction and it getting added to the chain depends on the gas fee (i.e., the cost) your user is willing to pay for it. Because of this uncertain nature of data mutation, you need to make sure that you get your loading and error states right.</p><p>You’ll also be dealing with different networks. You want to ensure that your users and the smart contracts they’re interacting with are on the same network.</p><p>If all of the stuff I mentioned above seems overwhelming, please don’t worry. Some great open-source libraries abstract out all of this for you. My favorites are wagmi and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/scaffold-eth/eth-hooks">eth-hooks</a>. (Also plugging <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/developer-DAO/web3-ui">web3-ui</a>, the library that I am working on!)</p><h2 id="h-code-comparison" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Code comparison</h2><p>Let’s make some direct code comparisons between similar scenarios in web2 and web3.</p><h3 id="h-1-authentication" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1. Authentication</h3><p>Compared to the traditional auth via cookies approach in web2, in web3 you will usually ask the user to connect their wallet to the site. While the code for wallet connections can be a bit boilerplate-y and tricky, there are many libraries that provide high-level abstractions.</p><pre data-type="codeBlock" text="// web2
const res = await axios.post(&apos;https://some-api.com/auth&apos;, payload);
// then use cookies

// web3
import { useWallet } from &apos;@web3-ui/core&apos;;

function App() {
  const { connectWallet, connection, connected } = useWallet();
  
  if (!connected) {
    return (
      &lt;button onClick={connectWallet}&gt;Connect wallet&lt;/button&gt;
    )
  }
  
  return (
    &lt;p&gt;{connection.userAddress}&lt;/p&gt;  
  )
}
"><code><span class="hljs-comment">// web2</span>
const res <span class="hljs-operator">=</span> await axios.post(<span class="hljs-string">'https://some-api.com/auth'</span>, payload);
<span class="hljs-comment">// then use cookies</span>

<span class="hljs-comment">// web3</span>
<span class="hljs-keyword">import</span> { <span class="hljs-title">useWallet</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'@web3-ui/core'</span>;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  const { connectWallet, connection, connected } <span class="hljs-operator">=</span> useWallet();
  
  <span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>connected) {
    <span class="hljs-keyword">return</span> (
      <span class="hljs-operator">&#x3C;</span>button onClick<span class="hljs-operator">=</span>{connectWallet}<span class="hljs-operator">></span>Connect wallet<span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span>button<span class="hljs-operator">></span>
    )
  }
  
  <span class="hljs-keyword">return</span> (
    <span class="hljs-operator">&#x3C;</span>p<span class="hljs-operator">></span>{connection.userAddress}<span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span>p<span class="hljs-operator">></span>  
  )
}
</code></pre><h3 id="h-2-reading-data" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2. Reading data</h3><p>You must be familiar with using <code>fetch</code> or <code>axios</code> to make requests to APIs to read data. In web3, you will first create an instance of a smart contract using the contract&apos;s address and its ABI. <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.ethers.io/v5/">ethers</a> is one of the most popular libraries that let you interact with the blockchain.</p><p>One thing you should keep in mind as a frontend engineer is that when you try to read a number from a smart contract (eg. a balance), the type of the value you get will be <code>BigNumber</code> and not <code>number</code>. This means that you will have to convert the returned data into a <code>string</code> or a <code>number</code> using methods like <code>toString()</code>.</p><pre data-type="codeBlock" text="// web2
const res = await axios.get(&apos;https://some-api.com&apos;);

// web3
const contract = new ethers.Contract(&apos;contract_address&apos;, ABI, provider); // create instance
const res = await contract.balanceOf(&apos;some_address&apos;); // read from the contract
console.log(res.toString()); // convert from BigNumber to string
"><code><span class="hljs-comment">// web2</span>
const res <span class="hljs-operator">=</span> await axios.get(<span class="hljs-string">'https://some-api.com'</span>);

<span class="hljs-comment">// web3</span>
const <span class="hljs-class"><span class="hljs-keyword">contract</span> = <span class="hljs-title"><span class="hljs-keyword">new</span></span> <span class="hljs-title">ethers</span>.<span class="hljs-title">Contract</span>(<span class="hljs-params"><span class="hljs-string">'contract_address'</span>, ABI, provider</span>); <span class="hljs-comment">// create instance</span>
<span class="hljs-title">const</span> <span class="hljs-title">res</span> = <span class="hljs-title">await</span> <span class="hljs-title"><span class="hljs-keyword">contract</span></span>.<span class="hljs-title">balanceOf</span>(<span class="hljs-params"><span class="hljs-string">'some_address'</span></span>); <span class="hljs-comment">// read from the contract</span>
<span class="hljs-title">console</span>.<span class="hljs-title">log</span>(<span class="hljs-params">res.toString(<span class="hljs-params"></span>)</span>); <span class="hljs-comment">// convert from BigNumber to string</span>
</span></code></pre><h3 id="h-3-writing-data" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3. Writing data</h3><p>Both reading and writing data in web3 is done via calling a function on a smart contract. As you can see, the syntax for writing to a smart contract is no different than reading from it. There are two caveats though:</p><ul><li><p>To write to a smart contract, you need a <em>signer</em>. A provider isn&apos;t enough.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.ethers.io/v5/api/signer/">https://docs.ethers.io/v5/api/signer/</a></p></li><li><p>You need to call the <code>wait()</code> method on the returned promise in order to wait for the transaction to be mined/confirmed. The <code>wait()</code> method also returns a promise which resolves once the transaction has been mined.</p></li></ul><pre data-type="codeBlock" text="// web2
const res = await axios.post(&apos;https://some-api.com/&apos;, { name: &apos;John Doe&apos; });

// web3
const contract = new ethers.Contract(&apos;contract_address&apos;, ABI, signer); // create instance
const res = await contract.setGreeting(&apos;Hi!&apos;);
await res.wait(); // wait for the transaction to be &apos;mined&apos;
"><code><span class="hljs-comment">// web2</span>
const res <span class="hljs-operator">=</span> await axios.post(<span class="hljs-string">'https://some-api.com/'</span>, { name: <span class="hljs-string">'John Doe'</span> });

<span class="hljs-comment">// web3</span>
const <span class="hljs-class"><span class="hljs-keyword">contract</span> = <span class="hljs-title"><span class="hljs-keyword">new</span></span> <span class="hljs-title">ethers</span>.<span class="hljs-title">Contract</span>(<span class="hljs-params"><span class="hljs-string">'contract_address'</span>, ABI, signer</span>); <span class="hljs-comment">// create instance</span>
<span class="hljs-title">const</span> <span class="hljs-title">res</span> = <span class="hljs-title">await</span> <span class="hljs-title"><span class="hljs-keyword">contract</span></span>.<span class="hljs-title">setGreeting</span>(<span class="hljs-params"><span class="hljs-string">'Hi!'</span></span>);
<span class="hljs-title">await</span> <span class="hljs-title">res</span>.<span class="hljs-title">wait</span>(<span class="hljs-params"></span>); <span class="hljs-comment">// wait for the transaction to be 'mined'</span>
</span></code></pre><h2 id="h-rough-roadmap" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Rough roadmap</h2><p>If you want to get started in web3 as a frontend dev, this is a rough roadmap that you can use as a reference. This roadmap is inspired by both my personal experiences and what I&apos;ve seen others do.</p><ul><li><p>Learn about blockchain and Ethereum fundamentals (just the <em>very</em> basic stuff)</p></li><li><p>Learn about smart contracts</p></li><li><p>Learn about wallets and wallet connections in web3 (<code>provider</code>, <code>signer</code>, different wallet providers)</p></li></ul><p>This playlist will give you a solid understanding of the above three items:</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/playlist?list=PLJz1HruEnenCXH7KW7wBCEBnBLOVkiqIi">https://www.youtube.com/playlist?list=PLJz1HruEnenCXH7KW7wBCEBnBLOVkiqIi</a></p><ul><li><p>Create a frontend that simply lets you connect your wallet and shows the connected wallet&apos;s address (I have listed more resources at the end of the post)</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://wagmi-xyz.vercel.app/guides/connect-wallet">https://wagmi-xyz.vercel.app/guides/connect-wallet</a></p></li><li><p>Create a frontend that interacts with a smart contract on a testnet (you can start by interacting with a simple <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://rinkeby.etherscan.io/address/0xAa3906F986E0cd86e64C1e30cE500C1de1EF46Ad">Greeter contract</a>)</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://wagmi-xyz.vercel.app/docs/hooks/useContractRead">https://wagmi-xyz.vercel.app/docs/hooks/useContractRead</a></p></li></ul><p>You will now have all the basics you need to call yourself a web3 frontend engineer. Some extras that could be useful to learn too:</p><ul><li><p>ERC20 and ERC721 token issuance flows (approvals, transfer, mint, etc)</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum.org/en/developers/docs/standards/tokens/erc-20/">https://ethereum.org/en/developers/docs/standards/tokens/erc-20/</a></p></li><li><p>Sign-in with Ethereum</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://login.xyz/">https://login.xyz/</a></p></li></ul><h2 id="h-useful-links" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Useful links</h2><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/scaffold-eth/scaffold-eth">scaffold-eth</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/kay-is/web3-from-zero">web3-from-zero</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://speedrunethereum.com">Speed Run Ethereum</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=a0osIaAOFSE">The Complete Guide to Full Stack Ethereum Development</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/developer_dao">Developer DAO</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/developer-dao/resources">Developer DAO resources</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://solidity-by-example.org/">Solidity by example</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://gitcoin.co">Gitcoin</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/developer-DAO/web3-ui">web3-ui</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://wagmi-xyz.vercel.app/">wagmi</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/scaffold-eth/eth-hooks">eth-hooks</a></p></li></ul><p>Feel free to reach out to me on <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dhaiwat10">Twitter</a> if you have any queries. More than happy to help!</p>]]></content:encoded>
            <author>dhaiwat@newsletter.paragraph.com (Dhaiwat Pandya)</author>
        </item>
    </channel>
</rss>