The main purpose of this script is to sync the database with the Contract's events. The Contract's events and mappings are the main source of truth; hence, all events overwrite the existing records in database
This App is generated using @nrwl/node:application
. Check all targets at project.json
yarn nx run contract-sync-job:serve
:To run the script, requiresprotocol-api:serve
to be running.yarn nx run contract-sync-job:build
: to build the whole app.yarn nx run contract-sync-job:lint
CONTRACT_ADDRESS
: Govrn Contract address.CHAIN_URL
: chain that Govrn Contract is deployed.CHAIN_ID
: chain id that Govrn Contract is deployed.PROTOCOL_URL
: link to gql endpoint:http://localhost:4000/graphql
DATABASE_URL
: URL references that Database cluster,govrn
.1CONTRACT_SYNC_TOKEN
: Authorization token for GraphQL requests.2INFURA_SUBDOMAIN
: The subdomain of the dedicated infura gateway.2
Footnotes
-
How to prepare
postgres
and getDATABASE_URL
go toprotocol-api
. ↩ -
For Development, it should match with
KEVIN_MALONE_TOKEN
at protocol-api ↩ ↩2