I want to add more node information to a network node. Is it possible to share more data besides what\'s in the node configuration file? Maybe some custom fields, like an en
src
folder add a file called config.conf
. key1="string_value"
key2=number_value
build.gradle
go to the part where you define your nodes, let's say your module name is "my_module"; do this: cordapp (project(':my_module')) {
config project.file("src/config.conf")
}
deployNodes
, gradle will generate a file called my_module.conf
under build\nodes\my_node\cordapps\config
.getServiceHub().getAppContext().getConfig().getString("key1");
Map<String, String> customConfig = new HashMap<>();
customConfig.put("key1", "string_value");
customConfig.put("key2", "int_value");
// Setup network.
network = new MockNetwork(new MockNetworkParameters().withCordappsForAllNodes(ImmutableList.of(
TestCordapp.findCordapp("my_package").withConfig(customConfig))));