Rahul Panwar
Rahul Panwar

Reputation: 735

How can I retrieve data from custom tables in Corda ?

I want to retrieve data from Custom tables that I have created using Queryable State but the database port keeps on changing after every deployment . Can I assign specific ports for every Node database same as web service and RPC ports ?

Upvotes: 1

Views: 160

Answers (1)

Clintonio
Clintonio

Reputation: 434

Setting the h2 database port

It depends on how you are creating your nodes;

Manually created nodes

Edit the node.conf file that must exist for every node by setting the property h2Port = x, where x is your port number.

Cordformation (in your build.gradle)

For each node { } block you can set the property h2Port x

Driver

You can add any arbitrary configuration to a node you create via startNode by providing the parameter configOverrides. For example with Kotlin you can do;

startNode(<NodeName>, customOverrides = mapOf("h2Port" to x))

In Java you can do the same by specifying it as the 5th parameter.

NodeBasedTest

In a NodeBasedTest you can provide the configOverrides parameter in the same manner as in the Driver but as the 4th parameter of startNode.

Upvotes: 3

Related Questions