diff --git a/core/src/main/kotlin/net/corda/core/cordapp/Cordapp.kt b/core/src/main/kotlin/net/corda/core/cordapp/Cordapp.kt index ff9426ec90..2df896cbbe 100644 --- a/core/src/main/kotlin/net/corda/core/cordapp/Cordapp.kt +++ b/core/src/main/kotlin/net/corda/core/cordapp/Cordapp.kt @@ -13,6 +13,7 @@ import java.net.URL * * This will only need to be constructed manually for certain kinds of tests. * + * @property name Cordapp name - derived from the base name of the Cordapp JAR (therefore may not be unique) * @property contractClassNames List of contracts * @property initiatedFlows List of initiatable flow classes * @property rpcFlows List of RPC initiable flows classes @@ -22,6 +23,7 @@ import java.net.URL * @property jarPath The path to the JAR for this CorDapp */ interface Cordapp { + val name: String val contractClassNames: List val initiatedFlows: List>> val rpcFlows: List>> diff --git a/core/src/main/kotlin/net/corda/core/internal/cordapp/CordappImpl.kt b/core/src/main/kotlin/net/corda/core/internal/cordapp/CordappImpl.kt index 4f7aecd6fe..38a5a0ecf4 100644 --- a/core/src/main/kotlin/net/corda/core/internal/cordapp/CordappImpl.kt +++ b/core/src/main/kotlin/net/corda/core/internal/cordapp/CordappImpl.kt @@ -5,6 +5,7 @@ import net.corda.core.flows.FlowLogic import net.corda.core.node.CordaPluginRegistry import net.corda.core.schemas.MappedSchema import net.corda.core.serialization.SerializeAsToken +import java.io.File import java.net.URL data class CordappImpl( @@ -15,6 +16,8 @@ data class CordappImpl( override val plugins: List, override val customSchemas: Set, override val jarPath: URL) : Cordapp { + override val name: String = File(jarPath.toURI()).name.removeSuffix(".jar") + /** * An exhaustive list of all classes relevant to the node within this CorDapp * diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 194a00deee..af1374367b 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -7,6 +7,8 @@ from the previous milestone release. UNRELEASED ---------- +* ``Cordapp`` now has a name field for identifying CorDapps and all CorDapp names are printed to console at startup. + Release 1.0 ----------- diff --git a/node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt b/node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt index 6fb990d27e..0b645a2c48 100644 --- a/node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt +++ b/node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt @@ -263,6 +263,7 @@ open class NodeStartup(val args: Array) { node.configuration.extraAdvertisedServiceIds.let { if (it.isNotEmpty()) Node.printBasicNodeInfo("Providing network services", it.joinToString()) } + Node.printBasicNodeInfo("Loaded CorDapps", node.cordappProvider.cordapps.map { it.name }.joinToString()) val plugins = node.pluginRegistries .map { it.javaClass.name } .filterNot { it.startsWith("net.corda.node.") || it.startsWith("net.corda.core.") || it.startsWith("net.corda.nodeapi.") }