pyth-crosschain/event_database/cloud_functions
justinschuldt 71dbe80aae BigTable historical queries
- Add Cloud Functions:
  - "Recent" gap list, can filter and/or group by chain or address.
  - "Totals" counts 24h, 30d, rolling daily. can filter and group.
  - "Transaction" lookup row by chain-native transaction identifier.

- Pad sequence in rowkey to fixed length, for sequential row order.

- Add Cloud Function deploy instructions.

- Fix #410 Buildpack image cleanup

Change-Id: Ifa3110a3d58e2f94adb48ccb451c27ab3add0611
2021-10-13 16:20:10 +00:00
..
Dockerfile.run BigTable historical queries 2021-10-13 16:20:10 +00:00
README.md BigTable historical queries 2021-10-13 16:20:10 +00:00
bigtable-endpoints.md BigTable historical queries 2021-10-13 16:20:10 +00:00
go.mod BigTable historical queries 2021-10-13 16:20:10 +00:00
go.sum Add bigtable to devnet 2021-08-25 14:01:31 +00:00
readrow.go BigTable historical queries 2021-10-13 16:20:10 +00:00
recent.go BigTable historical queries 2021-10-13 16:20:10 +00:00
shared.go BigTable historical queries 2021-10-13 16:20:10 +00:00
totals.go BigTable historical queries 2021-10-13 16:20:10 +00:00
transaction.go BigTable historical queries 2021-10-13 16:20:10 +00:00

README.md

Google Cloud function for reading BigTable

This is a reference implementaion for getting data out of BigTable.

deploying

First deploy (creation) must include all the flags to configure the environment:

gcloud functions --project your-project deploy testnet --region europe-west3 --entry-point Entry --runtime go116 --trigger-http --allow-unauthenticated --service-account=your-readonly@your-project.iam.gserviceaccount.com --update-env-vars GCP_PROJECT=your-project,BIGTABLE_INSTANCE=wormhole-testnet

Subsequent deploys (updates) only need include flags to indentify the resource for updating: project, region, name.

gcloud functions --project your-project deploy testnet --region europe-west3 --entry-point Entry

invocation

All routes accept their input(s) as query parameters, or request body. Just two different ways of querying:

GET

curl "https://region-project-id.cloudfunctions.net/testnet/readrow?emitterChain=2&emitterAddress=000000000000000000000000e982e462b094850f12af94d21d470e21be9d0e9c&sequence=0000000000000006"

POST

curl -X POST  https://region-project-id.cloudfunctions.net/testnet/readrow \
-H "Content-Type:application/json" \
-d \
'{"emitterChain":"2", "emitterAddress":"000000000000000000000000e982e462b094850f12af94d21d470e21be9d0e9c", "sequence":"0000000000000006"}'

See ./bigtable-endpoints.md for API patterns