Kid101
Kid101

Reputation: 1470

In a Corda Node when and how do the following tables fit into picture

NODE_TRANSACTION_MAPPINGS table (TX_ID ,STATE_MACHINE_RUN_ID), NODE_CHECKPOINTS table (checkpoint Id, checkpoint Value)and NODE_TRANSACTIONS table.

What I think I understand is first Tx info is added to node_transactions table (irrespective to the validity of the Tx ) then it gets added to node_transaction_mappings then we update the checkpoint. (what are these checkpoints as we update this at each step, an enum to understand would help :).

Also, when do we put the Tx values node_transactions table? do we update any table once we send/receive a message from artemis?.

In short, do we have a transaction lifecycle somewhere? as in after what step what gets updated? Will make it easier to debug a Transaction.

Upvotes: 1

Views: 120

Answers (1)

Joel
Joel

Reputation: 23140

When ReceiveTransactionFlow is invoked, the following process happens for every individual transaction received:

  • The node creates a new DB transaction
  • As part of the existing DB transaction, the node adds a checkpoint to the NODE_CHECKPOINTS table
  • The node receives the Corda transaction from the counterparty
  • As part of the existing DB transaction, the node updates the NODE_TRANSACTIONS table
  • As part of the existing DB transaction, the node updates the NODE_TRANSACTION_MAPPINGS table
  • The node commits the DB transaction

Upvotes: 0

Related Questions