Subgraphs for Nation3 smart contracts
This subgraph tracks the following events from the Nation3 PassportIssuer
contract:
-
event Attest(address indexed _to, uint256 indexed _tokenId);
Tracks Passport issuance. Initiated by
claim(uint8, bytes32, bytes32)
-
event Revoke(address indexed _to, uint256 indexed _tokenId);
Tracks Passport revocations. Initiated by
revoke(address)
. -
event UpdateRequirements(uint256 claimRequiredBalance, uint256 revokeUnderBalance);
Tracks changes to Passport issuance params. Initiated by
setParams(uint256, uin256)
See https://github.com/nation3/agreements-contracts/tree/main/packages/subgraph
Refer to the latest deployment's query URL on the following N3 subgraph pages:
- Mainnet: https://thegraph.com/hosted-service/subgraph/nation3/nation3-agreements-mainnet
- Sepolia: https://thegraph.com/hosted-service/subgraph/nation3/nation3-agreements-sepolia
Refer to the following guide from The Graph's docs on how to execute a query remotely.
Refer to this document from The Graph's docs on how to set up your development environment for making changes to, and deploying new, subgraphs.
Two options are available for testing:
To test your changes to the subgraph locally you will need a local IPFS Gateway for the subgraph to deploy files to.
Refer to this guide to learn how to do so and ensure your gateway points to http://localhost:5001
.
Then run the following commands in the subgraph's directory (e.g. the PassportIssuer subgraph directory):
npm run codegen
npm run build
npm run create-local
npm run deploy-local
Simply run the following command to run the available tests in their respective subgraph directories (e.g. PassportIssuer):
npm run test