Skip to content

chidubesteve/nft-marketpace-subgraph

Repository files navigation

TheGraph NFT Marketplace

Quickstart

  1. Install Subgraph CLI
npm install @graphprotocol/graph-cli
  1. Log into the graph UI and create a new Subgraph.

Use sepolia as the network.

  1. Initialize Subgraph
graph init --studio nft-marketplace
  1. Authenticate CLI
npx graph auth  --studio YOUR_DEPLOY_KEY_HERE
  1. Update your subgraph.yaml
  • Update the address with your NftMarketplace Address
  • Update the startBlock with the block right before your contract was deployed
  1. Build graph locally
npx graph codegen && graph build
  • graph codegen: Generates code in the generated folder based on your schema.graphql
  • graph build: Generates the build that will be uploaded to the graph
  1. Deploy subgraph

Replace VERSION_NUMBER_HERE with a version number like 0.0.1.

npx graph deploy --studio nft-marketplace -l VERSION_NUMBER_HERE
  1. View your UI

Back in your hardhat project, mint and list an NFT with:

npx hardhat run scripts/mint-and-list-item.js --network sepolia

About

Thegraph indexer for a NFT Marketplace

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published