Kshitiz Sharma
Kshitiz Sharma

Reputation: 792

What is the difference between transaction storage, vault, and ledger in Corda?

Recently, I started learning Corda and am a bit confused in the terminology. I know transaction storage stores all the transactions of a node and vault is a table which stores only the relevant transactions.

But what are those relevant transactions which are stored in vault? And what kind of transactions are not stored in vault but are there in transaction storage?

And also, how these different storage mechanisms implemented in real life scenarios?

Upvotes: 0

Views: 350

Answers (1)

Joel
Joel

Reputation: 23140

The vault doesn't store transactions. It stores the relevant states from any transactions the node records.

In general, a state is considered relevant if the node is one of the state's participants. However, there are two exceptions:

  • States that extend OwnableState will only be stored if the node is the owner
  • A node can choose to record every state in a transaction, instead of just the relevant ones, by setting the statesToRecord flag in ReceiveTransactionFlow to ALL_VISIBLE, as follows:

    ReceiveTransactionFlow(
        otherSideSession = otherSession,
        checkSufficientSignatures = true,
        statesToRecord = StatesToRecord.ALL_VISIBLE)
    

Upvotes: 0

Related Questions