Skip to content

nation3/subgraphs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌐 Subgraphs

Subgraphs for Nation3 smart contracts

Deployed Subgraphs

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)

⚖️ Agreements

See https://github.com/nation3/agreements-contracts/tree/main/packages/subgraph

Querying Subgraphs

Refer to the latest deployment's query URL on the following N3 subgraph pages:

🛂 PassportIssuer

⚖️ Agreements


Refer to the following guide from The Graph's docs on how to execute a query remotely.

Contributing

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.

Testing

Two options are available for testing:

  1. Local Graph deployment (integration testing)
  2. Matchstick unit tests

Local

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

Releases

No releases published

Packages

No packages published