Reputation: 735
Reference code :-
GIT clone url :- git clone https://github.com/corda/cordapp-tutorial
Release M14 :- git checkout -b release-M14.0
I am little bit confused about how the data flows in Corda. I have some database releated queries:
Whether the database structure is fixed or we can add our custom tables in it?
Where can I see the data flowing in tables, when I do a cash transaction which I can see in VAULT_CASH_BALANCES table in my H2 database client but apart from cash I am unable to see any details of my other transactiosn i.e. if I save a string then I am unable to get the information, I only get the transaction Id for that. Is it possible to get entire data flow diagram?
Do the Node and Vault tables created every time when I build a code?
Upvotes: 2
Views: 376
Reputation: 23140
You can define how each state type is stored in the node by implementing the QueryableState
interface. Each state type that implements QueryableState
will have its own custom database table.
See https://github.com/corda/cordapp-tutorial/blob/master/kotlin-source/src/main/kotlin/com/example/state/IOUState.kt for an example. Since the IOU state implements a schema (in the Kotlin version of the CorDapp), you can see the sender, recipient and value from the H2 interface for each IOU state.
In the current implementation, the node's data is stored in the persistence.mv.db
file of the deployed node. This will be wiped whenever you run gradlew deployNodes
. However, if you simply create an updated CorDapp jar by running gradlew jar
, you can then copy the updated CorDapp jar from build/libs
into each node's plugins
folder, and the node will use the new plugin.
Upvotes: 1