Azuki NFT List is a React app built with Next.js that fetches and displays all NFTs from the Azuki collection using the Chainstack Subgraph.
Here you can find the info about the bounty. 🥇🥇 I won with this project. 🥇🥇
You can watch a video about how it works here.
Here all the steps that I did to create this project.
- Go to the Chainstack website: https://chainstack.com/
- Sign up for a new account or log in if you already have one.
- Once you are logged in, navigate to the Subgraph section.
- Create a Project and a Subgraph.
To do this I used the Online Documentation.
- Install the Graph CLI globally on your system:
npm install -g @graphprotocol/graph-cli
- Initialize your project with the Graph CLI inside the folder AZUKI:
graph init
-
Edit files
schema.graphql
andsubgraph.yaml
. -
Generate classes with the command:
graph codegen
-
Go to
src/azuki.ts
and update all code using the code inside the documentation. -
Compile the subgraph and make it ready to be deployed:
graph build
- Deploy with the command
Deployment command
that you find inside your Subgraph in your Chainstack Project:
graph deploy --node https://api.graph-eu.p2pify.com/YOUR_CODE/deploy --ipfs https://api.graph-eu.p2pify.com/YOUR_CODE/ipfs NAME_OF_YOUR_SUBGRAPH
- Now you have to wait the Subgraph update on the Chainstack website.
To do this I used the documentation on the Github project.
To fetch and interact with data from the Chainstack subgraph in your frontend app, you'll need to configure the @graphprotocol/client-cli
.
Open your terminal and inside the frontend directory run the following command to install the @graphprotocol/client-cli
package as a development dependency in your NextJS app:
npm install @graphprotocol/client-cli --save-dev
After that you have to update the file .graphclientrc.yml
inside the frontend directory with the endpoint that you can find inside your Subgraph project on Chainstack website.
And launch the command to create a runtime artifact:
npx graphclient build --fileType json
After all the configurations specified above, I created this simple page with all Azuki's NFTS where you can filter based on collection traits.