Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nitaliano/ponder-op-test
Test Repo For Indexing OPs NFT
https://github.com/nitaliano/ponder-op-test
Last synced: about 1 month ago
JSON representation
Test Repo For Indexing OPs NFT
- Host: GitHub
- URL: https://github.com/nitaliano/ponder-op-test
- Owner: nitaliano
- Created: 2023-07-21T11:51:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-21T12:55:22.000Z (over 1 year ago)
- Last Synced: 2024-04-10T13:29:56.500Z (9 months ago)
- Language: TypeScript
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ponder OP Test
This is just a test repo to index Optimisms NFTs and mess around with the GraphQL API
Contract: https://optimistic.etherscan.io/address/0x2335022c740d17c2837f9c884bfe4ffdbf0a95d5
## Setup
1. Create a new file in the root of the project called `.env.local`
2. Add a variable into file called `JSON_RPC_URL` it should point to a web3 rpc provider like Alchemy
3. Run `pnpm install`
4. Install `docker` we are running postgres with it using `docker-compose`## Develop
1. Run `docker-compose up -d` this will start postgres
2. Once you're setup run `pnpm run dev` to start the dev server and start indexing the event logs
2. After everything has been index head to `http://localhost:42069` to query the data using GraphQL## Example Queries
### Get all OP NFT Owners
This will return all NFTs owners by address
```
{
tokens {
owner {
id
}
}
}
```### NFTs owned by Account
Will return a list of token id's that are owned by the account
```
{
account(id: "0x001A2033a7A1e88d8cD15f60B2fcb45d255f5C93") {
tokens {
id
}
}
}
```