This repo contains a basic indexer for CONCEALMINT using ponder.sh and Pinata. Using the Transfer
and MetadataUpdate
events on the contract it will record basic information of the NFTs, who their owners are, and build optimized image links using Pinata IPFS Gateways and CDN.
Clone the repo and install dependencies (would recommend pnpm
)
git clone https://github.com/PinataCloud/concealmint-indexer
cd concealmint-indexer
pnpm install
Rename the .env.example
file to .env.local
and fill in the values
PONDER_RPC_URL_84532= # RPC URL, the 84532 is for Base Sepolia so be sure to update it to your chain id
CONTRACT_ADDRESS= # The deployed contract address
PINATA_JWT= # Your Pinata JWT API Key
GATEWAY_URL= # Your Pinata IPFS Gateway URL
API_KEY= # Optional API key you can generate to help secure your API routes, i.e. `openssl rand -hex 64`
If you are using your own contract you will need to make sure you have the correct chain ID in the PONDER_RPC_URL_
variable as seen above where we use the Base Sepolia chain ID.
Inside the ponder.config.ts
you will need to update the startBlock
to match your contract start block. Also be sure to update the network information if your chain is different.
import { createConfig } from "ponder";
import { http } from "viem";
import { ConcealmintAbi } from "./abis/ConcealmintAbi";
export default createConfig({
networks: {
// Update chain info if necessary
baseSepolia: {
chainId: 84532,
transport: http(process.env.PONDER_RPC_URL_84532),
pollingInterval: 2_000,
maxRequestsPerSecond: 100,
},
},
contracts: {
Concealmint: {
abi: ConcealmintAbi,
address: process.env.CONTRACT_ADDRESS as `0x`,
network: "baseSepolia",
startBlock: 19169268, // Update this
},
},
});
Start up the dev server and let it index events from the contract
pnpm dev