From 69d9d5ff5935101ac2649624c3d4df9a99b834dc Mon Sep 17 00:00:00 2001 From: Sotatek-QuanLeA Date: Tue, 4 Jun 2024 11:13:05 +0700 Subject: [PATCH 1/8] chore: add schema documentation --- docs/schema.md | 370 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 370 insertions(+) create mode 100644 docs/schema.md diff --git a/docs/schema.md b/docs/schema.md new file mode 100644 index 000000000..44c53b952 --- /dev/null +++ b/docs/schema.md @@ -0,0 +1,370 @@ + +# I. Assets store +## 1. assets + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**id**|uuid|Unique identifier of the asset| +|slot|bigint|Slot number| +|tx_hash|varchar(64)|Transaction hash| +|policy|varchar(56)|Policy id| +|asset_name|varchar(255)|Name of the asset| +|unit|varchar(255)|Unit of the asset| +|fingerprint|varchar(255)|Fingerprint of the asset| +|quantity|bigint|Quantity of the asset| +|mint_type|varchar(4)|Mint type (FR or CW)
(MINT/BURN)| +|block|bigint|Block number| +|block_time|bigint|Block time| +|update_datetime|timestamp|Datetime of update| + +# II. Block store +## 1. block + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**hash**|varchar(64) not null|Unique identifier for the block (primary key)| +|number|bigint|Block number within the chain| +|body_hash|varchar(64)|Hash of the block body data| +|body_size|integer|Size of the block body data in bytes| +|epoch|integer|Epoch (era) the block belongs to| +|total_output (null)|numeric(38)|Total output created in the block (nullable)| +|total_fees (null)|bigint|Total fees collected in the block (nullable)| +|block_time (null)|bigint|Block creation timestamp (nullable)| +|era|smallint|Era number| +|issuer_vkey|varchar(64)|Public key of the block issuer| +|leader_vrf (null)|jsonb|Leader verification result (JSON, nullable)| +|nonce_vrf (null)|jsonb|Nonce verification result (JSON, nullable)| +|prev_hash|varchar(64)|Hash of the previous block| +|protocol_version|varchar(64)|Blockchain protocol version used| +|slot|bigint|Slot number | +|vrf_result (null)|jsonb|VRF verification result (JSON, nullable)| +|vrf_vkey|varchar(64)|Public key used for VRF verification| +|no_of_txs|integer|Number of transactions in the block| +|slot_leader|varchar(56)|Public key of the slot leader| +|epoch_slot|integer|Slot number within the epoch (redundant with slot)| +|op_cert_hot_vkey (null)|varchar(64)|Hot verification public key (nullable)| +|op_cert_seq_number (null)|bigint|Sequence number for operator certificate (nullable)| +|op_cert_kes_period (null)|bigint|KES key period for operator certificate (nullable)| +|op_cert_sigma (null)|varchar(256)|Signature for operator certificate (nullable)| +|create_datetime|timestamp|Date and time the record was created| +|update_datetime|timestamp|Date and time the record was last updated| +## 2. rollback + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**id**|bigint|Unique identifier (auto-incrementing)| +|rollback_to_block_hash|varchar(64)|Hash of the block to rollback to| +|rollback_to_slot|bigint|Slot number of the block to rollback to| +|current_block_hash|varchar(64)|Hash of the current block| +|current_slot|bigint|Slot number of the current block| +|current_block|bigint|Block number (unique identifier for the block)| +|create_datetime|timestamp|Date and time the record was created| +|update_datetime|timestamp|Date and time the record was last updated| +# III. Epoch store +## 1. local_protocol_params + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**id**|bigint|Unique identifier (primary key)| +|params|jsonb|JSON document containing protocol parameters| +|create_datetime|timestamp|Date and time the record was created| +|update_datetime|timestamp|Date and time the record was last updated| +## 2. protocol_params_proposal + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**tx_hash**|varchar(64)|Unique transaction hash (not null)| +|**key_hash**|varchar(56)|Unique key hash (not null)| +|params|jsonb|JSON document containing proposed protocol parameters| +|target_epoch|integer|Target epoch for the protocol parameter change| +|epoch|integer|Epoch number| +|slot|bigint|Slot number| +|era|smallint|Era identifier| +|block|bigint|Block number| +|block_time|bigint|Block creation timestamp| +|update_datetime|timestamp|Date and time the record was last updated| +## 3. epoch_param + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**epoch**|integer|Epoch number (not null)| +|params|jsonb|JSON document containing epoch parameters| +|cost_model_hash|varchar(64)|Hash of the associated cost model (nullable)| +|slot|bigint|Slot number within the epoch| +|block|bigint|Block number| +|block_time|bigint|Block creation timestamp| +|update_datetime|timestamp|Date and time the record was last updated| +## 4. cost_model + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**hash**|varchar(64)|Unique cost model hash (not null)| +|costs|jsonb|JSON document containing cost details| +|slot|bigint|Slot number within the epoch| +|block|bigint|Block number| +|block_time|bigint|Block creation timestamp| +|update_datetime|timestamp|Date and time the record was last updated| +# IV. Governance store + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|||| +# V. Live store +# VI. Metadata store +## 1. transaction_metadata + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**id**|uuid|Unique identifier (primary key)| +|slot|bigint|Slot number of the block containing the transaction| +|tx_hash|varchar(64)|Unique hash identifier of the transaction| +|label|varchar(255)|Optional human-readable label associated with the transaction| +|body|text|Transaction data in plain text format (optional)| +|cbor|text|Transaction data in CBOR ( Concise Binary Object Representation ) format| +|block|bigint|Block number containing the transaction| +|block_time|bigint|Timestamp (in epoch seconds) of the block containing the transaction| +|update_datetime|timestamp|Date and time the record was last updated| +# VII. Mir store +## 1. mir + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**id**|uuid|Unique identifier (primary key)| +|tx_hash|varchar(64)|Transaction hash (unique identifier for the transaction)| +|cert_index|int|Index of the certificate within the transaction| +|pot|varchar(30)|Pot type (e.g., stake, delegation)| +|credential|varchar(56)|Credential associated with the MIR (stake address or delegation certificate)| +|address|varchar(255)|Bech32 stake address associated with the MIR| +|amount|numeric(38)|Amount of ADA associated with the MIR| +|epoch|int|Cardano epoch number| +|slot|bigint|Slot number within the epoch| +|block_hash|varchar(64)|Hash of the block containing the transaction| +|block|bigint|Block number (unique identifier for the block)| +|block_time|bigint|Unix timestamp of the block creation time| +|update_datetime|timestamp|Date and time the record was last updated| +# VII. Script store +## 1. script + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**script_hash**|varchar(56)|Unique identifier for the script (primary key)| +|script_type|varchar(30)|Type of the script (e.g., locking script, spending script)| +|content|jsonb|JSON document containing the script details| +|create_datetime|timestamp|Date and time the record was created| +|update_datetime|timestamp|Date and time the record was last updated| +## 2. transaction_scripts + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|id|uuid|Unique identifier (primary key)| +|slot|bigint|Slot number of the block containing the transaction| +|block_hash|varchar(64)|Hash of the block containing the transaction| +|tx_hash|varchar(64)|Unique identifier for the transaction (not null)| +|script_hash|varchar(56)|Hash of the transaction script| +|script_type|smallint|Type of the transaction script (numerical code)| +|datum_hash|varchar(64)|Hash of the transaction data| +|redeemer_cbor|text|CBOR encoded redemption script| +|unit_mem|bigint|Memory units consumed by the transaction| +|unit_steps|bigint|Computation steps used by the transaction| +|purpose|varchar(20)|Purpose of the transaction (e.g., payment, delegation)| +|redeemer_index|smallint|Index of the redeemer within the transaction| +|redeemer_datahash|varchar(64)|Hash of the transaction redeemer data| +|block|bigint|Block number (unique identifier for the block)| +|block_time|bigint|Timestamp of the block containing the transaction (in epoch time)| +|update_datetime|timestamp|Date and time the record was last updated| +## 3. datum + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**hash**|varchar(64)|Unique identifier (primary key)| +|datum|text|The actual data content| +|created_at_tx|varchar(64)|Transaction hash where the datum was created| +|create_datetime|timestamp|Date and time the record was created| +|update_datetime|timestamp|Date and time the record was last updated| +# IX. Staking store +## 1. stake_registration + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**tx_hash**|varchar(64)|Unique identifier for the transaction (not null)| +|**cert_index**|int|Index of the certificate within the transaction (not null)| +|credential|varchar(56)|Stake credential (not null)| +|type|varchar(50)|Type of stake registration (e.g., delegation, registration)| +|address|varchar(255)|Bech32 encoded stake address| +|epoch|int|Epoch number associated with the registration| +|slot|bigint|Slot number within the epoch| +|block_hash|varchar(64)|Hash of the block containing the transaction| +|block|bigint|Block number (unique identifier for the block)| +|block_time|bigint|Timestamp of the block in milliseconds since epoch| +|update_datetime|timestamp|Date and time the record was last updated| +## 2. delegation + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**tx_hash**|varchar(64)|Unique identifier for the transaction (not null)| +|**cert_index**|int|Index of the certificate within the transaction (not null)| +|credential|varchar(56)|Stake credential (not null)| +|type|varchar(50)|Type of stake registration (e.g., delegation, registration)| +|address|varchar(255)|Bech32 encoded stake address| +|epoch|int|Epoch number associated with the registration| +|slot|bigint|Slot number within the epoch| +|block_hash|varchar(64)|Hash of the block containing the transaction| +|block|bigint|Block number (unique identifier for the block)| +|block_time|bigint|Timestamp of the block in milliseconds since epoch| +|update_datetime|timestamp|Date and time the record was last updated| +## 3. pool_registration + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**tx_hash**|varchar(64)|Unique transaction hash (not null)| +|**cert_index**|int|Index of the certificate within the transaction (not null)| +|pool_id|varchar(56)|Hash of the registered stake pool| +|vrf_key|varchar(64)|Verifiable random function key for the pool| +|pledge|numeric(20,0)|Amount of ADA pledged to the pool| +|cost|numeric(20, 0)|Operational cost of the pool per epoch| +|margin|decimal(10, 8)|Stake pool deposit margin| +|reward_account|varchar(255)|Address of the reward account for the pool| +|pool_owners|jsonb|JSON document containing information about pool owners| +|relays|jsonb|JSON document containing information about pool relays| +|metadata_url|text|URL to the pool's metadata| +|metadata_hash|varchar(64)|Hash of the pool's metadata| +|epoch|int|Cardano epoch number when the registration occurred| +|slot|bigint|Slot number within the epoch when the registration occurred| +|block_hash|varchar(64)|Hash of the block containing the registration transaction| +|block|bigint|Block number within the Cardano blockchain| +|block_time|bigint|Unix timestamp of the block containing the registration transaction| +|update_datetime|timestamp|Date and time the record was last updated| +## 4.pool_retirement + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**tx_hash**|varchar(64)|Unique transaction hash (not null)| +|**cert_index**|int|Index of the certificate within the transaction (not null)| +|pool_id|varchar(56)|Hash of the retiring stake pool| +|retirement_epoch|int|Epoch at which the pool retires| +|epoch|int|Current epoch| +|slot|bigint|Slot number within the epoch| +|block_hash|varchar(64)|Hash of the block containing the retirement transaction| +|block|bigint|Block number (unique identifier for the block)| +|block_time|bigint|Timestamp of the block in seconds since epoch| +|update_datetime|timestamp|Date and time the record was last updated| +# X. Transaction store +## 1. transaction + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**tx_hash**|varchar(64)|Unique transaction hash (not null)| +|**cert_index**|int|Index of the certificate within the transaction (not null)| +|pool_id|varchar(56)|Hash of the retiring stake pool| +|retirement_epoch|int|Epoch at which the pool retires| +|epoch|int|Current epoch| +|slot|bigint|Slot number within the epoch| +|block_hash|varchar(64)|Hash of the block containing the retirement transaction| +|block|bigint|Block number (unique identifier for the block)| +|block_time|bigint|Timestamp of the block in seconds since epoch| +|update_datetime|timestamp|Date and time the record was last updated| +## 2. transaction_witness + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**tx_hash**|varchar(64)|Unique hash identifier of the transaction (not null)| +|**idx**|integer|Index of the witness within the transaction (not null)| +|pub_key|varchar(128)|Public key used for signing the transaction (optional)| +|signature|varchar(128)|Signature of the transaction data (optional)| +|pub_keyhash|varchar(56)|Hash of the public key (optional)| +|type|varchar(40)|Type of witness (e.g., stake witness, voting witness)| +|additional_data|jsonb|Additional data specific to the witness type (optional)| +|slot|bigint|Slot number where the transaction is included in the blockchain (optional)| +## 3. withdrawal + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**tx_hash**|varchar(64)|Unique transaction hash for the withdrawal| +|**address**|varchar(255)|Wallet address from which funds were withdrawn| +|amount|numeric(38)|Amount of cryptocurrency withdrawn (supports decimals)| +|epoch|integer|Epoch number during which the withdrawal occurred| +|slot|bigint|Slot number within the epoch when the withdrawal occurred| +|block|bigint|Block number on the blockchain containing the withdrawal transaction| +|block_time|bigint|Timestamp (epoch time) of the block containing the withdrawal transaction| +|update_datetime|timestamp|Date and time the record was last updated| +## 4. invalid_transaction + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|tx_hash|varchar(64)|Unique transaction hash (not null, primary key)| +|slot|bigint|Slot number of the block where the invalid transaction was encountered (not null)| +|block_hash|varchar(64)|Hash of the block containing the invalid transaction| +|transaction|jsonb|JSON document containing the raw invalid transaction data| +|create_datetime|timestamp|Date and time the record was created| +|update_datetime|timestamp|Date and time the record was last updated| +# XI. Utxo store +## 1. address_utxo + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**tx_hash**|varchar(64)|Unique identifier for the transaction containing the UTXO (not null)| +|**output_index**|smallint|Index of the output within the transaction. Primary key with tx_hash (not null)| +|slot|bigint|Slot number in which the transaction was included in a block.| +|block_hash|varchar(64)|Unique identifier for the block containing the transaction| +|epoch|integer|Epoch number when the transaction was included in a block| +|lovelace_amount|bigint|Amount of lovelace in the UTXO (null if lovelace amount is zero)| +|amounts|jsonb|Object containing the amount of each multi-asset coin in the UTXO.| +## 2. tx_input + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**output_index**|smallint|Index of the output within the spending transaction (not null)| +|**tx_hash**|varchar(64)|Unique identifier for the transaction that spent the UTXO.| +|spend_at_slot|bigint|Slot number in which the UTXO was spent| +|spent_at_block|bigint|Block number in which the UTXO was spent| +|spent_at_block_hash|varchar(64)|Unique identifier for the block containing the spending transaction| +|spent_block_time|bigint|Unix timestamp of the block containing the spending transaction| +|spent_epoch|integer|Epoch number when the UTXO was spent| +|spent_tx_hash|varchar(64)|Unique identifier for the spending transaction| +## 3. address + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**id**|bigserial|Unique identifier for the address (auto-incrementing)| +|address|varchar(500)|Bech32 address in the Cardano blockchain.| +|addr_full|text|Full address information (might include more details)| +|payment_credential|varchar(56)|Bech32 payment credential for the address| +|stake_address|varchar(255)|Bech32 stake address associated with the address| +|stake_credential|varchar(56)|Bech32 stake credential associated with the address| +|update_datetime|timestamp|Timestamp of the last update to this record.| +# XII. Core table +## 1. cursor_ + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**id**|integer|Unique identifier (not null)
Id của service dùng cursor_ (all, account,..)| +|**block_hash**|varchar(64)|Hash of the block associated with the cursor position| +|slot|bigint|Slot number| +|block_number|bigint|Block number (unique identifier for the block)| +|era|int|Era identifier| +|prev_block_hash|varchar(64)|Hash of the previous block| +|create_datetime|timestamp|Date and time the record was created| +|update_datetime|timestamp|Date and time the record was last updated| +## 2. era +Byron(1), + +Shelley(2), + +Allegra(3), + +Mary(4), + +Alonzo(5), + +Babbage(6), + +Conway(7); + +|**Column name**|**Type**|**Description**| +| :- | :- | :- | +|**era**|int|Era identifier (unique integer value, primary key)| +|start_slot|bigint|Slot number at which the era begins| +|block|bigint|Block number that marks the start of the era| +|block_hash|varchar(64)|Hash of the block that starts the era (unique identifier)| + + From 8d8807a286d2ccad2feea4832d2181bcf1a56384 Mon Sep 17 00:00:00 2001 From: Sotatek-QuanLeA Date: Thu, 27 Jun 2024 16:05:26 +0700 Subject: [PATCH 2/8] chore: update epoch aggregation to schema documentation --- docs/schema.md | 658 +++++++++++++++++++++++++++---------------------- 1 file changed, 357 insertions(+), 301 deletions(-) diff --git a/docs/schema.md b/docs/schema.md index 44c53b952..90848c9fb 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -1,351 +1,407 @@ - # I. Assets store + ## 1. assets -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**id**|uuid|Unique identifier of the asset| -|slot|bigint|Slot number| -|tx_hash|varchar(64)|Transaction hash| -|policy|varchar(56)|Policy id| -|asset_name|varchar(255)|Name of the asset| -|unit|varchar(255)|Unit of the asset| -|fingerprint|varchar(255)|Fingerprint of the asset| -|quantity|bigint|Quantity of the asset| -|mint_type|varchar(4)|Mint type (FR or CW)
(MINT/BURN)| -|block|bigint|Block number| -|block_time|bigint|Block time| -|update_datetime|timestamp|Datetime of update| +| **Column name** | **Type** | **Description** | +|:----------------|:-------------|:------------------------------------| +| **id** | uuid | Unique identifier of the asset | +| slot | bigint | Slot number | +| tx_hash | varchar(64) | Transaction hash | +| policy | varchar(56) | Policy id | +| asset_name | varchar(255) | Name of the asset | +| unit | varchar(255) | Unit of the asset | +| fingerprint | varchar(255) | Fingerprint of the asset | +| quantity | bigint | Quantity of the asset | +| mint_type | varchar(4) | Mint type (FR or CW)
(MINT/BURN) | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Datetime of update | # II. Block store + ## 1. block -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**hash**|varchar(64) not null|Unique identifier for the block (primary key)| -|number|bigint|Block number within the chain| -|body_hash|varchar(64)|Hash of the block body data| -|body_size|integer|Size of the block body data in bytes| -|epoch|integer|Epoch (era) the block belongs to| -|total_output (null)|numeric(38)|Total output created in the block (nullable)| -|total_fees (null)|bigint|Total fees collected in the block (nullable)| -|block_time (null)|bigint|Block creation timestamp (nullable)| -|era|smallint|Era number| -|issuer_vkey|varchar(64)|Public key of the block issuer| -|leader_vrf (null)|jsonb|Leader verification result (JSON, nullable)| -|nonce_vrf (null)|jsonb|Nonce verification result (JSON, nullable)| -|prev_hash|varchar(64)|Hash of the previous block| -|protocol_version|varchar(64)|Blockchain protocol version used| -|slot|bigint|Slot number | -|vrf_result (null)|jsonb|VRF verification result (JSON, nullable)| -|vrf_vkey|varchar(64)|Public key used for VRF verification| -|no_of_txs|integer|Number of transactions in the block| -|slot_leader|varchar(56)|Public key of the slot leader| -|epoch_slot|integer|Slot number within the epoch (redundant with slot)| -|op_cert_hot_vkey (null)|varchar(64)|Hot verification public key (nullable)| -|op_cert_seq_number (null)|bigint|Sequence number for operator certificate (nullable)| -|op_cert_kes_period (null)|bigint|KES key period for operator certificate (nullable)| -|op_cert_sigma (null)|varchar(256)|Signature for operator certificate (nullable)| -|create_datetime|timestamp|Date and time the record was created| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:--------------------------|:---------------------|:----------------------------------------------------| +| **hash** | varchar(64) not null | Unique identifier for the block (primary key) | +| number | bigint | Block number within the chain | +| body_hash | varchar(64) | Hash of the block body data | +| body_size | integer | Size of the block body data in bytes | +| epoch | integer | Epoch (era) the block belongs to | +| total_output (null) | numeric(38) | Total output created in the block (nullable) | +| total_fees (null) | bigint | Total fees collected in the block (nullable) | +| block_time (null) | bigint | Block creation timestamp (nullable) | +| era | smallint | Era number | +| issuer_vkey | varchar(64) | Public key of the block issuer | +| leader_vrf (null) | jsonb | Leader verification result (JSON, nullable) | +| nonce_vrf (null) | jsonb | Nonce verification result (JSON, nullable) | +| prev_hash | varchar(64) | Hash of the previous block | +| protocol_version | varchar(64) | Blockchain protocol version used | +| slot | bigint | Slot number | +| vrf_result (null) | jsonb | VRF verification result (JSON, nullable) | +| vrf_vkey | varchar(64) | Public key used for VRF verification | +| no_of_txs | integer | Number of transactions in the block | +| slot_leader | varchar(56) | Public key of the slot leader | +| epoch_slot | integer | Slot number within the epoch (redundant with slot) | +| op_cert_hot_vkey (null) | varchar(64) | Hot verification public key (nullable) | +| op_cert_seq_number (null) | bigint | Sequence number for operator certificate (nullable) | +| op_cert_kes_period (null) | bigint | KES key period for operator certificate (nullable) | +| op_cert_sigma (null) | varchar(256) | Signature for operator certificate (nullable) | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | + ## 2. rollback -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**id**|bigint|Unique identifier (auto-incrementing)| -|rollback_to_block_hash|varchar(64)|Hash of the block to rollback to| -|rollback_to_slot|bigint|Slot number of the block to rollback to| -|current_block_hash|varchar(64)|Hash of the current block| -|current_slot|bigint|Slot number of the current block| -|current_block|bigint|Block number (unique identifier for the block)| -|create_datetime|timestamp|Date and time the record was created| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:-----------------------|:------------|:-----------------------------------------------| +| **id** | bigint | Unique identifier (auto-incrementing) | +| rollback_to_block_hash | varchar(64) | Hash of the block to rollback to | +| rollback_to_slot | bigint | Slot number of the block to rollback to | +| current_block_hash | varchar(64) | Hash of the current block | +| current_slot | bigint | Slot number of the current block | +| current_block | bigint | Block number (unique identifier for the block) | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | + # III. Epoch store + ## 1. local_protocol_params -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**id**|bigint|Unique identifier (primary key)| -|params|jsonb|JSON document containing protocol parameters| -|create_datetime|timestamp|Date and time the record was created| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:----------------|:----------|:---------------------------------------------| +| **id** | bigint | Unique identifier (primary key) | +| params | jsonb | JSON document containing protocol parameters | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | + ## 2. protocol_params_proposal -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**tx_hash**|varchar(64)|Unique transaction hash (not null)| -|**key_hash**|varchar(56)|Unique key hash (not null)| -|params|jsonb|JSON document containing proposed protocol parameters| -|target_epoch|integer|Target epoch for the protocol parameter change| -|epoch|integer|Epoch number| -|slot|bigint|Slot number| -|era|smallint|Era identifier| -|block|bigint|Block number| -|block_time|bigint|Block creation timestamp| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique transaction hash (not null) | +| **key_hash** | varchar(56) | Unique key hash (not null) | +| params | jsonb | JSON document containing proposed protocol parameters | +| target_epoch | integer | Target epoch for the protocol parameter change | +| epoch | integer | Epoch number | +| slot | bigint | Slot number | +| era | smallint | Era identifier | +| block | bigint | Block number | +| block_time | bigint | Block creation timestamp | +| update_datetime | timestamp | Date and time the record was last updated | + ## 3. epoch_param -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**epoch**|integer|Epoch number (not null)| -|params|jsonb|JSON document containing epoch parameters| -|cost_model_hash|varchar(64)|Hash of the associated cost model (nullable)| -|slot|bigint|Slot number within the epoch| -|block|bigint|Block number| -|block_time|bigint|Block creation timestamp| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:---------------------------------------------| +| **epoch** | integer | Epoch number (not null) | +| params | jsonb | JSON document containing epoch parameters | +| cost_model_hash | varchar(64) | Hash of the associated cost model (nullable) | +| slot | bigint | Slot number within the epoch | +| block | bigint | Block number | +| block_time | bigint | Block creation timestamp | +| update_datetime | timestamp | Date and time the record was last updated | + ## 4. cost_model -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**hash**|varchar(64)|Unique cost model hash (not null)| -|costs|jsonb|JSON document containing cost details| -|slot|bigint|Slot number within the epoch| -|block|bigint|Block number| -|block_time|bigint|Block creation timestamp| -|update_datetime|timestamp|Date and time the record was last updated| -# IV. Governance store - -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|||| -# V. Live store -# VI. Metadata store +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:------------------------------------------| +| **hash** | varchar(64) | Unique cost model hash (not null) | +| costs | jsonb | JSON document containing cost details | +| slot | bigint | Slot number within the epoch | +| block | bigint | Block number | +| block_time | bigint | Block creation timestamp | +| update_datetime | timestamp | Date and time the record was last updated | + +# IV Epoch aggregation + +## 1. epoch + +| Column Name | Data Type | Description | +|-------------------|-------------|-------------------------------------------------------------------------------| +| number | bigint | Unique epoch identifier (not null, primary key) | +| block_count | int | Number of blocks produced in the epoch (nullable) | +| transaction_count | bigint | Number of transactions included in the epoch (nullable) | +| total_output | numeric(38) | Total amount of ADA distributed as outputs in the epoch (nullable) | +| total_fees | bigint | Total amount of ADA collected in transaction fees during the epoch (nullable) | +| start_time | bigint | Unix timestamp representing the start time of the epoch (nullable) | +| end_time | bigint | Unix timestamp representing the end time of the epoch (nullable) | +| max_slot | bigint | Maximum slot number reached within the epoch (nullable) | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | + +# V. Governance store + +| **Column name** | **Type** | **Description** | +|:----------------|:---------|:----------------| +| | | | + +# VI. Live store + +| **Column name** | **Type** | **Description** | +|:----------------|:---------|:----------------| +| | | | + +# VII. Metadata store + ## 1. transaction_metadata -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**id**|uuid|Unique identifier (primary key)| -|slot|bigint|Slot number of the block containing the transaction| -|tx_hash|varchar(64)|Unique hash identifier of the transaction| -|label|varchar(255)|Optional human-readable label associated with the transaction| -|body|text|Transaction data in plain text format (optional)| -|cbor|text|Transaction data in CBOR ( Concise Binary Object Representation ) format| -|block|bigint|Block number containing the transaction| -|block_time|bigint|Timestamp (in epoch seconds) of the block containing the transaction| -|update_datetime|timestamp|Date and time the record was last updated| -# VII. Mir store +| **Column name** | **Type** | **Description** | +|:----------------|:-------------|:-------------------------------------------------------------------------| +| **id** | uuid | Unique identifier (primary key) | +| slot | bigint | Slot number of the block containing the transaction | +| tx_hash | varchar(64) | Unique hash identifier of the transaction | +| label | varchar(255) | Optional human-readable label associated with the transaction | +| body | text | Transaction data in plain text format (optional) | +| cbor | text | Transaction data in CBOR ( Concise Binary Object Representation ) format | +| block | bigint | Block number containing the transaction | +| block_time | bigint | Timestamp (in epoch seconds) of the block containing the transaction | +| update_datetime | timestamp | Date and time the record was last updated | + +# VIII. Mir store + ## 1. mir -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**id**|uuid|Unique identifier (primary key)| -|tx_hash|varchar(64)|Transaction hash (unique identifier for the transaction)| -|cert_index|int|Index of the certificate within the transaction| -|pot|varchar(30)|Pot type (e.g., stake, delegation)| -|credential|varchar(56)|Credential associated with the MIR (stake address or delegation certificate)| -|address|varchar(255)|Bech32 stake address associated with the MIR| -|amount|numeric(38)|Amount of ADA associated with the MIR| -|epoch|int|Cardano epoch number| -|slot|bigint|Slot number within the epoch| -|block_hash|varchar(64)|Hash of the block containing the transaction| -|block|bigint|Block number (unique identifier for the block)| -|block_time|bigint|Unix timestamp of the block creation time| -|update_datetime|timestamp|Date and time the record was last updated| -# VII. Script store +| **Column name** | **Type** | **Description** | +|:----------------|:-------------|:-----------------------------------------------------------------------------| +| **id** | uuid | Unique identifier (primary key) | +| tx_hash | varchar(64) | Transaction hash (unique identifier for the transaction) | +| cert_index | int | Index of the certificate within the transaction | +| pot | varchar(30) | Pot type (e.g., stake, delegation) | +| credential | varchar(56) | Credential associated with the MIR (stake address or delegation certificate) | +| address | varchar(255) | Bech32 stake address associated with the MIR | +| amount | numeric(38) | Amount of ADA associated with the MIR | +| epoch | int | Cardano epoch number | +| slot | bigint | Slot number within the epoch | +| block_hash | varchar(64) | Hash of the block containing the transaction | +| block | bigint | Block number (unique identifier for the block) | +| block_time | bigint | Unix timestamp of the block creation time | +| update_datetime | timestamp | Date and time the record was last updated | + +# IX. Script store + ## 1. script -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**script_hash**|varchar(56)|Unique identifier for the script (primary key)| -|script_type|varchar(30)|Type of the script (e.g., locking script, spending script)| -|content|jsonb|JSON document containing the script details| -|create_datetime|timestamp|Date and time the record was created| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:-----------------------------------------------------------| +| **script_hash** | varchar(56) | Unique identifier for the script (primary key) | +| script_type | varchar(30) | Type of the script (e.g., locking script, spending script) | +| content | jsonb | JSON document containing the script details | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | + ## 2. transaction_scripts -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|id|uuid|Unique identifier (primary key)| -|slot|bigint|Slot number of the block containing the transaction| -|block_hash|varchar(64)|Hash of the block containing the transaction| -|tx_hash|varchar(64)|Unique identifier for the transaction (not null)| -|script_hash|varchar(56)|Hash of the transaction script| -|script_type|smallint|Type of the transaction script (numerical code)| -|datum_hash|varchar(64)|Hash of the transaction data| -|redeemer_cbor|text|CBOR encoded redemption script| -|unit_mem|bigint|Memory units consumed by the transaction| -|unit_steps|bigint|Computation steps used by the transaction| -|purpose|varchar(20)|Purpose of the transaction (e.g., payment, delegation)| -|redeemer_index|smallint|Index of the redeemer within the transaction| -|redeemer_datahash|varchar(64)|Hash of the transaction redeemer data| -|block|bigint|Block number (unique identifier for the block)| -|block_time|bigint|Timestamp of the block containing the transaction (in epoch time)| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:------------------|:------------|:------------------------------------------------------------------| +| id | uuid | Unique identifier (primary key) | +| slot | bigint | Slot number of the block containing the transaction | +| block_hash | varchar(64) | Hash of the block containing the transaction | +| tx_hash | varchar(64) | Unique identifier for the transaction (not null) | +| script_hash | varchar(56) | Hash of the transaction script | +| script_type | smallint | Type of the transaction script (numerical code) | +| datum_hash | varchar(64) | Hash of the transaction data | +| redeemer_cbor | text | CBOR encoded redemption script | +| unit_mem | bigint | Memory units consumed by the transaction | +| unit_steps | bigint | Computation steps used by the transaction | +| purpose | varchar(20) | Purpose of the transaction (e.g., payment, delegation) | +| redeemer_index | smallint | Index of the redeemer within the transaction | +| redeemer_datahash | varchar(64) | Hash of the transaction redeemer data | +| block | bigint | Block number (unique identifier for the block) | +| block_time | bigint | Timestamp of the block containing the transaction (in epoch time) | +| update_datetime | timestamp | Date and time the record was last updated | + ## 3. datum -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**hash**|varchar(64)|Unique identifier (primary key)| -|datum|text|The actual data content| -|created_at_tx|varchar(64)|Transaction hash where the datum was created| -|create_datetime|timestamp|Date and time the record was created| -|update_datetime|timestamp|Date and time the record was last updated| -# IX. Staking store +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:---------------------------------------------| +| **hash** | varchar(64) | Unique identifier (primary key) | +| datum | text | The actual data content | +| created_at_tx | varchar(64) | Transaction hash where the datum was created | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | + +# X. Staking store + ## 1. stake_registration -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**tx_hash**|varchar(64)|Unique identifier for the transaction (not null)| -|**cert_index**|int|Index of the certificate within the transaction (not null)| -|credential|varchar(56)|Stake credential (not null)| -|type|varchar(50)|Type of stake registration (e.g., delegation, registration)| -|address|varchar(255)|Bech32 encoded stake address| -|epoch|int|Epoch number associated with the registration| -|slot|bigint|Slot number within the epoch| -|block_hash|varchar(64)|Hash of the block containing the transaction| -|block|bigint|Block number (unique identifier for the block)| -|block_time|bigint|Timestamp of the block in milliseconds since epoch| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:----------------|:-------------|:------------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique identifier for the transaction (not null) | +| **cert_index** | int | Index of the certificate within the transaction (not null) | +| credential | varchar(56) | Stake credential (not null) | +| type | varchar(50) | Type of stake registration (e.g., delegation, registration) | +| address | varchar(255) | Bech32 encoded stake address | +| epoch | int | Epoch number associated with the registration | +| slot | bigint | Slot number within the epoch | +| block_hash | varchar(64) | Hash of the block containing the transaction | +| block | bigint | Block number (unique identifier for the block) | +| block_time | bigint | Timestamp of the block in milliseconds since epoch | +| update_datetime | timestamp | Date and time the record was last updated | + ## 2. delegation -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**tx_hash**|varchar(64)|Unique identifier for the transaction (not null)| -|**cert_index**|int|Index of the certificate within the transaction (not null)| -|credential|varchar(56)|Stake credential (not null)| -|type|varchar(50)|Type of stake registration (e.g., delegation, registration)| -|address|varchar(255)|Bech32 encoded stake address| -|epoch|int|Epoch number associated with the registration| -|slot|bigint|Slot number within the epoch| -|block_hash|varchar(64)|Hash of the block containing the transaction| -|block|bigint|Block number (unique identifier for the block)| -|block_time|bigint|Timestamp of the block in milliseconds since epoch| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:----------------|:-------------|:------------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique identifier for the transaction (not null) | +| **cert_index** | int | Index of the certificate within the transaction (not null) | +| credential | varchar(56) | Stake credential (not null) | +| type | varchar(50) | Type of stake registration (e.g., delegation, registration) | +| address | varchar(255) | Bech32 encoded stake address | +| epoch | int | Epoch number associated with the registration | +| slot | bigint | Slot number within the epoch | +| block_hash | varchar(64) | Hash of the block containing the transaction | +| block | bigint | Block number (unique identifier for the block) | +| block_time | bigint | Timestamp of the block in milliseconds since epoch | +| update_datetime | timestamp | Date and time the record was last updated | + ## 3. pool_registration -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**tx_hash**|varchar(64)|Unique transaction hash (not null)| -|**cert_index**|int|Index of the certificate within the transaction (not null)| -|pool_id|varchar(56)|Hash of the registered stake pool| -|vrf_key|varchar(64)|Verifiable random function key for the pool| -|pledge|numeric(20,0)|Amount of ADA pledged to the pool| -|cost|numeric(20, 0)|Operational cost of the pool per epoch| -|margin|decimal(10, 8)|Stake pool deposit margin| -|reward_account|varchar(255)|Address of the reward account for the pool| -|pool_owners|jsonb|JSON document containing information about pool owners| -|relays|jsonb|JSON document containing information about pool relays| -|metadata_url|text|URL to the pool's metadata| -|metadata_hash|varchar(64)|Hash of the pool's metadata| -|epoch|int|Cardano epoch number when the registration occurred| -|slot|bigint|Slot number within the epoch when the registration occurred| -|block_hash|varchar(64)|Hash of the block containing the registration transaction| -|block|bigint|Block number within the Cardano blockchain| -|block_time|bigint|Unix timestamp of the block containing the registration transaction| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:----------------|:---------------|:--------------------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique transaction hash (not null) | +| **cert_index** | int | Index of the certificate within the transaction (not null) | +| pool_id | varchar(56) | Hash of the registered stake pool | +| vrf_key | varchar(64) | Verifiable random function key for the pool | +| pledge | numeric(20,0) | Amount of ADA pledged to the pool | +| cost | numeric(20, 0) | Operational cost of the pool per epoch | +| margin | decimal(10, 8) | Stake pool deposit margin | +| reward_account | varchar(255) | Address of the reward account for the pool | +| pool_owners | jsonb | JSON document containing information about pool owners | +| relays | jsonb | JSON document containing information about pool relays | +| metadata_url | text | URL to the pool's metadata | +| metadata_hash | varchar(64) | Hash of the pool's metadata | +| epoch | int | Cardano epoch number when the registration occurred | +| slot | bigint | Slot number within the epoch when the registration occurred | +| block_hash | varchar(64) | Hash of the block containing the registration transaction | +| block | bigint | Block number within the Cardano blockchain | +| block_time | bigint | Unix timestamp of the block containing the registration transaction | +| update_datetime | timestamp | Date and time the record was last updated | + ## 4.pool_retirement -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**tx_hash**|varchar(64)|Unique transaction hash (not null)| -|**cert_index**|int|Index of the certificate within the transaction (not null)| -|pool_id|varchar(56)|Hash of the retiring stake pool| -|retirement_epoch|int|Epoch at which the pool retires| -|epoch|int|Current epoch| -|slot|bigint|Slot number within the epoch| -|block_hash|varchar(64)|Hash of the block containing the retirement transaction| -|block|bigint|Block number (unique identifier for the block)| -|block_time|bigint|Timestamp of the block in seconds since epoch| -|update_datetime|timestamp|Date and time the record was last updated| -# X. Transaction store +| **Column name** | **Type** | **Description** | +|:-----------------|:------------|:-----------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique transaction hash (not null) | +| **cert_index** | int | Index of the certificate within the transaction (not null) | +| pool_id | varchar(56) | Hash of the retiring stake pool | +| retirement_epoch | int | Epoch at which the pool retires | +| epoch | int | Current epoch | +| slot | bigint | Slot number within the epoch | +| block_hash | varchar(64) | Hash of the block containing the retirement transaction | +| block | bigint | Block number (unique identifier for the block) | +| block_time | bigint | Timestamp of the block in seconds since epoch | +| update_datetime | timestamp | Date and time the record was last updated | + +# XI. Transaction store + ## 1. transaction -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**tx_hash**|varchar(64)|Unique transaction hash (not null)| -|**cert_index**|int|Index of the certificate within the transaction (not null)| -|pool_id|varchar(56)|Hash of the retiring stake pool| -|retirement_epoch|int|Epoch at which the pool retires| -|epoch|int|Current epoch| -|slot|bigint|Slot number within the epoch| -|block_hash|varchar(64)|Hash of the block containing the retirement transaction| -|block|bigint|Block number (unique identifier for the block)| -|block_time|bigint|Timestamp of the block in seconds since epoch| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:-----------------|:------------|:-----------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique transaction hash (not null) | +| **cert_index** | int | Index of the certificate within the transaction (not null) | +| pool_id | varchar(56) | Hash of the retiring stake pool | +| retirement_epoch | int | Epoch at which the pool retires | +| epoch | int | Current epoch | +| slot | bigint | Slot number within the epoch | +| block_hash | varchar(64) | Hash of the block containing the retirement transaction | +| block | bigint | Block number (unique identifier for the block) | +| block_time | bigint | Timestamp of the block in seconds since epoch | +| update_datetime | timestamp | Date and time the record was last updated | + ## 2. transaction_witness -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**tx_hash**|varchar(64)|Unique hash identifier of the transaction (not null)| -|**idx**|integer|Index of the witness within the transaction (not null)| -|pub_key|varchar(128)|Public key used for signing the transaction (optional)| -|signature|varchar(128)|Signature of the transaction data (optional)| -|pub_keyhash|varchar(56)|Hash of the public key (optional)| -|type|varchar(40)|Type of witness (e.g., stake witness, voting witness)| -|additional_data|jsonb|Additional data specific to the witness type (optional)| -|slot|bigint|Slot number where the transaction is included in the blockchain (optional)| +| **Column name** | **Type** | **Description** | +|:----------------|:-------------|:---------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique hash identifier of the transaction (not null) | +| **idx** | integer | Index of the witness within the transaction (not null) | +| pub_key | varchar(128) | Public key used for signing the transaction (optional) | +| signature | varchar(128) | Signature of the transaction data (optional) | +| pub_keyhash | varchar(56) | Hash of the public key (optional) | +| type | varchar(40) | Type of witness (e.g., stake witness, voting witness) | +| additional_data | jsonb | Additional data specific to the witness type (optional) | +| slot | bigint | Slot number where the transaction is included in the blockchain (optional) | + ## 3. withdrawal -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**tx_hash**|varchar(64)|Unique transaction hash for the withdrawal| -|**address**|varchar(255)|Wallet address from which funds were withdrawn| -|amount|numeric(38)|Amount of cryptocurrency withdrawn (supports decimals)| -|epoch|integer|Epoch number during which the withdrawal occurred| -|slot|bigint|Slot number within the epoch when the withdrawal occurred| -|block|bigint|Block number on the blockchain containing the withdrawal transaction| -|block_time|bigint|Timestamp (epoch time) of the block containing the withdrawal transaction| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:----------------|:-------------|:--------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique transaction hash for the withdrawal | +| **address** | varchar(255) | Wallet address from which funds were withdrawn | +| amount | numeric(38) | Amount of cryptocurrency withdrawn (supports decimals) | +| epoch | integer | Epoch number during which the withdrawal occurred | +| slot | bigint | Slot number within the epoch when the withdrawal occurred | +| block | bigint | Block number on the blockchain containing the withdrawal transaction | +| block_time | bigint | Timestamp (epoch time) of the block containing the withdrawal transaction | +| update_datetime | timestamp | Date and time the record was last updated | + ## 4. invalid_transaction -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|tx_hash|varchar(64)|Unique transaction hash (not null, primary key)| -|slot|bigint|Slot number of the block where the invalid transaction was encountered (not null)| -|block_hash|varchar(64)|Hash of the block containing the invalid transaction| -|transaction|jsonb|JSON document containing the raw invalid transaction data| -|create_datetime|timestamp|Date and time the record was created| -|update_datetime|timestamp|Date and time the record was last updated| -# XI. Utxo store +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:----------------------------------------------------------------------------------| +| tx_hash | varchar(64) | Unique transaction hash (not null, primary key) | +| slot | bigint | Slot number of the block where the invalid transaction was encountered (not null) | +| block_hash | varchar(64) | Hash of the block containing the invalid transaction | +| transaction | jsonb | JSON document containing the raw invalid transaction data | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | + +# XII. Utxo store + ## 1. address_utxo -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**tx_hash**|varchar(64)|Unique identifier for the transaction containing the UTXO (not null)| -|**output_index**|smallint|Index of the output within the transaction. Primary key with tx_hash (not null)| -|slot|bigint|Slot number in which the transaction was included in a block.| -|block_hash|varchar(64)|Unique identifier for the block containing the transaction| -|epoch|integer|Epoch number when the transaction was included in a block| -|lovelace_amount|bigint|Amount of lovelace in the UTXO (null if lovelace amount is zero)| -|amounts|jsonb|Object containing the amount of each multi-asset coin in the UTXO.| +| **Column name** | **Type** | **Description** | +|:-----------------|:------------|:--------------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique identifier for the transaction containing the UTXO (not null) | +| **output_index** | smallint | Index of the output within the transaction. Primary key with tx_hash (not null) | +| slot | bigint | Slot number in which the transaction was included in a block. | +| block_hash | varchar(64) | Unique identifier for the block containing the transaction | +| epoch | integer | Epoch number when the transaction was included in a block | +| lovelace_amount | bigint | Amount of lovelace in the UTXO (null if lovelace amount is zero) | +| amounts | jsonb | Object containing the amount of each multi-asset coin in the UTXO. | + ## 2. tx_input -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**output_index**|smallint|Index of the output within the spending transaction (not null)| -|**tx_hash**|varchar(64)|Unique identifier for the transaction that spent the UTXO.| -|spend_at_slot|bigint|Slot number in which the UTXO was spent| -|spent_at_block|bigint|Block number in which the UTXO was spent| -|spent_at_block_hash|varchar(64)|Unique identifier for the block containing the spending transaction| -|spent_block_time|bigint|Unix timestamp of the block containing the spending transaction| -|spent_epoch|integer|Epoch number when the UTXO was spent| -|spent_tx_hash|varchar(64)|Unique identifier for the spending transaction| +| **Column name** | **Type** | **Description** | +|:--------------------|:------------|:--------------------------------------------------------------------| +| **output_index** | smallint | Index of the output within the spending transaction (not null) | +| **tx_hash** | varchar(64) | Unique identifier for the transaction that spent the UTXO. | +| spend_at_slot | bigint | Slot number in which the UTXO was spent | +| spent_at_block | bigint | Block number in which the UTXO was spent | +| spent_at_block_hash | varchar(64) | Unique identifier for the block containing the spending transaction | +| spent_block_time | bigint | Unix timestamp of the block containing the spending transaction | +| spent_epoch | integer | Epoch number when the UTXO was spent | +| spent_tx_hash | varchar(64) | Unique identifier for the spending transaction | + ## 3. address -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**id**|bigserial|Unique identifier for the address (auto-incrementing)| -|address|varchar(500)|Bech32 address in the Cardano blockchain.| -|addr_full|text|Full address information (might include more details)| -|payment_credential|varchar(56)|Bech32 payment credential for the address| -|stake_address|varchar(255)|Bech32 stake address associated with the address| -|stake_credential|varchar(56)|Bech32 stake credential associated with the address| -|update_datetime|timestamp|Timestamp of the last update to this record.| -# XII. Core table +| **Column name** | **Type** | **Description** | +|:-------------------|:-------------|:------------------------------------------------------| +| **id** | bigserial | Unique identifier for the address (auto-incrementing) | +| address | varchar(500) | Bech32 address in the Cardano blockchain. | +| addr_full | text | Full address information (might include more details) | +| payment_credential | varchar(56) | Bech32 payment credential for the address | +| stake_address | varchar(255) | Bech32 stake address associated with the address | +| stake_credential | varchar(56) | Bech32 stake credential associated with the address | +| update_datetime | timestamp | Timestamp of the last update to this record. | + +# XIII. Core table + ## 1. cursor_ -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**id**|integer|Unique identifier (not null)
Id của service dùng cursor_ (all, account,..)| -|**block_hash**|varchar(64)|Hash of the block associated with the cursor position| -|slot|bigint|Slot number| -|block_number|bigint|Block number (unique identifier for the block)| -|era|int|Era identifier| -|prev_block_hash|varchar(64)|Hash of the previous block| -|create_datetime|timestamp|Date and time the record was created| -|update_datetime|timestamp|Date and time the record was last updated| +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:------------------------------------------------------------------------------| +| **id** | integer | Unique identifier (not null)
Id của service dùng cursor_ (all, account,..) | +| **block_hash** | varchar(64) | Hash of the block associated with the cursor position | +| slot | bigint | Slot number | +| block_number | bigint | Block number (unique identifier for the block) | +| era | int | Era identifier | +| prev_block_hash | varchar(64) | Hash of the previous block | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | + ## 2. era + Byron(1), Shelley(2), @@ -360,11 +416,11 @@ Babbage(6), Conway(7); -|**Column name**|**Type**|**Description**| -| :- | :- | :- | -|**era**|int|Era identifier (unique integer value, primary key)| -|start_slot|bigint|Slot number at which the era begins| -|block|bigint|Block number that marks the start of the era| -|block_hash|varchar(64)|Hash of the block that starts the era (unique identifier)| +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:----------------------------------------------------------| +| **era** | int | Era identifier (unique integer value, primary key) | +| start_slot | bigint | Slot number at which the era begins | +| block | bigint | Block number that marks the start of the era | +| block_hash | varchar(64) | Hash of the block that starts the era (unique identifier) | From 6357625d7d8ec5ce4416be3b7caf2e48f91bfef3 Mon Sep 17 00:00:00 2001 From: Sotatek-QuanLeA Date: Thu, 27 Jun 2024 16:28:34 +0700 Subject: [PATCH 3/8] chore: add governance store to schema documentation --- docs/schema.md | 120 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 116 insertions(+), 4 deletions(-) diff --git a/docs/schema.md b/docs/schema.md index 90848c9fb..09b090fa5 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -118,7 +118,7 @@ | Column Name | Data Type | Description | |-------------------|-------------|-------------------------------------------------------------------------------| -| number | bigint | Unique epoch identifier (not null, primary key) | +| **number** | bigint | Unique epoch identifier (not null, primary key) | | block_count | int | Number of blocks produced in the epoch (nullable) | | transaction_count | bigint | Number of transactions included in the epoch (nullable) | | total_output | numeric(38) | Total amount of ADA distributed as outputs in the epoch (nullable) | @@ -131,9 +131,121 @@ # V. Governance store -| **Column name** | **Type** | **Description** | -|:----------------|:---------|:----------------| -| | | | +## 1. gov_action_proposal + +| Column Name | Data Type | Description | +|-----------------|--------------|-----------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique transaction hash (not null, part of primary key) | +| **idx** | int | Proposal index within the transaction (not null, part of primary key) | +| deposit | bigint | Amount of ADA required to deposit a vote on the proposal (nullable) | +| return_address | varchar(255) | Address to which remaining ADA will be returned after voting (nullable) | +| anchor_url | varchar | URL for additional information about the proposal (nullable) | +| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url (nullable) | +| type | varchar(50) | Type of governance action proposed (e.g., updateProposal, withdrawProposal) | +| details | jsonb | JSON document containing details about the proposal (nullable) | +| epoch | int | Epoch number when the proposal was submitted (nullable) | +| slot | bigint | Slot number within the epoch when the proposal was submitted (nullable) | +| block | bigint | Block number where the proposal transaction is included (nullable) | +| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | +| update_datetime | timestamp | Date and time the record was last updated | + +## 2. voting_procedure + +| Column Name | Data Type | Description | +|------------------------|-------------|-----------------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | Transaction hash associated with the vote (not null, part of primary key) | +| **voter_hash** | varchar(56) | Hash identifying the voter (not null, part of primary key) | +| **gov_action_tx_hash** | varchar(64) | Transaction hash of the corresponding governance action proposal (nullable) | +| **gov_action_index** | int | Index of the proposal within the governance action transaction (nullable) | +| id | uuid | Unique identifier (not null, primary key) | +| idx | int | Index of the voting option within the transaction (not null, part of primary key) | +| voter_type | varchar(50) | Type of voter (e.g., stake pool, delegation certificate) | +| vote | varchar(10) | Cast vote (e.g., "yes", "no", "abstain") | +| anchor_url | varchar | URL for additional information about the vote (nullable) | +| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url (nullable) | +| epoch | int | Epoch number when the vote was cast (nullable) | +| slot | bigint | Slot number within the epoch when the vote was cast (nullable) | +| block | bigint | Block number where the voting transaction is included (nullable) | +| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | +| update_datetime | timestamp | Date and time the record was last updated | + +## 3. committee_registration + +| Column Name | Data Type | Description | +|-----------------|-------------|-------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | +| **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | +| cold_key | varchar | Public key for the cold wallet (nullable) | +| hot_key | varchar | Public key for the hot wallet (nullable) | +| cred_type | varchar(40) | Type of credential used for registration (nullable) | +| epoch | int | Epoch number when the registration occurred (nullable) | +| slot | bigint | Slot number within the epoch when the registration occurred (nullable) | +| block | bigint | Block number where the registration transaction is included (nullable) | +| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | +| update_datetime | timestamp | Date and time the record was last updated | + +## 4. committee_deregistration + +| Column Name | Data Type | Description | +|-----------------|-------------|--------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | +| **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | +| anchor_url | varchar | URL for additional information about the deregistration (nullable) | +| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url (nullable) | +| cold_key | varchar(64) | Public key for the cold wallet (not null) | +| cred_type | varchar(40) | Type of credential used for deregistration (nullable) | +| epoch | int | Epoch number when the deregistration occurred (nullable) | +| slot | bigint | Slot number within the epoch when the deregistration occurred (nullable) | +| block | bigint | Block number where the deregistration transaction is included (nullable) | +| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | +| update_datetime | timestamp | Date and time the record was last updated | + +## 5. delegation_vote + +| Column Name | Data Type | Description | +|-----------------|--------------|---------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | +| **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | +| address | varchar(255) | Bech32 encoded stake address of the delegator (nullable) | +| drep_hash | varchar(56) | Hash of the delegation epoch reward pool (nullable) | +| drep_id | varchar(255) | Unique identifier for the delegation epoch reward pool (nullable) | +| drep_type | varchar(40) | Type of the delegation epoch reward pool (nullable) | +| epoch | int | Epoch number for which the vote is cast (nullable) | +| credential | varchar(56) | Hash of the credential used for voting (nullable) | +| cred_type | varchar(40) | Type of credential used for voting (nullable) | +| slot | bigint | Slot number within the epoch when the vote was cast (nullable) | +| block | bigint | Block number where the delegation vote transaction is included (nullable) | +| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | +| update_datetime | timestamp | Date and time the record was last updated | + +## 6. drep_registration + +| Column Name | Data Type | Description | +|-----------------|--------------|-------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | +| **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | +| type | varchar(50) | Type of DREP registration (e.g., stake pool registration, withdrawal) | +| deposit | bigint | Amount of ADA deposited for specific registration types (nullable) | +| drep_hash | varchar(56) | Hash of the delegation epoch reward pool (nullable) | +| drep_id | varchar(255) | Unique identifier for the delegation epoch reward pool (nullable) | +| anchor_url | varchar | URL for additional information about the registration (nullable) | +| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url (nullable) | +| cred_type | varchar(40) | Type of credential used for registration (nullable) | +| epoch | int | Epoch number when the registration occurred (nullable) | +| slot | bigint | Slot number within the epoch when the registration occurred (nullable) | +| block | bigint | Block number where the registration transaction is included (nullable) | +| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | +| update_datetime | timestamp | Date and time the record was last updated | + +## 7. committee_member + +| Column Name | Data Type | Description | +|-----------------|-------------|---------------------------------------------------------------------------------------------------------| +| **hash** | varchar(56) | Unique identifier for the committee member (not null, primary key) | +| **slot** | bigint | Slot number within the blockchain where the committee member record was updated (not null, primary key) | +| cred_type | varchar(40) | Type of credential used for committee membership (nullable) | +| expired_epoch | int | Epoch number when the committee membership expires (nullable) | +| update_datetime | timestamp | Date and time the record was last updated | # VI. Live store From 61b2223837b045fbb0de23d8d74e94e8530394ba Mon Sep 17 00:00:00 2001 From: Sotatek-QuanLeA Date: Fri, 28 Jun 2024 10:35:04 +0700 Subject: [PATCH 4/8] chore: add account aggregation to schema documentation --- docs/schema.md | 76 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 67 insertions(+), 9 deletions(-) diff --git a/docs/schema.md b/docs/schema.md index 09b090fa5..9b2454d15 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -116,7 +116,7 @@ ## 1. epoch -| Column Name | Data Type | Description | +| **Column name** | **Type** | **Description** | |-------------------|-------------|-------------------------------------------------------------------------------| | **number** | bigint | Unique epoch identifier (not null, primary key) | | block_count | int | Number of blocks produced in the epoch (nullable) | @@ -133,7 +133,7 @@ ## 1. gov_action_proposal -| Column Name | Data Type | Description | +| **Column name** | **Type** | **Description** | |-----------------|--------------|-----------------------------------------------------------------------------| | **tx_hash** | varchar(64) | Unique transaction hash (not null, part of primary key) | | **idx** | int | Proposal index within the transaction (not null, part of primary key) | @@ -151,7 +151,7 @@ ## 2. voting_procedure -| Column Name | Data Type | Description | +| **Column name** | **Type** | **Description** | |------------------------|-------------|-----------------------------------------------------------------------------------| | **tx_hash** | varchar(64) | Transaction hash associated with the vote (not null, part of primary key) | | **voter_hash** | varchar(56) | Hash identifying the voter (not null, part of primary key) | @@ -171,7 +171,7 @@ ## 3. committee_registration -| Column Name | Data Type | Description | +| **Column name** | **Type** | **Description** | |-----------------|-------------|-------------------------------------------------------------------------| | **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | | **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | @@ -186,7 +186,7 @@ ## 4. committee_deregistration -| Column Name | Data Type | Description | +| **Column name** | **Type** | **Description** | |-----------------|-------------|--------------------------------------------------------------------------| | **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | | **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | @@ -202,7 +202,7 @@ ## 5. delegation_vote -| Column Name | Data Type | Description | +| **Column name** | **Type** | **Description** | |-----------------|--------------|---------------------------------------------------------------------------| | **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | | **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | @@ -220,7 +220,7 @@ ## 6. drep_registration -| Column Name | Data Type | Description | +| **Column name** | **Type** | **Description** | |-----------------|--------------|-------------------------------------------------------------------------| | **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | | **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | @@ -239,7 +239,7 @@ ## 7. committee_member -| Column Name | Data Type | Description | +| **Column name** | **Type** | **Description** | |-----------------|-------------|---------------------------------------------------------------------------------------------------------| | **hash** | varchar(56) | Unique identifier for the committee member (not null, primary key) | | **slot** | bigint | Slot number within the blockchain where the committee member record was updated (not null, primary key) | @@ -497,7 +497,65 @@ | stake_credential | varchar(56) | Bech32 stake credential associated with the address | | update_datetime | timestamp | Timestamp of the last update to this record. | -# XIII. Core table +# XIII. Account aggregation + +## 1. address_balance + +| **Column Name** | **Data Type** | **Description** | +|-----------------|---------------|--------------------------------------------------------------------------------------| +| **address** | varchar(500) | Bech32 encoded stake address or public key hash | +| **unit** | varchar(255) | Optional unit for the quantity (e.g., lovelace for ADA) | +| **slot** | bigint | Slot number within the epoch when the balance was recorded | +| quantity | numeric(38) | Numeric representation of the asset amount (nullable) | +| addr_full | text | Full address details in Cardano format (nullable) | +| policy | varchar(56) | Policy ID (fingerprint) of the off-chain asset definition | +| asset_name | varchar(255) | Optional human-readable name of the asset | +| block_hash | varchar(64) | Hash of the block where the transaction affecting the balance is included (nullable) | +| block | bigint | Block number within the Cardano blockchain (nullable) | +| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | +| epoch | integer | Epoch number when the balance was recorded | +| update_datetime | timestamp | Date and time the record was last updated | + +## 2. stake_address_balance + +| **Column Name** | **Data Type** | **Description** | +|------------------|---------------|--------------------------------------------------------------------------------------| +| **address** | varchar(255) | Bech32 encoded stake address (not null, primary key) | +| **slot** | bigint | Slot number within the epoch when the balance was recorded (not null, primary key) | +| quantity | numeric(38) | Numeric representation of the ADA balance (nullable) | +| stake_credential | varchar(56) | Stake credential associated with the address (nullable) | +| block_hash | varchar(64) | Hash of the block where the transaction affecting the balance is included (nullable) | +| block | bigint | Block number within the Cardano blockchain (nullable) | +| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | +| epoch | integer | Epoch number when the balance was recorded (nullable) | +| update_datetime | timestamp | Date and time the record was last updated | + +## 3. address_tx_amount + +| **Column Name** | **Data Type** | **Description** | +|-----------------|---------------|-----------------------------------------------------------------------------------------| +| **address** | varchar(500) | Bech32 encoded stake address or public key hash | +| **unit** | varchar(255) | Optional unit for the quantity (e.g., lovelace for ADA) | +| **tx_hash** | varchar(64) | Unique transaction hash (not null, part of primary key) | +| slot | bigint | Slot number within the epoch when the transaction occurred (nullable) | +| quantity | numeric(38) | Numeric representation of the asset amount involved in the transaction (nullable) | +| addr_full | text | Full address details in Cardano format (nullable) | +| stake_address | varchar(255) | Bech32 encoded stake address associated with the transaction (nullable) | +| block | bigint | Block number within the Cardano blockchain where the transaction is included (nullable) | +| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | +| epoch | integer | Epoch number when the transaction occurred (nullable) | + +## 4. account_config + +| **Column Name** | **Data Type** | **Description** | +|-----------------|---------------|---------------------------------------------------------------------------------------------------------------------| +| **config_id** | varchar(100) | Unique identifier for the account configuration (primary key) | +| status | varchar(50) | Current status of the account configuration (e.g., active, inactive) | +| slot | bigint | Slot number within the epoch when the account configuration was updated (nullable) | +| block | bigint | Block number within the Cardano blockchain where the transaction affecting the configuration is included (nullable) | +| block_hash | varchar(64) | Hash of the block containing the transaction affecting the configuration (nullable) | + +# XIV. Core table ## 1. cursor_ From 98ea569be74ebc0a1c4f5dac3b9dc7357a519b66 Mon Sep 17 00:00:00 2001 From: Sotatek-QuanLeA Date: Fri, 28 Jun 2024 17:17:26 +0700 Subject: [PATCH 5/8] chore: update description for schema docs --- docs/schema.md | 755 +++++++++++++++++++++++++------------------------ 1 file changed, 383 insertions(+), 372 deletions(-) diff --git a/docs/schema.md b/docs/schema.md index 9b2454d15..0bfcb7dbc 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -2,53 +2,53 @@ ## 1. assets -| **Column name** | **Type** | **Description** | -|:----------------|:-------------|:------------------------------------| -| **id** | uuid | Unique identifier of the asset | -| slot | bigint | Slot number | -| tx_hash | varchar(64) | Transaction hash | -| policy | varchar(56) | Policy id | -| asset_name | varchar(255) | Name of the asset | -| unit | varchar(255) | Unit of the asset | -| fingerprint | varchar(255) | Fingerprint of the asset | -| quantity | bigint | Quantity of the asset | -| mint_type | varchar(4) | Mint type (FR or CW)
(MINT/BURN) | -| block | bigint | Block number | -| block_time | bigint | Block time | -| update_datetime | timestamp | Datetime of update | +| **Column name** | **Type** | **Description** | +|:----------------|:-------------|:-------------------------------| +| **id** | uuid | Unique identifier of the asset | +| slot | bigint | Slot number | +| tx_hash | varchar(64) | Transaction hash | +| policy | varchar(56) | Policy id | +| asset_name | varchar(255) | Name of the asset | +| unit | varchar(255) | Unit of the asset | +| fingerprint | varchar(255) | Fingerprint of the asset | +| quantity | bigint | Quantity of the asset | +| mint_type | varchar(4) | Mint type (MINT/BURN) | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Datetime of update | # II. Block store ## 1. block -| **Column name** | **Type** | **Description** | -|:--------------------------|:---------------------|:----------------------------------------------------| -| **hash** | varchar(64) not null | Unique identifier for the block (primary key) | -| number | bigint | Block number within the chain | -| body_hash | varchar(64) | Hash of the block body data | -| body_size | integer | Size of the block body data in bytes | -| epoch | integer | Epoch (era) the block belongs to | -| total_output (null) | numeric(38) | Total output created in the block (nullable) | -| total_fees (null) | bigint | Total fees collected in the block (nullable) | -| block_time (null) | bigint | Block creation timestamp (nullable) | -| era | smallint | Era number | -| issuer_vkey | varchar(64) | Public key of the block issuer | -| leader_vrf (null) | jsonb | Leader verification result (JSON, nullable) | -| nonce_vrf (null) | jsonb | Nonce verification result (JSON, nullable) | -| prev_hash | varchar(64) | Hash of the previous block | -| protocol_version | varchar(64) | Blockchain protocol version used | -| slot | bigint | Slot number | -| vrf_result (null) | jsonb | VRF verification result (JSON, nullable) | -| vrf_vkey | varchar(64) | Public key used for VRF verification | -| no_of_txs | integer | Number of transactions in the block | -| slot_leader | varchar(56) | Public key of the slot leader | -| epoch_slot | integer | Slot number within the epoch (redundant with slot) | -| op_cert_hot_vkey (null) | varchar(64) | Hot verification public key (nullable) | -| op_cert_seq_number (null) | bigint | Sequence number for operator certificate (nullable) | -| op_cert_kes_period (null) | bigint | KES key period for operator certificate (nullable) | -| op_cert_sigma (null) | varchar(256) | Signature for operator certificate (nullable) | -| create_datetime | timestamp | Date and time the record was created | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:-------------------|:---------------------|:-----------------------------------------------------------------------------| +| **hash** | varchar(64) not null | Block hash (primary key) | +| number | bigint | Block number within the chain | +| body_hash | varchar(64) | Hash of the block body data | +| body_size | integer | Size of the block body data in bytes | +| epoch | integer | Epoch no of the block | +| total_output | numeric(38) | Total output created in the block | +| total_fees | bigint | Total fees collected in the block | +| block_time | bigint | Block creation timestamp | +| era | smallint | Era number | +| issuer_vkey | varchar(64) | Public key of the block issuer | +| leader_vrf | jsonb | Leader verification result (JSON, nullable) | +| nonce_vrf | jsonb | Nonce verification result (JSON, nullable) | +| prev_hash | varchar(64) | Hash of the previous block | +| protocol_version | varchar(64) | Blockchain protocol version used | +| slot | bigint | Slot number | +| vrf_result | jsonb | VRF verification result (JSON, nullable) | +| vrf_vkey | varchar(64) | The VRF key of the creator of this block | +| no_of_txs | integer | The number of transactions in this block | +| slot_leader | varchar(56) | The hash of of the block producer identifier | +| epoch_slot | integer | The slot number within an epoch (resets to zero at the start of each epoch). | +| op_cert_hot_vkey | varchar(64) | The hash of the operational certificate of the block producer | +| op_cert_seq_number | bigint | The value of the counter used to produce the operational certificate | +| op_cert_kes_period | bigint | KES key period for operator certificate | +| op_cert_sigma | varchar(256) | Signature for operator certificate | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | ## 2. rollback @@ -91,132 +91,132 @@ ## 3. epoch_param -| **Column name** | **Type** | **Description** | -|:----------------|:------------|:---------------------------------------------| -| **epoch** | integer | Epoch number (not null) | -| params | jsonb | JSON document containing epoch parameters | -| cost_model_hash | varchar(64) | Hash of the associated cost model (nullable) | -| slot | bigint | Slot number within the epoch | -| block | bigint | Block number | -| block_time | bigint | Block creation timestamp | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:----------------------------------------------------------------------| +| **epoch** | integer | The first epoch for which these parameters are valid. (not null) | +| params | jsonb | JSON document containing epoch parameters | +| cost_model_hash | varchar(64) | The hash of cost model. It ensures uniqueness of entries. New in v13. | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_time | bigint | Block creation timestamp | +| update_datetime | timestamp | Date and time the record was last updated | ## 4. cost_model -| **Column name** | **Type** | **Description** | -|:----------------|:------------|:------------------------------------------| -| **hash** | varchar(64) | Unique cost model hash (not null) | -| costs | jsonb | JSON document containing cost details | -| slot | bigint | Slot number within the epoch | -| block | bigint | Block number | -| block_time | bigint | Block creation timestamp | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:---------------------------------------------------------------------------------| +| **hash** | varchar(64) | The hash of cost model. It ensures uniqueness of entries. New in v13. (not null) | +| costs | jsonb | The actual costs formatted as json | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_time | bigint | Block creation timestamp | +| update_datetime | timestamp | Date and time the record was last updated | # IV Epoch aggregation ## 1. epoch -| **Column name** | **Type** | **Description** | -|-------------------|-------------|-------------------------------------------------------------------------------| -| **number** | bigint | Unique epoch identifier (not null, primary key) | -| block_count | int | Number of blocks produced in the epoch (nullable) | -| transaction_count | bigint | Number of transactions included in the epoch (nullable) | -| total_output | numeric(38) | Total amount of ADA distributed as outputs in the epoch (nullable) | -| total_fees | bigint | Total amount of ADA collected in transaction fees during the epoch (nullable) | -| start_time | bigint | Unix timestamp representing the start time of the epoch (nullable) | -| end_time | bigint | Unix timestamp representing the end time of the epoch (nullable) | -| max_slot | bigint | Maximum slot number reached within the epoch (nullable) | -| create_datetime | timestamp | Date and time the record was created | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|-------------------|-------------|----------------------------------------------------------------------| +| **number** | bigint | The epoch number | +| block_count | int | The number of blocks in this epoch | +| transaction_count | bigint | The number of transactions in this epoch | +| total_output | numeric(38) | The sum of the transaction output values (in Lovelace) in this epoch | +| total_fees | bigint | The sum of the fees (in Lovelace) in this epoch | +| start_time | bigint | The epoch start time | +| end_time | bigint | The epoch end time | +| max_slot | bigint | The slot of the last block in the epoch | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | # V. Governance store ## 1. gov_action_proposal -| **Column name** | **Type** | **Description** | -|-----------------|--------------|-----------------------------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique transaction hash (not null, part of primary key) | -| **idx** | int | Proposal index within the transaction (not null, part of primary key) | -| deposit | bigint | Amount of ADA required to deposit a vote on the proposal (nullable) | -| return_address | varchar(255) | Address to which remaining ADA will be returned after voting (nullable) | -| anchor_url | varchar | URL for additional information about the proposal (nullable) | -| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url (nullable) | -| type | varchar(50) | Type of governance action proposed (e.g., updateProposal, withdrawProposal) | -| details | jsonb | JSON document containing details about the proposal (nullable) | -| epoch | int | Epoch number when the proposal was submitted (nullable) | -| slot | bigint | Slot number within the epoch when the proposal was submitted (nullable) | -| block | bigint | Block number where the proposal transaction is included (nullable) | -| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|-----------------|--------------|---------------------------------------------------------------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | The hash of the tx that includes this certificate | +| **idx** | int | The index of this proposal procedure within its transaction | +| deposit | bigint | The deposit amount payed for this proposal (in lovelace) | +| return_address | varchar(255) | The StakeAddress index of the reward address to receive the deposit when it is repaid | +| anchor_url | varchar | URL for additional information about the proposal | +| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url | +| type | varchar(50) | Can be one of ParameterChange, HardForkInitiation, TreasuryWithdrawals, NoConfidence, NewCommittee, NewConstitution, InfoAction | +| details | jsonb | JSON document describing the content of governance action | +| epoch | int | Epoch number | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | ## 2. voting_procedure -| **Column name** | **Type** | **Description** | -|------------------------|-------------|-----------------------------------------------------------------------------------| -| **tx_hash** | varchar(64) | Transaction hash associated with the vote (not null, part of primary key) | -| **voter_hash** | varchar(56) | Hash identifying the voter (not null, part of primary key) | -| **gov_action_tx_hash** | varchar(64) | Transaction hash of the corresponding governance action proposal (nullable) | -| **gov_action_index** | int | Index of the proposal within the governance action transaction (nullable) | -| id | uuid | Unique identifier (not null, primary key) | -| idx | int | Index of the voting option within the transaction (not null, part of primary key) | -| voter_type | varchar(50) | Type of voter (e.g., stake pool, delegation certificate) | -| vote | varchar(10) | Cast vote (e.g., "yes", "no", "abstain") | -| anchor_url | varchar | URL for additional information about the vote (nullable) | -| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url (nullable) | -| epoch | int | Epoch number when the vote was cast (nullable) | -| slot | bigint | Slot number within the epoch when the vote was cast (nullable) | -| block | bigint | Block number where the voting transaction is included (nullable) | -| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|------------------------|-------------|-------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | Transaction hash of the tx that includes this VotingProcedure | +| **voter_hash** | varchar(56) | Hash identifying the voter (not null, part of primary key) | +| **gov_action_tx_hash** | varchar(64) | Transaction hash of the governance action | +| **gov_action_index** | int | The index of this proposal procedure within its transaction | +| id | uuid | Unique identifier | +| idx | int | The index of this VotingProcedure within this transaction | +| voter_type | varchar(50) | The role of the voter. Can be one of ConstitutionalCommittee, DRep, SPO | +| vote | varchar(10) | The Vote. Can be one of Yes, No, Abstain | +| anchor_url | varchar | URL for additional information about the vote | +| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url | +| epoch | int | Epoch number | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | ## 3. committee_registration -| **Column name** | **Type** | **Description** | -|-----------------|-------------|-------------------------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | -| **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | -| cold_key | varchar | Public key for the cold wallet (nullable) | -| hot_key | varchar | Public key for the hot wallet (nullable) | -| cred_type | varchar(40) | Type of credential used for registration (nullable) | -| epoch | int | Epoch number when the registration occurred (nullable) | -| slot | bigint | Slot number within the epoch when the registration occurred (nullable) | -| block | bigint | Block number where the registration transaction is included (nullable) | -| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|-----------------|-------------|----------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | The hash of the tx that includes this certificate | +| **cert_index** | int | The index of this registration within the certificates of this transaction | +| cold_key | varchar | The reference to the registered cold key hash id | +| hot_key | varchar | The reference to the registered hot key hash id | +| cred_type | varchar(40) | Type of credential used for registration (ADDR_KEYHASH, SCRIPTHASH) | +| epoch | int | Epoch number | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | ## 4. committee_deregistration -| **Column name** | **Type** | **Description** | -|-----------------|-------------|--------------------------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | -| **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | -| anchor_url | varchar | URL for additional information about the deregistration (nullable) | -| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url (nullable) | -| cold_key | varchar(64) | Public key for the cold wallet (not null) | -| cred_type | varchar(40) | Type of credential used for deregistration (nullable) | -| epoch | int | Epoch number when the deregistration occurred (nullable) | -| slot | bigint | Slot number within the epoch when the deregistration occurred (nullable) | -| block | bigint | Block number where the deregistration transaction is included (nullable) | -| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|-----------------|-------------|----------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | The hash of the tx that includes this certificate | +| **cert_index** | int | The index of this registration within the certificates of this transaction | +| anchor_url | varchar | URL for additional information about the deregistration | +| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url | +| cold_key | varchar(64) | Public key for the cold wallet (not null) | +| cred_type | varchar(40) | Type of credential used for registration (ADDR_KEYHASH, SCRIPTHASH) | +| epoch | int | Epoch number | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | ## 5. delegation_vote -| **Column name** | **Type** | **Description** | -|-----------------|--------------|---------------------------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | -| **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | -| address | varchar(255) | Bech32 encoded stake address of the delegator (nullable) | -| drep_hash | varchar(56) | Hash of the delegation epoch reward pool (nullable) | -| drep_id | varchar(255) | Unique identifier for the delegation epoch reward pool (nullable) | -| drep_type | varchar(40) | Type of the delegation epoch reward pool (nullable) | -| epoch | int | Epoch number for which the vote is cast (nullable) | -| credential | varchar(56) | Hash of the credential used for voting (nullable) | -| cred_type | varchar(40) | Type of credential used for voting (nullable) | -| slot | bigint | Slot number within the epoch when the vote was cast (nullable) | -| block | bigint | Block number where the delegation vote transaction is included (nullable) | -| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|-----------------|--------------|----------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | The hash of the tx that includes this certificate | +| **cert_index** | int | The index of this registration within the certificates of this transaction | +| address | varchar(255) | Bech32 encoded stake address of the delegator | +| drep_hash | varchar(56) | Drep hash for the pool being delegated to | +| drep_id | varchar(255) | Unique identifier for a delegated representative (Bech32) | +| drep_type | varchar(40) | Type of drep (ADDR_KEYHASH, SCRIPTHASH, ABSTAIN, NO_CONFIDENCE) | +| epoch | int | Epoch number | +| credential | varchar(56) | Hash of the credential used for voting | +| cred_type | varchar(40) | Type of credential used for registration (ADDR_KEYHASH, SCRIPTHASH) | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | ## 6. drep_registration @@ -225,27 +225,27 @@ | **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | | **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | | type | varchar(50) | Type of DREP registration (e.g., stake pool registration, withdrawal) | -| deposit | bigint | Amount of ADA deposited for specific registration types (nullable) | -| drep_hash | varchar(56) | Hash of the delegation epoch reward pool (nullable) | -| drep_id | varchar(255) | Unique identifier for the delegation epoch reward pool (nullable) | -| anchor_url | varchar | URL for additional information about the registration (nullable) | -| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url (nullable) | -| cred_type | varchar(40) | Type of credential used for registration (nullable) | -| epoch | int | Epoch number when the registration occurred (nullable) | -| slot | bigint | Slot number within the epoch when the registration occurred (nullable) | -| block | bigint | Block number where the registration transaction is included (nullable) | -| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | +| deposit | bigint | Amount of ADA deposited for specific registration types | +| drep_hash | varchar(56) | Drep hash for the pool being delegated to | +| drep_id | varchar(255) | Unique identifier for a delegated representative (Bech32) | +| anchor_url | varchar | URL for additional information about the registration | +| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url | +| cred_type | varchar(40) | Type of credential used for registration (ADDR_KEYHASH, SCRIPTHASH) | +| epoch | int | Epoch number | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_time | bigint | Block time | | update_datetime | timestamp | Date and time the record was last updated | ## 7. committee_member -| **Column name** | **Type** | **Description** | -|-----------------|-------------|---------------------------------------------------------------------------------------------------------| -| **hash** | varchar(56) | Unique identifier for the committee member (not null, primary key) | -| **slot** | bigint | Slot number within the blockchain where the committee member record was updated (not null, primary key) | -| cred_type | varchar(40) | Type of credential used for committee membership (nullable) | -| expired_epoch | int | Epoch number when the committee membership expires (nullable) | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|-----------------|-------------|---------------------------------------------------------------------| +| **hash** | varchar(56) | The cold key of committee member | +| **slot** | bigint | Slot number | +| cred_type | varchar(40) | Type of credential used for registration (ADDR_KEYHASH, SCRIPTHASH) | +| expired_epoch | int | The epoch this member expires | +| update_datetime | timestamp | Date and time the record was last updated | # VI. Live store @@ -257,17 +257,17 @@ ## 1. transaction_metadata -| **Column name** | **Type** | **Description** | -|:----------------|:-------------|:-------------------------------------------------------------------------| -| **id** | uuid | Unique identifier (primary key) | -| slot | bigint | Slot number of the block containing the transaction | -| tx_hash | varchar(64) | Unique hash identifier of the transaction | -| label | varchar(255) | Optional human-readable label associated with the transaction | -| body | text | Transaction data in plain text format (optional) | -| cbor | text | Transaction data in CBOR ( Concise Binary Object Representation ) format | -| block | bigint | Block number containing the transaction | -| block_time | bigint | Timestamp (in epoch seconds) of the block containing the transaction | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:----------------|:-------------|:---------------------------------------------------| +| **id** | uuid | Unique identifier (primary key) | +| slot | bigint | Slot number | +| tx_hash | varchar(64) | The hash identifier of the transaction | +| label | varchar(255) | The metadata key (a Word64/unsigned 64 bit number) | +| body | text | The JSON payload if it can be decoded as JSON | +| cbor | text | The raw bytes of the payload | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | # VIII. Mir store @@ -293,191 +293,202 @@ ## 1. script -| **Column name** | **Type** | **Description** | -|:----------------|:------------|:-----------------------------------------------------------| -| **script_hash** | varchar(56) | Unique identifier for the script (primary key) | -| script_type | varchar(30) | Type of the script (e.g., locking script, spending script) | -| content | jsonb | JSON document containing the script details | -| create_datetime | timestamp | Date and time the record was created | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:--------------------------------------------------------------------------| +| **script_hash** | varchar(56) | The Hash of the Script | +| script_type | varchar(30) | The type of the script. This is currenttly either 'timelock' or 'plutus'. | +| content | jsonb | JSON representation of the timelock script, null for other script type | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | ## 2. transaction_scripts -| **Column name** | **Type** | **Description** | -|:------------------|:------------|:------------------------------------------------------------------| -| id | uuid | Unique identifier (primary key) | -| slot | bigint | Slot number of the block containing the transaction | -| block_hash | varchar(64) | Hash of the block containing the transaction | -| tx_hash | varchar(64) | Unique identifier for the transaction (not null) | -| script_hash | varchar(56) | Hash of the transaction script | -| script_type | smallint | Type of the transaction script (numerical code) | -| datum_hash | varchar(64) | Hash of the transaction data | -| redeemer_cbor | text | CBOR encoded redemption script | -| unit_mem | bigint | Memory units consumed by the transaction | -| unit_steps | bigint | Computation steps used by the transaction | -| purpose | varchar(20) | Purpose of the transaction (e.g., payment, delegation) | -| redeemer_index | smallint | Index of the redeemer within the transaction | -| redeemer_datahash | varchar(64) | Hash of the transaction redeemer data | -| block | bigint | Block number (unique identifier for the block) | -| block_time | bigint | Timestamp of the block containing the transaction (in epoch time) | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:------------------|:------------|:-------------------------------------------------------------------------------------------------------------------------| +| **id** | uuid | Unique identifier (primary key) | +| slot | bigint | Slot number | +| block_hash | varchar(64) | Hash of the block | +| tx_hash | varchar(64) | The hash identifier of the transaction | +| script_hash | varchar(56) | The script hash this redeemer is used for | +| script_type | smallint | Type of the script (NATIVE_SCRIPT(0), PLUTUS_V1(1), PLUTUS_V2(2), PLUTUS_V3(3)) | +| datum_hash | varchar(64) | The Hash of the datum | +| redeemer_cbor | text | Redeemer encoded in CBOR format | +| unit_mem | bigint | The budget in Memory to run a script | +| unit_steps | bigint | The budget in Cpu steps to run a script | +| purpose | varchar(20) | What kind pf validation this redeemer is used for. It can be one of 'spend', 'mint', 'cert', 'reward', voting, proposing | +| redeemer_index | smallint | The index of the redeemer pointer in the transaction | +| redeemer_datahash | varchar(64) | The Hash of the Plutus Data | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | ## 3. datum -| **Column name** | **Type** | **Description** | -|:----------------|:------------|:---------------------------------------------| -| **hash** | varchar(64) | Unique identifier (primary key) | -| datum | text | The actual data content | -| created_at_tx | varchar(64) | Transaction hash where the datum was created | -| create_datetime | timestamp | Date and time the record was created | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:----------------------------------------------------------| +| **hash** | varchar(64) | The Hash of the datum | +| datum | text | The actual data in CBOR format | +| created_at_tx | varchar(64) | Transaction hash where this script first became available | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | # X. Staking store ## 1. stake_registration -| **Column name** | **Type** | **Description** | -|:----------------|:-------------|:------------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique identifier for the transaction (not null) | -| **cert_index** | int | Index of the certificate within the transaction (not null) | -| credential | varchar(56) | Stake credential (not null) | -| type | varchar(50) | Type of stake registration (e.g., delegation, registration) | -| address | varchar(255) | Bech32 encoded stake address | -| epoch | int | Epoch number associated with the registration | -| slot | bigint | Slot number within the epoch | -| block_hash | varchar(64) | Hash of the block containing the transaction | -| block | bigint | Block number (unique identifier for the block) | -| block_time | bigint | Timestamp of the block in milliseconds since epoch | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:----------------|:-------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | The hash identifier of the transaction | +| **cert_index** | int | The index of this stake registration within the certificates of this transaction | +| credential | varchar(56) | Stake credential (not null) | +| type | varchar(50) | Type of stake registration (STAKE_REGISTRATION,STAKE_DEREGISTRATION,STAKE_DELEGATION,POOL_REGISTRATION,POOL_RETIREMENT,GENESIS_KEY_DELEGATION,MOVE_INSTATENEOUS_REWARDS_CERT,REG_CERT,UNREG_CERT,VOTE_DELEG_CERT,STAKE_VOTE_DELEG_CERT,STAKE_REG_DELEG_CERT,VOTE_REG_DELEG_CERT,STAKE_VOTE_REG_DELEG_CERT,AUTH_COMMITTEE_HOT_CERT,RESIGN_COMMITTEE_COLD_CERT,REG_DREP_CERT,UNREG_DREP_CERT,UPDATE_DREP_CERT) | +| address | varchar(255) | The Bech32 encoded version of the stake address | +| epoch | int | The epoch in which the registration took place | +| slot | bigint | Slot number | +| block_hash | varchar(64) | Hash of the block | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | ## 2. delegation -| **Column name** | **Type** | **Description** | -|:----------------|:-------------|:------------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique identifier for the transaction (not null) | -| **cert_index** | int | Index of the certificate within the transaction (not null) | -| credential | varchar(56) | Stake credential (not null) | -| type | varchar(50) | Type of stake registration (e.g., delegation, registration) | -| address | varchar(255) | Bech32 encoded stake address | -| epoch | int | Epoch number associated with the registration | -| slot | bigint | Slot number within the epoch | -| block_hash | varchar(64) | Hash of the block containing the transaction | -| block | bigint | Block number (unique identifier for the block) | -| block_time | bigint | Timestamp of the block in milliseconds since epoch | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column Name** | **Data Type** | **Description** | +|-----------------|---------------|----------------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | The hash identifier of the transaction | +| **cert_index** | int | The index of this stake registration within the certificates of this transaction | +| credential | varchar(56) | Delegation credential | +| pool_id | varchar(56) | The raw bytes of the pool hash | +| address | varchar(255) | The Bech32 encoded version of the stake address | +| epoch | int | The epoch number where this delegation becomes active | +| slot | bigint | The slot number of the block that contained this delegation | +| block_hash | varchar(64) | Hash of the block | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | ## 3. pool_registration -| **Column name** | **Type** | **Description** | -|:----------------|:---------------|:--------------------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique transaction hash (not null) | -| **cert_index** | int | Index of the certificate within the transaction (not null) | -| pool_id | varchar(56) | Hash of the registered stake pool | -| vrf_key | varchar(64) | Verifiable random function key for the pool | -| pledge | numeric(20,0) | Amount of ADA pledged to the pool | -| cost | numeric(20, 0) | Operational cost of the pool per epoch | -| margin | decimal(10, 8) | Stake pool deposit margin | -| reward_account | varchar(255) | Address of the reward account for the pool | -| pool_owners | jsonb | JSON document containing information about pool owners | -| relays | jsonb | JSON document containing information about pool relays | -| metadata_url | text | URL to the pool's metadata | -| metadata_hash | varchar(64) | Hash of the pool's metadata | -| epoch | int | Cardano epoch number when the registration occurred | -| slot | bigint | Slot number within the epoch when the registration occurred | -| block_hash | varchar(64) | Hash of the block containing the registration transaction | -| block | bigint | Block number within the Cardano blockchain | -| block_time | bigint | Unix timestamp of the block containing the registration transaction | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:----------------|:---------------|:---------------------------------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | The hash identifier of the transaction | +| **cert_index** | int | The index of this stake registration within the certificates of this transaction | +| pool_id | varchar(56) | The raw bytes of the pool hash | +| vrf_key | varchar(64) | The hash of the pool's VRF key | +| pledge | numeric(20,0) | The amount (in Lovelace) the pool owner pledges to the pool | +| cost | numeric(20, 0) | The fixed per epoch fee (in ADA) this pool charges | +| margin | decimal(10, 8) | The margin (as a percentage) this pool charges | +| reward_account | varchar(255) | Address of the reward account for the pool | +| pool_owners | jsonb | The Bech32 encoded version for the pool owner's stake address | +| relays | jsonb | JSON document containing information about pool relays (dns_name, dns_srv_name, ipv4, ipv6, port ) | +| metadata_url | text | The URL for the location of the off-chain data | +| metadata_hash | varchar(64) | The expected hash for the off-chain data | +| epoch | int | Epoch number | +| slot | bigint | Slot number | +| block_hash | varchar(64) | Hash of the block | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | ## 4.pool_retirement -| **Column name** | **Type** | **Description** | -|:-----------------|:------------|:-----------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique transaction hash (not null) | -| **cert_index** | int | Index of the certificate within the transaction (not null) | -| pool_id | varchar(56) | Hash of the retiring stake pool | -| retirement_epoch | int | Epoch at which the pool retires | -| epoch | int | Current epoch | -| slot | bigint | Slot number within the epoch | -| block_hash | varchar(64) | Hash of the block containing the retirement transaction | -| block | bigint | Block number (unique identifier for the block) | -| block_time | bigint | Timestamp of the block in seconds since epoch | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:-----------------|:------------|:---------------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | The hash identifier of the transaction | +| **cert_index** | int | The index of this stake registration within the certificates of this transaction | +| pool_id | varchar(56) | The raw bytes of the pool hash | +| retirement_epoch | int | The epoch where this pool retires | +| epoch | int | Current epoch | +| slot | bigint | Slot number | +| block_hash | varchar(64) | Hash of the block | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | # XI. Transaction store ## 1. transaction -| **Column name** | **Type** | **Description** | -|:-----------------|:------------|:-----------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique transaction hash (not null) | -| **cert_index** | int | Index of the certificate within the transaction (not null) | -| pool_id | varchar(56) | Hash of the retiring stake pool | -| retirement_epoch | int | Epoch at which the pool retires | -| epoch | int | Current epoch | -| slot | bigint | Slot number within the epoch | -| block_hash | varchar(64) | Hash of the block containing the retirement transaction | -| block | bigint | Block number (unique identifier for the block) | -| block_time | bigint | Timestamp of the block in seconds since epoch | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column Name** | **Data Type** | **Description** | +|-------------------------|---------------|--------------------------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | The hash identifier of the transaction | +| auxiliary_datahash | varchar(64) | Hash of the transaction's auxiliary data | +| block_hash | varchar(64) | The hash identifier of the block | +| collateral_inputs | jsonb | JSON document containing details about collateral inputs | +| collateral_return | jsonb | JSON document containing details about collateral returned | +| fee | bigint | The fees paid for this transaction | +| inputs | jsonb | JSON document containing details about transaction inputs | +| invalid | boolean | Flag indicating whether the transaction is valid or invalid | +| network_id | smallint | The network identifier (0 for testnet, 1 for mainnet) | +| outputs | jsonb | JSON document containing details about transaction outputs | +| reference_inputs | jsonb | JSON document containing details about reference inputs (nullable) | +| required_signers | jsonb | JSON document containing information about required signers for the transaction (nullable) | +| script_datahash | varchar(64) | Hash of the transaction script data (nullable) | +| slot | bigint | Slot number within the epoch when the transaction was included (nullable) | +| total_collateral | bigint | Total amount of collateral involved in the transaction (nullable) | +| ttl | bigint | Transaction time-to-live (nullable) | +| validity_interval_start | bigint | Start time of the transaction's validity interval (nullable) | +| collateral_return_json | jsonb | JSON document containing details about collateral return (alternative format, nullable) | +| block | bigint | Block number within the Cardano blockchain where the transaction is included (nullable) | +| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | +| update_datetime | timestamp | Date and time the record was last updated | ## 2. transaction_witness -| **Column name** | **Type** | **Description** | -|:----------------|:-------------|:---------------------------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique hash identifier of the transaction (not null) | -| **idx** | integer | Index of the witness within the transaction (not null) | -| pub_key | varchar(128) | Public key used for signing the transaction (optional) | -| signature | varchar(128) | Signature of the transaction data (optional) | -| pub_keyhash | varchar(56) | Hash of the public key (optional) | -| type | varchar(40) | Type of witness (e.g., stake witness, voting witness) | -| additional_data | jsonb | Additional data specific to the witness type (optional) | -| slot | bigint | Slot number where the transaction is included in the blockchain (optional) | +| **Column name** | **Type** | **Description** | +|:----------------|:-------------|:----------------------------------------------------------------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | The hash identifier of the transaction | +| **idx** | integer | Index of the witness within the transaction | +| pub_key | varchar(128) | Public key used for signing the transaction | +| signature | varchar(128) | Signature of the transaction data | +| pub_keyhash | varchar(56) | Hash of the public key | +| type | varchar(40) | Type of witness (BOOTSTRAP_WITNESS,VKEY_WITNESS,BYRON_PK_WITNESS,BYRON_REDEEM_WITNESS,BYRON_SCRIPT_WITNESS,BYRON_UNKNOWN_WITNESS) | +| additional_data | jsonb | Additional data specific to the witness type | +| slot | bigint | Slot number | ## 3. withdrawal -| **Column name** | **Type** | **Description** | -|:----------------|:-------------|:--------------------------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique transaction hash for the withdrawal | -| **address** | varchar(255) | Wallet address from which funds were withdrawn | -| amount | numeric(38) | Amount of cryptocurrency withdrawn (supports decimals) | -| epoch | integer | Epoch number during which the withdrawal occurred | -| slot | bigint | Slot number within the epoch when the withdrawal occurred | -| block | bigint | Block number on the blockchain containing the withdrawal transaction | -| block_time | bigint | Timestamp (epoch time) of the block containing the withdrawal transaction | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:----------------|:-------------|:--------------------------------------------------| +| **tx_hash** | varchar(64) | The hash identifier of the transaction | +| **address** | varchar(255) | The stake address for which the withdrawal is for | +| amount | numeric(38) | The withdrawal amount (in Lovelace) | +| epoch | integer | Epoch number | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | ## 4. invalid_transaction -| **Column name** | **Type** | **Description** | -|:----------------|:------------|:----------------------------------------------------------------------------------| -| tx_hash | varchar(64) | Unique transaction hash (not null, primary key) | -| slot | bigint | Slot number of the block where the invalid transaction was encountered (not null) | -| block_hash | varchar(64) | Hash of the block containing the invalid transaction | -| transaction | jsonb | JSON document containing the raw invalid transaction data | -| create_datetime | timestamp | Date and time the record was created | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:----------------------------------------------------------| +| **tx_hash** | varchar(64) | The hash identifier of the transaction | +| slot | bigint | Slot number | +| block_hash | varchar(64) | Hash of the block containing the invalid transaction | +| transaction | jsonb | JSON document containing the raw invalid transaction data | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | # XII. Utxo store ## 1. address_utxo -| **Column name** | **Type** | **Description** | -|:-----------------|:------------|:--------------------------------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique identifier for the transaction containing the UTXO (not null) | -| **output_index** | smallint | Index of the output within the transaction. Primary key with tx_hash (not null) | -| slot | bigint | Slot number in which the transaction was included in a block. | -| block_hash | varchar(64) | Unique identifier for the block containing the transaction | -| epoch | integer | Epoch number when the transaction was included in a block | -| lovelace_amount | bigint | Amount of lovelace in the UTXO (null if lovelace amount is zero) | -| amounts | jsonb | Object containing the amount of each multi-asset coin in the UTXO. | +| **Column name** | **Type** | **Description** | +|:-----------------|:------------|:-----------------------------------------------------------------------------| +| **tx_hash** | varchar(64) | The hash identifier of the transaction that contains this transaction output | +| **output_index** | smallint | The index of this transaction output with the transaction | +| slot | bigint | Slot number | +| block_hash | varchar(64) | Hash of the block | +| epoch | integer | Epoch number | +| lovelace_amount | bigint | The output value (in Lovelace) of the transaction output | +| amounts | jsonb | Object containing the amount of each multi-asset coin in the UTXO. | ## 2. tx_input | **Column name** | **Type** | **Description** | |:--------------------|:------------|:--------------------------------------------------------------------| -| **output_index** | smallint | Index of the output within the spending transaction (not null) | -| **tx_hash** | varchar(64) | Unique identifier for the transaction that spent the UTXO. | +| **tx_hash** | varchar(64) | The hash identifier of the transaction | +| **output_index** | smallint | The index within the transaction outputs | | spend_at_slot | bigint | Slot number in which the UTXO was spent | | spent_at_block | bigint | Block number in which the UTXO was spent | | spent_at_block_hash | varchar(64) | Unique identifier for the block containing the spending transaction | @@ -501,74 +512,74 @@ ## 1. address_balance -| **Column Name** | **Data Type** | **Description** | -|-----------------|---------------|--------------------------------------------------------------------------------------| -| **address** | varchar(500) | Bech32 encoded stake address or public key hash | -| **unit** | varchar(255) | Optional unit for the quantity (e.g., lovelace for ADA) | -| **slot** | bigint | Slot number within the epoch when the balance was recorded | -| quantity | numeric(38) | Numeric representation of the asset amount (nullable) | -| addr_full | text | Full address details in Cardano format (nullable) | -| policy | varchar(56) | Policy ID (fingerprint) of the off-chain asset definition | -| asset_name | varchar(255) | Optional human-readable name of the asset | -| block_hash | varchar(64) | Hash of the block where the transaction affecting the balance is included (nullable) | -| block | bigint | Block number within the Cardano blockchain (nullable) | -| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | -| epoch | integer | Epoch number when the balance was recorded | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column Name** | **Data Type** | **Description** | +|-----------------|---------------|-----------------------------------------------------------| +| **address** | varchar(500) | Bech32 encoded address | +| **unit** | varchar(255) | The unit for the quantity (e.g., lovelace for ADA) | +| **slot** | bigint | Slot number | +| quantity | numeric(38) | Numeric representation of the asset amount | +| addr_full | text | Full address details in Cardano format | +| policy | varchar(56) | Policy ID (fingerprint) of the off-chain asset definition | +| asset_name | varchar(255) | Optional human-readable name of the asset | +| block_hash | varchar(64) | Hash of the block | +| block | bigint | Block number | +| block_time | bigint | Block time | +| epoch | integer | Epoch number | +| update_datetime | timestamp | Date and time the record was last updated | ## 2. stake_address_balance -| **Column Name** | **Data Type** | **Description** | -|------------------|---------------|--------------------------------------------------------------------------------------| -| **address** | varchar(255) | Bech32 encoded stake address (not null, primary key) | -| **slot** | bigint | Slot number within the epoch when the balance was recorded (not null, primary key) | -| quantity | numeric(38) | Numeric representation of the ADA balance (nullable) | -| stake_credential | varchar(56) | Stake credential associated with the address (nullable) | -| block_hash | varchar(64) | Hash of the block where the transaction affecting the balance is included (nullable) | -| block | bigint | Block number within the Cardano blockchain (nullable) | -| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | -| epoch | integer | Epoch number when the balance was recorded (nullable) | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column Name** | **Data Type** | **Description** | +|------------------|---------------|-------------------------------------------------------------| +| **address** | varchar(255) | Bech32 encoded stake address | +| **slot** | bigint | Slot number | +| quantity | numeric(38) | Numeric representation of the lovelace | +| stake_credential | varchar(56) | Stake credential associated with the address | +| block_hash | varchar(64) | Hash of the block | +| block | bigint | Block number | +| block_time | bigint | Unix timestamp representing the time the block was produced | +| epoch | integer | Epoch number | +| update_datetime | timestamp | Date and time the record was last updated | ## 3. address_tx_amount -| **Column Name** | **Data Type** | **Description** | -|-----------------|---------------|-----------------------------------------------------------------------------------------| -| **address** | varchar(500) | Bech32 encoded stake address or public key hash | -| **unit** | varchar(255) | Optional unit for the quantity (e.g., lovelace for ADA) | -| **tx_hash** | varchar(64) | Unique transaction hash (not null, part of primary key) | -| slot | bigint | Slot number within the epoch when the transaction occurred (nullable) | -| quantity | numeric(38) | Numeric representation of the asset amount involved in the transaction (nullable) | -| addr_full | text | Full address details in Cardano format (nullable) | -| stake_address | varchar(255) | Bech32 encoded stake address associated with the transaction (nullable) | -| block | bigint | Block number within the Cardano blockchain where the transaction is included (nullable) | -| block_time | bigint | Unix timestamp representing the time the block was produced (nullable) | -| epoch | integer | Epoch number when the transaction occurred (nullable) | +| **Column Name** | **Data Type** | **Description** | +|-----------------|---------------|------------------------------------------------------------------------| +| **address** | varchar(500) | Bech32 encoded address | +| **unit** | varchar(255) | Optional unit for the quantity (e.g., lovelace for ADA) | +| **tx_hash** | varchar(64) | The hash identifier of the transaction | +| slot | bigint | Slot number | +| quantity | numeric(38) | Numeric representation of the asset amount involved in the transaction | +| addr_full | text | Full address details in Cardano format | +| stake_address | varchar(255) | Bech32 encoded stake address associated with the transaction | +| block | bigint | Block number | +| block_time | bigint | Unix timestamp representing the time the block was produced | +| epoch | integer | Epoch number when the transaction occurred | ## 4. account_config -| **Column Name** | **Data Type** | **Description** | -|-----------------|---------------|---------------------------------------------------------------------------------------------------------------------| -| **config_id** | varchar(100) | Unique identifier for the account configuration (primary key) | -| status | varchar(50) | Current status of the account configuration (e.g., active, inactive) | -| slot | bigint | Slot number within the epoch when the account configuration was updated (nullable) | -| block | bigint | Block number within the Cardano blockchain where the transaction affecting the configuration is included (nullable) | -| block_hash | varchar(64) | Hash of the block containing the transaction affecting the configuration (nullable) | +| **Column Name** | **Data Type** | **Description** | +|-----------------|---------------|----------------------------------------------------------------| +| **config_id** | varchar(100) | Unique identifier for the account configuration | +| status | varchar(50) | Current status of the account configuration (BALANCE_SNAPSHOT) | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_hash | varchar(64) | Hash of the block | # XIV. Core table ## 1. cursor_ -| **Column name** | **Type** | **Description** | -|:----------------|:------------|:------------------------------------------------------------------------------| -| **id** | integer | Unique identifier (not null)
Id của service dùng cursor_ (all, account,..) | -| **block_hash** | varchar(64) | Hash of the block associated with the cursor position | -| slot | bigint | Slot number | -| block_number | bigint | Block number (unique identifier for the block) | -| era | int | Era identifier | -| prev_block_hash | varchar(64) | Hash of the previous block | -| create_datetime | timestamp | Date and time the record was created | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:---------------------------------------------------| +| **id** | integer | Unique identifier
Id of the service use cursor_ | +| **block_hash** | varchar(64) | Hash of the block | +| slot | bigint | Slot number | +| block_number | bigint | Block number | +| era | int | Era identifier | +| prev_block_hash | varchar(64) | Hash of the previous block | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | ## 2. era @@ -586,11 +597,11 @@ Babbage(6), Conway(7); -| **Column name** | **Type** | **Description** | -|:----------------|:------------|:----------------------------------------------------------| -| **era** | int | Era identifier (unique integer value, primary key) | -| start_slot | bigint | Slot number at which the era begins | -| block | bigint | Block number that marks the start of the era | -| block_hash | varchar(64) | Hash of the block that starts the era (unique identifier) | +| **Column name** | **Type** | **Description** | +|:----------------|:------------|:---------------------------------------------| +| **era** | int | Era identifier | +| start_slot | bigint | Slot number at which the era begins | +| block | bigint | Block number that marks the start of the era | +| block_hash | varchar(64) | Hash of the block that starts the era | From 0f6141219ad3448be0f46951459a03b8bd1c65bb Mon Sep 17 00:00:00 2001 From: Sotatek-QuanLeA Date: Fri, 19 Jul 2024 17:44:14 +0700 Subject: [PATCH 6/8] update schema docs --- docs/schema.md | 423 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 285 insertions(+), 138 deletions(-) diff --git a/docs/schema.md b/docs/schema.md index 0bfcb7dbc..144a593a6 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -1,123 +1,157 @@ +# Schema Documentation for yaci-store + # I. Assets store ## 1. assets -| **Column name** | **Type** | **Description** | -|:----------------|:-------------|:-------------------------------| -| **id** | uuid | Unique identifier of the asset | -| slot | bigint | Slot number | -| tx_hash | varchar(64) | Transaction hash | -| policy | varchar(56) | Policy id | -| asset_name | varchar(255) | Name of the asset | -| unit | varchar(255) | Unit of the asset | -| fingerprint | varchar(255) | Fingerprint of the asset | -| quantity | bigint | Quantity of the asset | -| mint_type | varchar(4) | Mint type (MINT/BURN) | -| block | bigint | Block number | -| block_time | bigint | Block time | -| update_datetime | timestamp | Datetime of update | +A table containing all information the unique policy/name pairs along with a CIP14 asset fingerprint + +* Primary Id: `id` + +| **Column name** | **Type** | **Description** | +| :-------------- | :----------- | :---------------------------------------- | +| **id** | uuid | Unique identifier of the asset | +| slot | bigint | Slot number | +| tx_hash | varchar(64) | Transaction hash | +| policy | varchar(56) | Policy id | +| asset_name | varchar(255) | The asset name | +| unit | varchar(255) | The asset unit | +| fingerprint | varchar(255) | The CIP14 fingerprint for the MultiAsset | +| quantity | bigint | The asset quantity of the asset | +| mint_type | varchar(4) | Mint type (MINT/BURN) | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | # II. Block store ## 1. block -| **Column name** | **Type** | **Description** | -|:-------------------|:---------------------|:-----------------------------------------------------------------------------| -| **hash** | varchar(64) not null | Block hash (primary key) | -| number | bigint | Block number within the chain | -| body_hash | varchar(64) | Hash of the block body data | -| body_size | integer | Size of the block body data in bytes | -| epoch | integer | Epoch no of the block | -| total_output | numeric(38) | Total output created in the block | -| total_fees | bigint | Total fees collected in the block | -| block_time | bigint | Block creation timestamp | -| era | smallint | Era number | -| issuer_vkey | varchar(64) | Public key of the block issuer | -| leader_vrf | jsonb | Leader verification result (JSON, nullable) | -| nonce_vrf | jsonb | Nonce verification result (JSON, nullable) | -| prev_hash | varchar(64) | Hash of the previous block | -| protocol_version | varchar(64) | Blockchain protocol version used | -| slot | bigint | Slot number | -| vrf_result | jsonb | VRF verification result (JSON, nullable) | -| vrf_vkey | varchar(64) | The VRF key of the creator of this block | -| no_of_txs | integer | The number of transactions in this block | -| slot_leader | varchar(56) | The hash of of the block producer identifier | -| epoch_slot | integer | The slot number within an epoch (resets to zero at the start of each epoch). | -| op_cert_hot_vkey | varchar(64) | The hash of the operational certificate of the block producer | -| op_cert_seq_number | bigint | The value of the counter used to produce the operational certificate | -| op_cert_kes_period | bigint | KES key period for operator certificate | -| op_cert_sigma | varchar(256) | Signature for operator certificate | -| create_datetime | timestamp | Date and time the record was created | -| update_datetime | timestamp | Date and time the record was last updated | +A table for blocks on the chain. + +* Primary Id: `hash` + +| **Column name** | **Type** | **Description** | +| :----------------- | :------------------- | :-------------------------------------------------------------------------- | +| **hash** | varchar(64) not null | The hash identifier of the block | +| number | bigint | The block number within the chain | +| body_hash | varchar(64) | Hash of the block body data | +| body_size | integer | Size of the block body data in bytes | +| epoch | integer | The epoch number | +| total_output | numeric(38) | Total output created in the block | +| total_fees | bigint | Total fees collected in the block | +| block_time | bigint | Block creation timestamp | +| era | smallint | Era number | +| issuer_vkey | varchar(64) | Public key of the block issuer | +| leader_vrf | jsonb | Leader verification result (JSON, nullable) | +| nonce_vrf | jsonb | Nonce verification result (JSON, nullable) | +| prev_hash | varchar(64) | Hash of the previous block | +| protocol_version | varchar(64) | Blockchain protocol version used | +| slot | bigint | Slot number | +| vrf_result | jsonb | VRF verification result (JSON, nullable) | +| vrf_vkey | varchar(64) | The VRF key of the creator of this block | +| no_of_txs | integer | The number of transactions in this block | +| slot_leader | varchar(56) | The hash of of the block producer identifier | +| epoch_slot | integer | The slot number within an epoch (resets to zero at the start of each epoch) | +| op_cert_hot_vkey | varchar(64) | The hash of the operational certificate of the block producer | +| op_cert_seq_number | bigint | The value of the counter used to produce the operational certificate | +| op_cert_kes_period | bigint | KES key period for operator certificate | +| op_cert_sigma | varchar(256) | Signature for operator certificate | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | ## 2. rollback -| **Column name** | **Type** | **Description** | -|:-----------------------|:------------|:-----------------------------------------------| -| **id** | bigint | Unique identifier (auto-incrementing) | -| rollback_to_block_hash | varchar(64) | Hash of the block to rollback to | -| rollback_to_slot | bigint | Slot number of the block to rollback to | -| current_block_hash | varchar(64) | Hash of the current block | -| current_slot | bigint | Slot number of the current block | -| current_block | bigint | Block number (unique identifier for the block) | -| create_datetime | timestamp | Date and time the record was created | -| update_datetime | timestamp | Date and time the record was last updated | +A table for rollback history. + +* Primary Id: `id` + +| **Column name** | **Type** | **Description** | +| :--------------------- | :---------- | :-------------------------------------------- | +| **id** | bigint | The unique identifier | +| rollback_to_block_hash | varchar(64) | The hash of the block to rollback to | +| rollback_to_slot | bigint | The slot number of the block to rollback to | +| current_block_hash | varchar(64) | The hash of the current block | +| current_slot | bigint | The current slot number of block | +| current_block | bigint | The block number at the time of rollback | +| create_datetime | timestamp | The date and time the record was created | +| update_datetime | timestamp | The date and time the record was last updated | # III. Epoch store ## 1. local_protocol_params +A table for protocol parameters fetched from Node using node-to-client protocol + +* Primary Id: `id` + | **Column name** | **Type** | **Description** | -|:----------------|:----------|:---------------------------------------------| -| **id** | bigint | Unique identifier (primary key) | +| :-------------- | :-------- | :------------------------------------------- | +| **id** | bigint | Unique identifier | | params | jsonb | JSON document containing protocol parameters | | create_datetime | timestamp | Date and time the record was created | | update_datetime | timestamp | Date and time the record was last updated | ## 2. protocol_params_proposal -| **Column name** | **Type** | **Description** | -|:----------------|:------------|:------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique transaction hash (not null) | -| **key_hash** | varchar(56) | Unique key hash (not null) | -| params | jsonb | JSON document containing proposed protocol parameters | -| target_epoch | integer | Target epoch for the protocol parameter change | -| epoch | integer | Epoch number | -| slot | bigint | Slot number | -| era | smallint | Era identifier | -| block | bigint | Block number | -| block_time | bigint | Block creation timestamp | -| update_datetime | timestamp | Date and time the record was last updated | +A table containing block chain parameter change proposals. + +* Primary Id: {`tx_hash`, `key_hash`} + +| **Column name** | **Type** | **Description** | +| :-------------- | :---------- | :------------------------------------------------------------------------------------- | +| **tx_hash** | varchar(64) | Unique transaction hash | +| **key_hash** | varchar(56) | The hash of the crypto key used to sign this proposal. | +| params | jsonb | JSON document containing proposed protocol parameters | +| target_epoch | integer | Target epoch for the protocol parameter change | +| epoch | integer | Epoch number | +| slot | bigint | Slot number | +| era | smallint | Era identifier (Byron(1),Shelley(2),Allegra(3),Mary(4),Alonzo(5),Babbage(6),Conway(7)) | +| block | bigint | Block number | +| block_time | bigint | Block creation timestamp | +| update_datetime | timestamp | Date and time the record was last updated | ## 3. epoch_param -| **Column name** | **Type** | **Description** | -|:----------------|:------------|:----------------------------------------------------------------------| -| **epoch** | integer | The first epoch for which these parameters are valid. (not null) | -| params | jsonb | JSON document containing epoch parameters | -| cost_model_hash | varchar(64) | The hash of cost model. It ensures uniqueness of entries. New in v13. | -| slot | bigint | Slot number | -| block | bigint | Block number | -| block_time | bigint | Block creation timestamp | -| update_datetime | timestamp | Date and time the record was last updated | +The accepted protocol parameters for an epoch. + +* Primary Id: `epoch` + +| **Column name** | **Type** | **Description** | +| :-------------- | :---------- | :------------------------------------------------------- | +| **epoch** | integer | The first epoch for which these parameters are valid. | +| params | jsonb | JSON document containing epoch parameters | +| cost_model_hash | varchar(64) | The hash of cost model. It ensures uniqueness of entries | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_time | bigint | Block creation timestamp | +| update_datetime | timestamp | Date and time the record was last updated | ## 4. cost_model -| **Column name** | **Type** | **Description** | -|:----------------|:------------|:---------------------------------------------------------------------------------| -| **hash** | varchar(64) | The hash of cost model. It ensures uniqueness of entries. New in v13. (not null) | -| costs | jsonb | The actual costs formatted as json | -| slot | bigint | Slot number | -| block | bigint | Block number | -| block_time | bigint | Block creation timestamp | -| update_datetime | timestamp | Date and time the record was last updated | +Cost model for epoch param and param proposal. + +* Primary Id: `hash` + +| **Column name** | **Type** | **Description** | +| :-------------- | :---------- | :------------------------------------------------------- | +| **hash** | varchar(64) | The hash of cost model. It ensures uniqueness of entries | +| costs | jsonb | The actual costs formatted as json | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_time | bigint | Block creation timestamp | +| update_datetime | timestamp | Date and time the record was last updated | # IV Epoch aggregation ## 1. epoch +a table for aggregation of data within an epoch. + +* Primary Id: `number` + | **Column name** | **Type** | **Description** | -|-------------------|-------------|----------------------------------------------------------------------| +| ----------------- | ----------- | -------------------------------------------------------------------- | | **number** | bigint | The epoch number | | block_count | int | The number of blocks in this epoch | | transaction_count | bigint | The number of transactions in this epoch | @@ -133,8 +167,12 @@ ## 1. gov_action_proposal +A table contains information about proposed governance actions. + +* Primary Id: {`tx_hash`, `idx`} + | **Column name** | **Type** | **Description** | -|-----------------|--------------|---------------------------------------------------------------------------------------------------------------------------------| +| --------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------- | | **tx_hash** | varchar(64) | The hash of the tx that includes this certificate | | **idx** | int | The index of this proposal procedure within its transaction | | deposit | bigint | The deposit amount payed for this proposal (in lovelace) | @@ -151,8 +189,12 @@ ## 2. voting_procedure +A table for voting procedures, aka GovVote. A Vote can be Yes No or Abstain. + +* Primary Id: {`tx_hash`, `voter_hash`, `gov_action_tx_hash`, `gov_action_index`} + | **Column name** | **Type** | **Description** | -|------------------------|-------------|-------------------------------------------------------------------------| +| ---------------------- | ----------- | ----------------------------------------------------------------------- | | **tx_hash** | varchar(64) | Transaction hash of the tx that includes this VotingProcedure | | **voter_hash** | varchar(56) | Hash identifying the voter (not null, part of primary key) | | **gov_action_tx_hash** | varchar(64) | Transaction hash of the governance action | @@ -171,8 +213,12 @@ ## 3. committee_registration +A table for every committee key registration. + +* Primary Id: {`tx_hash`, `cert_index`} + | **Column name** | **Type** | **Description** | -|-----------------|-------------|----------------------------------------------------------------------------| +| --------------- | ----------- | -------------------------------------------------------------------------- | | **tx_hash** | varchar(64) | The hash of the tx that includes this certificate | | **cert_index** | int | The index of this registration within the certificates of this transaction | | cold_key | varchar | The reference to the registered cold key hash id | @@ -186,8 +232,12 @@ ## 4. committee_deregistration +A table for every committee key de-registration. + +* Primary Id: {`tx_hash`, `cert_index`} + | **Column name** | **Type** | **Description** | -|-----------------|-------------|----------------------------------------------------------------------------| +| --------------- | ----------- | -------------------------------------------------------------------------- | | **tx_hash** | varchar(64) | The hash of the tx that includes this certificate | | **cert_index** | int | The index of this registration within the certificates of this transaction | | anchor_url | varchar | URL for additional information about the deregistration | @@ -202,8 +252,12 @@ ## 5. delegation_vote +A table containing delegations from a stake address to a stake pool. + +* Primary Id: {`tx_hash`, `cert_index`} + | **Column name** | **Type** | **Description** | -|-----------------|--------------|----------------------------------------------------------------------------| +| --------------- | ------------ | -------------------------------------------------------------------------- | | **tx_hash** | varchar(64) | The hash of the tx that includes this certificate | | **cert_index** | int | The index of this registration within the certificates of this transaction | | address | varchar(255) | Bech32 encoded stake address of the delegator | @@ -220,27 +274,35 @@ ## 6. drep_registration -| **Column name** | **Type** | **Description** | -|-----------------|--------------|-------------------------------------------------------------------------| -| **tx_hash** | varchar(64) | Unique transaction hash (not null, primary key) | -| **cert_index** | int | Index of the certificate within the transaction (not null, primary key) | -| type | varchar(50) | Type of DREP registration (e.g., stake pool registration, withdrawal) | -| deposit | bigint | Amount of ADA deposited for specific registration types | -| drep_hash | varchar(56) | Drep hash for the pool being delegated to | -| drep_id | varchar(255) | Unique identifier for a delegated representative (Bech32) | -| anchor_url | varchar | URL for additional information about the registration | -| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url | -| cred_type | varchar(40) | Type of credential used for registration (ADDR_KEYHASH, SCRIPTHASH) | -| epoch | int | Epoch number | -| slot | bigint | Slot number | -| block | bigint | Block number | -| block_time | bigint | Block time | -| update_datetime | timestamp | Date and time the record was last updated | +A table for DRep registrations, deregistrations or updates. + +* Primary Id: {`tx_hash`, `cert_index`} + +| **Column name** | **Type** | **Description** | +| --------------- | ------------ | --------------------------------------------------------------------- | +| **tx_hash** | varchar(64) | Transaction hash | +| **cert_index** | int | Index of the certificate within the transaction | +| type | varchar(50) | Type of DREP registration (e.g., stake pool registration, withdrawal) | +| deposit | bigint | Amount of ADA deposited for specific registration types | +| drep_hash | varchar(56) | Drep hash for the pool being delegated to | +| drep_id | varchar(255) | Unique identifier for a delegated representative (Bech32) | +| anchor_url | varchar | URL for additional information about the registration | +| anchor_hash | varchar(64) | Hash of the off-chain data pointed to by anchor_url | +| cred_type | varchar(40) | Type of credential used for registration (ADDR_KEYHASH, SCRIPTHASH) | +| epoch | int | Epoch number | +| slot | bigint | Slot number | +| block | bigint | Block number | +| block_time | bigint | Block time | +| update_datetime | timestamp | Date and time the record was last updated | ## 7. committee_member +A table for members of the committee. A committee can have multiple members. + +* Primary Id: {`hash`, `slot`} + | **Column name** | **Type** | **Description** | -|-----------------|-------------|---------------------------------------------------------------------| +| --------------- | ----------- | ------------------------------------------------------------------- | | **hash** | varchar(56) | The cold key of committee member | | **slot** | bigint | Slot number | | cred_type | varchar(40) | Type of credential used for registration (ADDR_KEYHASH, SCRIPTHASH) | @@ -249,22 +311,22 @@ # VI. Live store -| **Column name** | **Type** | **Description** | -|:----------------|:---------|:----------------| -| | | | - # VII. Metadata store ## 1. transaction_metadata +A table for metadata attached to a transaction. + +* Primary Id: `id` + | **Column name** | **Type** | **Description** | -|:----------------|:-------------|:---------------------------------------------------| -| **id** | uuid | Unique identifier (primary key) | +| :-------------- | :----------- | :------------------------------------------------- | +| **id** | uuid | Unique identifier | | slot | bigint | Slot number | | tx_hash | varchar(64) | The hash identifier of the transaction | | label | varchar(255) | The metadata key (a Word64/unsigned 64 bit number) | | body | text | The JSON payload if it can be decoded as JSON | -| cbor | text | The raw bytes of the payload | +| cbor | text | The CBOR encoded of metadata | | block | bigint | Block number | | block_time | bigint | Block time | | update_datetime | timestamp | Date and time the record was last updated | @@ -273,10 +335,14 @@ ## 1. mir +A table for MIR data + +* Primary Id: `id` + | **Column name** | **Type** | **Description** | -|:----------------|:-------------|:-----------------------------------------------------------------------------| -| **id** | uuid | Unique identifier (primary key) | -| tx_hash | varchar(64) | Transaction hash (unique identifier for the transaction) | +| :-------------- | :----------- | :--------------------------------------------------------------------------- | +| **id** | uuid | Unique identifier | +| tx_hash | varchar(64) | Transaction hash | | cert_index | int | Index of the certificate within the transaction | | pot | varchar(30) | Pot type (e.g., stake, delegation) | | credential | varchar(56) | Credential associated with the MIR (stake address or delegation certificate) | @@ -293,8 +359,13 @@ ## 1. script +A table containing scripts available, found in witnesses, inlined in outputs (reference outputs) or auxdata of +transactions. + +* Primary Id: `script_hash` + | **Column name** | **Type** | **Description** | -|:----------------|:------------|:--------------------------------------------------------------------------| +| :-------------- | :---------- | :------------------------------------------------------------------------ | | **script_hash** | varchar(56) | The Hash of the Script | | script_type | varchar(30) | The type of the script. This is currenttly either 'timelock' or 'plutus'. | | content | jsonb | JSON representation of the timelock script, null for other script type | @@ -303,9 +374,13 @@ ## 2. transaction_scripts +A table for scripts of transaction + +* Primary Id: `id` + | **Column name** | **Type** | **Description** | -|:------------------|:------------|:-------------------------------------------------------------------------------------------------------------------------| -| **id** | uuid | Unique identifier (primary key) | +| :---------------- | :---------- | :----------------------------------------------------------------------------------------------------------------------- | +| **id** | uuid | Unique identifier | | slot | bigint | Slot number | | block_hash | varchar(64) | Hash of the block | | tx_hash | varchar(64) | The hash identifier of the transaction | @@ -324,8 +399,12 @@ ## 3. datum +A table containing Plutus Datum, found in witnesses or inlined in outputs + +* Primary Id: `hash` + | **Column name** | **Type** | **Description** | -|:----------------|:------------|:----------------------------------------------------------| +| :-------------- | :---------- | :-------------------------------------------------------- | | **hash** | varchar(64) | The Hash of the datum | | datum | text | The actual data in CBOR format | | created_at_tx | varchar(64) | Transaction hash where this script first became available | @@ -336,8 +415,12 @@ ## 1. stake_registration +A table containing stake address registrations. + +* Primary Id: {`tx_hash`, `cert_index`} + | **Column name** | **Type** | **Description** | -|:----------------|:-------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| :-------------- | :----------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **tx_hash** | varchar(64) | The hash identifier of the transaction | | **cert_index** | int | The index of this stake registration within the certificates of this transaction | | credential | varchar(56) | Stake credential (not null) | @@ -352,8 +435,12 @@ ## 2. delegation +A table containing delegations from a stake address to a stake pool. + +* Primary Id: {`tx_hash`, `cert_index`} + | **Column Name** | **Data Type** | **Description** | -|-----------------|---------------|----------------------------------------------------------------------------------| +| --------------- | ------------- | -------------------------------------------------------------------------------- | | **tx_hash** | varchar(64) | The hash identifier of the transaction | | **cert_index** | int | The index of this stake registration within the certificates of this transaction | | credential | varchar(56) | Delegation credential | @@ -368,8 +455,12 @@ ## 3. pool_registration +A table containing information about pools registration. + +* Primary Id: {`tx_hash`, `cert_index`} + | **Column name** | **Type** | **Description** | -|:----------------|:---------------|:---------------------------------------------------------------------------------------------------| +| :-------------- | :------------- | :------------------------------------------------------------------------------------------------- | | **tx_hash** | varchar(64) | The hash identifier of the transaction | | **cert_index** | int | The index of this stake registration within the certificates of this transaction | | pool_id | varchar(56) | The raw bytes of the pool hash | @@ -391,8 +482,12 @@ ## 4.pool_retirement +A table containing information about pools retiring. + +* Primary Id: {`tx_hash`, `cert_index`} + | **Column name** | **Type** | **Description** | -|:-----------------|:------------|:---------------------------------------------------------------------------------| +| :--------------- | :---------- | :------------------------------------------------------------------------------- | | **tx_hash** | varchar(64) | The hash identifier of the transaction | | **cert_index** | int | The index of this stake registration within the certificates of this transaction | | pool_id | varchar(56) | The raw bytes of the pool hash | @@ -408,8 +503,12 @@ ## 1. transaction +A table for transactions within a block on the chain. + +* Primary Id: `tx_hash` + | **Column Name** | **Data Type** | **Description** | -|-------------------------|---------------|--------------------------------------------------------------------------------------------| +| ----------------------- | ------------- | ------------------------------------------------------------------------------------------ | | **tx_hash** | varchar(64) | The hash identifier of the transaction | | auxiliary_datahash | varchar(64) | Hash of the transaction's auxiliary data | | block_hash | varchar(64) | The hash identifier of the block | @@ -434,8 +533,12 @@ ## 2. transaction_witness +A table for transaction witnesses. + +* Primary Id: {`tx_hash`, `idx`} + | **Column name** | **Type** | **Description** | -|:----------------|:-------------|:----------------------------------------------------------------------------------------------------------------------------------| +| :-------------- | :----------- | :-------------------------------------------------------------------------------------------------------------------------------- | | **tx_hash** | varchar(64) | The hash identifier of the transaction | | **idx** | integer | Index of the witness within the transaction | | pub_key | varchar(128) | Public key used for signing the transaction | @@ -447,8 +550,12 @@ ## 3. withdrawal +A table for withdrawals from a reward account. + +* Primary Id: {`tx_hash`, `address`} + | **Column name** | **Type** | **Description** | -|:----------------|:-------------|:--------------------------------------------------| +| :-------------- | :----------- | :------------------------------------------------ | | **tx_hash** | varchar(64) | The hash identifier of the transaction | | **address** | varchar(255) | The stake address for which the withdrawal is for | | amount | numeric(38) | The withdrawal amount (in Lovelace) | @@ -460,8 +567,12 @@ ## 4. invalid_transaction +A table for transaction invalid. + +* Primary Id: `tx_hash` + | **Column name** | **Type** | **Description** | -|:----------------|:------------|:----------------------------------------------------------| +| :-------------- | :---------- | :-------------------------------------------------------- | | **tx_hash** | varchar(64) | The hash identifier of the transaction | | slot | bigint | Slot number | | block_hash | varchar(64) | Hash of the block containing the invalid transaction | @@ -473,8 +584,12 @@ ## 1. address_utxo +A table for transaction outputs (Used for account balance calculator). + +* Primary Id: {`tx_hash`, `output_index`,} + | **Column name** | **Type** | **Description** | -|:-----------------|:------------|:-----------------------------------------------------------------------------| +| :--------------- | :---------- | :--------------------------------------------------------------------------- | | **tx_hash** | varchar(64) | The hash identifier of the transaction that contains this transaction output | | **output_index** | smallint | The index of this transaction output with the transaction | | slot | bigint | Slot number | @@ -485,8 +600,12 @@ ## 2. tx_input +A table for tx inputs which reference outputs from previous transactions (Used for account balance calculator). + +* Primary Id: {`tx_hash`, `output_index`} + | **Column name** | **Type** | **Description** | -|:--------------------|:------------|:--------------------------------------------------------------------| +| :------------------ | :---------- | :------------------------------------------------------------------ | | **tx_hash** | varchar(64) | The hash identifier of the transaction | | **output_index** | smallint | The index within the transaction outputs | | spend_at_slot | bigint | Slot number in which the UTXO was spent | @@ -498,9 +617,13 @@ ## 3. address +A table for information about address + +* Primary Id: `id` + | **Column name** | **Type** | **Description** | -|:-------------------|:-------------|:------------------------------------------------------| -| **id** | bigserial | Unique identifier for the address (auto-incrementing) | +| :----------------- | :----------- | :---------------------------------------------------- | +| **id** | bigserial | Unique identifier for the address | | address | varchar(500) | Bech32 address in the Cardano blockchain. | | addr_full | text | Full address information (might include more details) | | payment_credential | varchar(56) | Bech32 payment credential for the address | @@ -512,8 +635,12 @@ ## 1. address_balance +A table for balance of stake address + +* Primary Id: {`address`, `unit`, `slot`} + | **Column Name** | **Data Type** | **Description** | -|-----------------|---------------|-----------------------------------------------------------| +| --------------- | ------------- | --------------------------------------------------------- | | **address** | varchar(500) | Bech32 encoded address | | **unit** | varchar(255) | The unit for the quantity (e.g., lovelace for ADA) | | **slot** | bigint | Slot number | @@ -529,8 +656,12 @@ ## 2. stake_address_balance +A table for balance of stake address + +* Primary Id: {`address`, `slot`} + | **Column Name** | **Data Type** | **Description** | -|------------------|---------------|-------------------------------------------------------------| +| ---------------- | ------------- | ----------------------------------------------------------- | | **address** | varchar(255) | Bech32 encoded stake address | | **slot** | bigint | Slot number | | quantity | numeric(38) | Numeric representation of the lovelace | @@ -543,8 +674,12 @@ ## 3. address_tx_amount +A table for the change in the balance of an address at a specific transaction. + +* Primary Id: {`address`, `unit`, `tx_hash`} + | **Column Name** | **Data Type** | **Description** | -|-----------------|---------------|------------------------------------------------------------------------| +| --------------- | ------------- | ---------------------------------------------------------------------- | | **address** | varchar(500) | Bech32 encoded address | | **unit** | varchar(255) | Optional unit for the quantity (e.g., lovelace for ADA) | | **tx_hash** | varchar(64) | The hash identifier of the transaction | @@ -558,8 +693,12 @@ ## 4. account_config +A table containing information about account config + +* Primary Id: `config_id` + | **Column Name** | **Data Type** | **Description** | -|-----------------|---------------|----------------------------------------------------------------| +| --------------- | ------------- | -------------------------------------------------------------- | | **config_id** | varchar(100) | Unique identifier for the account configuration | | status | varchar(50) | Current status of the account configuration (BALANCE_SNAPSHOT) | | slot | bigint | Slot number | @@ -570,8 +709,12 @@ ## 1. cursor_ +Table to track the current block position during synchronization. + +* Primary Id: {`id`, `block_hash`} + | **Column name** | **Type** | **Description** | -|:----------------|:------------|:---------------------------------------------------| +| :-------------- | :---------- | :------------------------------------------------- | | **id** | integer | Unique identifier
Id of the service use cursor_ | | **block_hash** | varchar(64) | Hash of the block | | slot | bigint | Slot number | @@ -583,6 +726,8 @@ ## 2. era +A table for era information + Byron(1), Shelley(2), @@ -597,8 +742,10 @@ Babbage(6), Conway(7); +* Primary Id: `era` + | **Column name** | **Type** | **Description** | -|:----------------|:------------|:---------------------------------------------| +| :-------------- | :---------- | :------------------------------------------- | | **era** | int | Era identifier | | start_slot | bigint | Slot number at which the era begins | | block | bigint | Block number that marks the start of the era | From 5150e5911df5504479f529eb000cf82306094b34 Mon Sep 17 00:00:00 2001 From: Sotatek-QuanLeA Date: Fri, 19 Jul 2024 18:01:46 +0700 Subject: [PATCH 7/8] edit description script table --- docs/schema.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/schema.md b/docs/schema.md index 144a593a6..09c1587e2 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -364,13 +364,13 @@ transactions. * Primary Id: `script_hash` -| **Column name** | **Type** | **Description** | -| :-------------- | :---------- | :------------------------------------------------------------------------ | -| **script_hash** | varchar(56) | The Hash of the Script | -| script_type | varchar(30) | The type of the script. This is currenttly either 'timelock' or 'plutus'. | -| content | jsonb | JSON representation of the timelock script, null for other script type | -| create_datetime | timestamp | Date and time the record was created | -| update_datetime | timestamp | Date and time the record was last updated | +| **Column name** | **Type** | **Description** | +| :-------------- | :---------- | :----------------------------------------------------------------------- | +| **script_hash** | varchar(56) | The Hash of the Script | +| script_type | varchar(30) | The type of the script. (NATIVE_SCRIPT, PLUTUS_V1, PLUTUS_V2, PLUTUS_V3) | +| content | jsonb | JSON representation of the script content | +| create_datetime | timestamp | Date and time the record was created | +| update_datetime | timestamp | Date and time the record was last updated | ## 2. transaction_scripts From be8aa4e9d50887dd3329fa180b8f256fb5c51521 Mon Sep 17 00:00:00 2001 From: Sotatek-QuanLeA Date: Mon, 22 Jul 2024 14:41:40 +0700 Subject: [PATCH 8/8] move the schema file under docs/pages and rename to .mdx --- docs/{schema.md => pages/schema.mdx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{schema.md => pages/schema.mdx} (100%) diff --git a/docs/schema.md b/docs/pages/schema.mdx similarity index 100% rename from docs/schema.md rename to docs/pages/schema.mdx