Esben Andersen
Esben Andersen

Reputation: 823

Cordapp configuration file with corda-node-driver

I cant seem to find a way to load my cordapp configuration file when using the corda-node-driver.

The documentation only shows how to load it with the deploy tasks. The deploy tasks are not an option for me.

Can this even be done using the corda-node-driver ?

Upvotes: 0

Views: 133

Answers (2)

Esben Andersen
Esben Andersen

Reputation: 823

I found the solution.

...
Map<String, String> config = new HashMap<>();
config.put("key1", "value1");
config.put("key2", "value2");

TestCordapp flow = TestCordapp.findCordapp("my.cordapp.flow").withConfig(config);
TestCordapp state = TestCordapp.findCordapp("my.cordapp.state");
driver(
    new DriverParameters(Arrays.asList(flow, state))
...

So instead of letting DriverParameters find the CordApps automatically, i provided them with a config.

Thanks to Cais Manai for pointing me towards DriverParameters.

Upvotes: 2

Cais Manai
Cais Manai

Reputation: 966

Have you looked at writing a method that loads in your configuration file from local and then use the info loaded as input to the DriverParameters?

Upvotes: 0

Related Questions