Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgresql Blob block storage index schematic database schema. #1000

Open
Andrei-Dolgolev opened this issue Jan 24, 2024 · 0 comments
Open
Labels
db Database module

Comments

@Andrei-Dolgolev
Copy link
Contributor

Andrei-Dolgolev commented Jan 24, 2024

We need develop index structure for provide fast access to GCS files and maintain system of storage for RDS of our cstomers.

What we store:

For now we have 5 types of structures stored per chain some of them can have additional fields or don't have some of them(that problem will be handle on crawler issue).

  • Blocks
  • Transactions
  • Events
  • Blocks_trace
  • Transactions_trace

Json examples of all data structures (ethereum chain):
https://gist.github.com/Andrei-Dolgolev/443ddd96d31ba72e939174fae3fdaae3

Important things from moonstram V2 events/transactions must include block_hash for possiblity to running forks detection and fixing.

Indexes

Blocks:

block_number, block_hash, block_timestamp -> (file_link)

Route to blocks:
GCS/blockM..blockN/blocks.proto

Use cases:
Connect with events/transactions/traces for fork protetction

Transactions:

Transactions_hash, from_address, to_address, block_hash -> (file_link)

Route to transactions:
GCS/blockM..blockN/transactions.proto

Use cases:
Get Transactions for customers RDS and decode them to tx_call by particular to_address.
Possably restore some of transacrions in user database tx_table.(depends on transactions trace)

Events:

address, topic, block_hash, tx_hash ->(file_link)

Route to events:
GCS/blockM..blockN/events.proto

Use cases:
Get events for customer RDS by contract address.

Block trace:

Use cases:
Restore internal calls to user RDS by to_address.

Transaction trace:

Use cases:
Restore latest state of storage to user RDS

@Andrei-Dolgolev Andrei-Dolgolev added the db Database module label Jan 24, 2024
@Andrei-Dolgolev Andrei-Dolgolev changed the title Postgresql Blob block storage database schema. Postgresql Blob block storage index schematic database schema. Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db Database module
Projects
None yet
Development

No branches or pull requests

1 participant