IntersectMBO / cardano-db-sync

A component that follows the Cardano chain and stores blocks and transactions in PostgreSQL
Apache License 2.0
290 stars 162 forks source link

Store CBOR serialized transactions in `tx_cbor` table #1723

Closed sorki closed 3 months ago

sorki commented 4 months ago

Description

Optional feature that can be enabled via insert options like so:

 "insert_options": {
    "tx_cbor": "enable",

Testing on preview network, with minimal insert options

  "insert_options": {
    "tx_cbor": "enable",
    "tx_out": { "value": "disable" },
    "ledger": "disable",
    "shelley": { "enable": false },
    "multi_asset": { "enable": false },
    "metadata": { "enable": false },
    "plutus": { "enable": false },
    "governance": "disable",
    "offchain_pool_data": "disable",
    "json_type": "disable"
  }

results in about 6.2GB of data

csyncdb=> SELECT pg_size_pretty(pg_total_relation_size('"public"."tx_cbor"'));
 pg_size_pretty
----------------
 6272 MB
(1 row)

Closes #1701

Checklist

Migrations

sorki commented 3 months ago

Added a rollback deletion, schema documentation, changelog entry and hopefully resolved review issues / tests.

kderme commented 3 months ago

Merged at https://github.com/IntersectMBO/cardano-db-sync/pull/1749. Thank you