name | slug | description | framework | useCase | css | deployUrl | demoUrl |
---|---|---|---|---|---|---|---|
Web3 Data Fetching |
web3-data-fetching |
Smart contracts contain relevant information to applications built on top of blockchains that can run the Ethereum Virtual Machine. Some of the information in these contracts can be exposed in the form of View functions that do not need gas or fees to be executed. Now we will explore how to get that information in Next.js. |
Next.js |
Documentation |
Tailwind |
This example shows how to fetch data from the blockchain in Next.js
https://web3-data-fetching.vercel.app/
This demo will show how to do the following:
- Instanciate a connection to a smart contract
- Retreive smart contract information serverside
- Retreive smart contract information with SWR for revalidation
You can choose from one of the following two methods to use this repository:
Deploy the example using Vercel:
Execute create-next-app
with pnpm to bootstrap the example:
pnpm create next-app --example https://github.com/vercel/examples/tree/main/solutions/web3-data-fetching
Next, run Next.js in development mode:
pnpm dev
Deploy it to the cloud with Vercel (Documentation).