Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Query ¶
Query captures the chain formation persisted behind a pg.DB connection and returns models.NewBlockSet to be exported for visualization. When provided a DB connection, it expects to find a table in the public schema called `observed_headers` with the following definition:
- miner_id (text)
- header_cid (text)
- parents (text as comma delimited list)
- header_timestamp (int8 as unix epoch)
It also expects the function `unix_to_height(int) -> bigint` which takes the unix epoch and returns the expected height. This might be represented in SQL by `SELECT ((unix_epoch - chain_genesis_epoch) / 30)::bigint;`.
The Query will identify the block and its parents, then associate the block and parent tuple with its metadata.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.