|
|
4 년 전 | |
|---|---|---|
| .. | ||
| cloud_functions | 8931153f7e BigTable: PubSub trigger after decoding payload | 3 년 전 |
| README.md | 986b4b58f1 Add bigtable to devnet | 4 년 전 |
| database.go | f23afd88c0 BigTable: column families for secondary data | 3 년 전 |
| database_query.go | 8fed2d0659 remove unused bigtable data | 4 년 전 |
| database_setup.go | ce22a18101 Event database init script | 4 년 전 |
| devnet_key.json | 986b4b58f1 Add bigtable to devnet | 4 년 전 |
| go.mod | 71dbe80aae BigTable historical queries | 4 년 전 |
| go.sum | ce22a18101 Event database init script | 4 년 전 |
Once you've created a BigTable instance and a Service Account key, these Go scripts can create the table and column families to save event data.
Pass your BigTable connection info via args:
Invoke the script with the DB config options and -setupDB to create the table and column families, if they do not already exist. If they do already exists when the script runs, it will do nothing.
go run . \
-project your-GCP-projectID \
-instance your-BigTable-instance-name \
-keyFilePath ./service-account-key.json \
-setupDB
Lookup a row by the EmitterChain:TxID:
go run . \
-project wormhole-315720 \
-instance wormhole \
-keyFilePath ./bigtable-admin.json \
-queryRowKey 2:000000000000000000000000e982e462b094850f12af94d21d470e21be9d0e9:6
Lookup all rows with a timestamp >= queryPreviousMinutes ago:
go run . \
-project wormhole-315720 \
-instance wormhole \
-keyFilePath ./bigtable-admin.json \
-queryPreviousMinutes 120