|
|
4 tahun lalu | |
|---|---|---|
| .. | ||
| README.md | ce22a18101 Event database init script | 4 tahun lalu |
| database.go | ce22a18101 Event database init script | 4 tahun lalu |
| database_query.go | ce22a18101 Event database init script | 4 tahun lalu |
| database_setup.go | ce22a18101 Event database init script | 4 tahun lalu |
| go.mod | ce22a18101 Event database init script | 4 tahun lalu |
| go.sum | ce22a18101 Event database init script | 4 tahun lalu |
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-dev \
-keyFilePath ./bigtable-admin.json \
-queryRowKey ethereum:0xf15fe0e6dedef169a25696c577bfddf3d35707210ac641108646d7cfe507f174
Lookup all rows with a timestamp >= queryPreviousMinutes ago:
go run . \
-project wormhole-315720 \
-instance wormhole-dev \
-keyFilePath ./bigtable-admin.json \
-queryPreviousMinutes 120