Central CIC Stack Postgres store specifically for indexing:
- Transactional data from the chain
- Custodial user data (PII, custodial client data)
- Voucher data (backers, certifications, e.t.c.)
- VPAs (Virtual Payment Addresses)
- Marketplace data (proposed)
Relationships, check constraints and referential integrity are built in at the Postgres level. However, CIC Graph is meant to be complemented by secondary backend services to provide CRUD and any other important functionality around it.
Primarily Hasura is supported as a GraphQL proxy backend in front of it. Additionally, other 3rd party proxies such as Supabase and PostgREST are expected to work on top of the Postgres schema defined in
Hasura expects a metadata definition consistent with the underlying Postgres schema.
For ease of testing and development, a Docker image which bakes in the migrations and metadata files is provided (
dev folder also contains a docker-compose.yaml file to quickly get started.
Below is an example of how to add a table and sync the git repo with the changes.
- Bring up the containers in
docker-compose up -d.
- Start the Hasura Console with
hasura console --admin-secret "admin" --endpoint http://localhost:8080.
- In the
tern new $MIGRATION_NAMEand write the migration file.
- Run the migration with
tern migratein the
- Track the changes on the Hasura Console (Data tab)
hasura metadata export --admin-secret "admin" --endpoint http://localhost:8080to sync the metadata.
- Git commit.