Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Ledger_state in Daml-On-SqlForum ↗

Ledger_state in Daml-On-Sql

App Development4 posts336 views10 likesLast activity Jun 2021
FR
FrankieOP
Jun 2021

Hi, in Daml-On-Sql the postgresql database has a table called Ledger_state, It appears that it is compressed and serialized. Does any one know what that field hold?

ST
stefanobaghino-da
Jun 2021

That table contains the latest known set of active contracts known to the local participant, used as the environment where the local Daml engine looks up contracts referenced in commands as those are evaluated into transactions.

FR
Frankie
Jun 2021

Thanks @stefanobaghino-da. Looks like the table holds the history of the ledger. Any changes on the ledger are recorded there. Just curious, what about Ledger_log table?

ST
stefanobaghino-da
Jun 2021

That’s the other way around, LEDGER_STATE tracks the latest ACS for it to be used by the engine, LEDGER_LOG tracks every event and it’s used to serve transactions, flat transactions and ACS snapshots for the Ledger API.

← Back to Discussions