This repository contains a registry of networks in The Graph ecosystem.
- add a network JSON in the
registry
directory. TODO: add detailed fields descriptions and best practices - [optional] validate with
bun validate
(see below for setup steps) - [optional] format with
bun format
- increment patch version in
package.json
- open a PR
schemas/
: Contains the schema for the registryregistry/
: Contains the networks JSONs (edit these)public
: Contains all generated registry versions (don't edit those)src/
: Contains scripts to validate networks JSONs and generate the resulting registry JSON
- install
bun
: https://bun.sh/ - install dependencies
bun install --no-save
- get your free Studio API key and set it in the
.env
file - we will need it to run a few queries to do some network validation
bun generate:types
- generate types from schema if schema has changed to use for validationbun validate:schema
- validate networks JSONs against the schemabun validate:networks
- additional semantic validation of networks JSONs, i.e. uniqueness, relations, urls, ethereum chain list, graph network, icons, etcbun generate:registry
- generate resulting registry JSON in./dist
bun validate:registry
- validate generated registry in./dist
against the schemabun format:check
- check format JSON and TS formatting prettierbun format
- format JSON and TS files with prettierbun all
- do it all
Registry schema has a MAJOR.MINOR semantic version, i.e. v1.2
When version needs to be incremented:
- MAJOR version: breaking schema change, i.e. field type change, new mandatory field, field removal
- MINOR version: backward compatible schema change, i.e. new optional field, new enum variant
Published registry has a MAJOR.MINOR.PATCH semantic version, i.e. v1.2.3
where MAJOR.MINOR corresponds to the schema version
When version needs to be incremented:
- MAJOR/MINOR version: when schema is updated change MAJOR and MINOR versions to reflect the schema
- PATCH version: new network added, existing network entry updated
Every PR merge triggers a GitHub action that generates new registry version, formats it, commits, publishes a release and deploys 4 registry JSON files with the identical contents are deployed in addition to existing ones. Assuming current version is v1.2.3, the following files with identical content are published: