Descriptions of the databases used in glados
- Tables are defined in migration files (
./migration/src/m*.rs
). Tables are Enums a Migration::up() uses to manage the tables. - sea_orm uses to migration files to generate
entities
that can be found in./entities/src/*.rs
, one file per table. - Entities exist as
Model
structs, whose members are columns in the table.
- Content key
- A way to refer to a specific element.
- Based on an existing unique identifier, such as a block hash or transaction hash.
- Is combined with a selector, allowing two elements from the same block to have different content keys. (e.g., body and receipts, which otherwise have the same block hash).
- See spec.
- Content id
- An identifier that is useful in coordinating content in the network.
- Derived by hashing the content key.
- See spec.
- History data.
- Each of these is referred to using a content key, and coordinated via content ids.
- Glados doesn't store everything, only the content keys, content ids and a blocknumber/blockhash to make content keys understable.
- Components
- Header
- Everything in a block except the body and receipts.
- Body
- Transactions and uncles
- Receipts
- Transaction receipts (different from transactions)
- Header
- Audit
- The main function of glados.
- Consists of a content key, a pass/fail and a timestamp.
- Steps:
- Record what the portal network should have (
glados-monitor
) - Pick something (a content key), and check the portal network for it (
glados-audit
) - Record a pass/fail and timestamp for that thing.
- Display that (
glados-web
), e.g., the content key "x
" (which may represent "blocky
receipts") was not present in the portal network at timestampz
.
- Record what the portal network should have (
Defined in /src/migration/
:
m20220101_000001_create_table.rs
- Node
- Record
- KeyValue
m20221114_143914_create_content_id_key_and_audit.rs
- ContentId
- ContentKey
- ContentAudit
m20230125_205211_create_execution_header_table.rs
- ExecutionHeader
m20230127_162559_create_execution_body_table.rs
- ExecutionBody
m20230127_162626_create_execution_receipts_table.rs
- ExecutionReceipts
Tables have the following relationships:
- Node
- Record
- KeyValue
- Record
- ContentId
- ContentKey
- ContentAudit (glados audit results)
- ExecutionHeader (data for context)
- ExecutionBody (data for context)
- ExecutionReceipts (data for context)
- ContentKey
Tables have the following columns:
- Node
- NodeId
- Record
- NodeId
- SequenceNumber
- Raw
- CreatedAt
- KeyValue
- RecordId
- Key
- Value
- ContentId
- ContentId
- ContentKey
- ContentId
- ContentKey
- CreatedAt
- ContentAudit
- ContentKey
- CreatedAt
- Result
- ExecutionHeader
- ContentId
- BlockNumber
- BlockHash
- ExecutionBody
- ContentId
- BlockNumber
- BlockHash
- ExecutionReceipts
- ContentId
- BlockNumber
- BlockHash