mirror of
https://github.com/corda/corda.git
synced 2025-06-18 15:18:16 +00:00
CORDA-556: Added Cordapp Config and a sample (#2469)
* Added per-cordapp configuration * Added new API for Cordformation cordapp declarations to support per-cordapp configuration * Added a cordapp configuration sample
This commit is contained in:
5
samples/cordapp-configuration/src/config.conf
Normal file
5
samples/cordapp-configuration/src/config.conf
Normal file
@ -0,0 +1,5 @@
|
||||
someStringValue=hello world
|
||||
someIntValue=1
|
||||
nested: {
|
||||
value: a string
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package net.corda.configsample
|
||||
|
||||
import net.corda.core.flows.FlowLogic
|
||||
|
||||
class ConfigSampleFlow : FlowLogic<String>() {
|
||||
override fun call(): String {
|
||||
val config = serviceHub.getAppContext().config
|
||||
return config.getString("someStringValue")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user