Files
anonklub/query-api
sripwoud aeb1cf5de1 fix(query-api): handle dune out of credits error (#394) (#395)
* add gcloud to `.tool-versions`

* refactor: define cache at module level

* feat: handle dune out of credit error with specific exception

And add more logs

* fix: use keyFile path instead of parsed json string to auth bitgquery requests

* Revert "fix: use keyFile path instead of parsed json string to auth bitgquery requests"

This reverts commit 75cd26ebe219bc88a7d5e97b770fbeb881f5ac0a.

* refactor: rename GOOGLE_APPLICATION_CREDENTIALS to GOOGLE_APPLICATION_CREDENTIALS_JSON_STR

GOOGLE_APPLICATION_CREDENTIALS is what `gcloud` CLI uses by default.
It expects a path, not a JSON string

* update .env.example

* fix .lintstagedrc

prettier should only be ran for files extension that it supports
2024-03-07 16:52:21 +01:00
..
2024-02-02 22:54:55 +01:00
2024-03-07 12:51:51 +01:00

Query API

https://anonset.fly.dev/

Develop

  1. Authenticate requests

    Data Provider Register/Get Credentials For node script
    BigQuery Define Google Service Account and export google credentials in a .key.json file echo "GOOGLE_CLOUD_PROJECT=your-project-id\GOOGLE_APPLICATION_CREDENTIALS='$(cat .key.json)'" > .env
    Dune Analytics Create Dune Account echo "DUNE_API_KEY=yourduneapikey" >> .env
    The Graph Subgraph Studio echo "GRAPH_API_KEY=yourapikey" >> .env
  2. Source .env file: source .env

  3. Start

    • node script
      pnpm i
      pnpm start.dev
      

The Graph

In case new queries are added or existing ones are updated, re-create the artifacts with:

pnpm build.graph

Deploy

Automatic with deploy-*.yml GitHub workflows

Or manually

Install [`flyctl`](https://fly.io/docs/flyctl/installing/).

flyctl deploy \
            --config apis/query/fly-staging.toml \
            --dockerfile apis/query/Dockerfile \
            --remote-only