Skip to content

Latest commit

 

History

History
85 lines (72 loc) · 2.07 KB

File metadata and controls

85 lines (72 loc) · 2.07 KB

Verax - Subgraph

This subgraph aims to index the data generated by the smart contracts of Verax.

How to use it?

Our subgraph is deployable on all the networks where Verax is deployed.
You can replace XXX by the name of the networks you want to work on in the commands below:

  • linea-sepolia
  • linea
  • arbitrum-sepolia
  • arbitrum-one
  • base-sepolia
  • base
  • bsc-testnet
  • bsc

1. Generate code

pnpm run codegen:vY

2. Build the subgraph

pnpm run build:XXX:vY

3. Deploy the subgraph

pnpm run deploy:XXX:vY

Deployment of a new Verax instance

When the contracts of a new Verax instance are deployed, we need to start indexing the data generated by these contracts.

  1. Add the new network config in the networks.json file:
    "XXX": {
        "AttestationRegistry": {
            "address": "0x...",
            "startBlock": 123
        },
        "ModuleRegistry": {
            "address": "0x...",
            "startBlock": 123
        },
        "PortalRegistry": {
            "address": "0x...",
            "startBlock": 123
        },
        "SchemaRegistry": {
            "address": "0x...",
            "startBlock": 123
        }
    },
  2. Create a subgraph config file for the new network, based on the subgraph.linea-mainnet.yaml file, name subgraph.XXX.yaml.
  3. Add a "build" script in the package.json file to easily build it:
    "build:XXX:v2": "pnpm run codegen:v2 && graph build subgraph.XXX.yaml",
  4. Add a "deploy" script in the package.json file to easily deploy it
    "deploy:XXX:v2": "graph deploy --version-label v0.0.1 --studio XXX subgraph.XXX.yaml",
  5. Check that the subgraph compiles and builds correctly:
    pnpm run build:XXX:v2
  6. Create the subgraph XXX on The Graph Studio
  7. Authenticate to The Graph Studio:
    graph auth <ACCESS_TOKEN>
  8. Deploy the subgraph:
     pnpm run deploy:XXX:v2