-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(corda-connector): node diagnostics endpoint #623
Primary change ------------- The Corda RPC proxy has a diagnostics method that we exposed here as an endpoint for our own connector as well. This will help tremendously in debugging things when people are working with the corda connector (speaking from experience here). Fixes #623 Secondary change(s) ------------------- 1. Updated the jvm-kotlin-spring-server test case to use the container images from the official repository instead of relying on the temporary ones from Peter's personal one. Signed-off-by: Peter Somogyvari <[email protected]>
- Loading branch information
Showing
13 changed files
with
757 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...n/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordappInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model | ||
|
||
import java.util.Objects | ||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.SHA256 | ||
import javax.validation.constraints.DecimalMax | ||
import javax.validation.constraints.DecimalMin | ||
import javax.validation.constraints.Max | ||
import javax.validation.constraints.Min | ||
import javax.validation.constraints.NotNull | ||
import javax.validation.constraints.Pattern | ||
import javax.validation.constraints.Size | ||
import javax.validation.Valid | ||
|
||
/** | ||
* A CordappInfo describes a single CorDapp currently installed on the node | ||
* @param jarHash | ||
* @param licence The name of the licence this CorDapp is released under | ||
* @param minimumPlatformVersion The minimum platform version the node must be at for the CorDapp to run | ||
* @param name The name of the JAR file that defines the CorDapp | ||
* @param shortName The name of the CorDapp | ||
* @param targetPlatformVersion The target platform version this CorDapp has been tested against | ||
* @param type A description of what sort of CorDapp this is - either a contract, workflow, or a combination. | ||
* @param vendor The vendor of this CorDapp | ||
* @param version The version of this CorDapp | ||
*/ | ||
data class CordappInfo( | ||
|
||
@get:NotNull | ||
@field:Valid | ||
@field:JsonProperty("jarHash") val jarHash: SHA256, | ||
|
||
@get:NotNull | ||
@field:JsonProperty("licence") val licence: kotlin.String, | ||
|
||
@get:NotNull | ||
@field:JsonProperty("minimumPlatformVersion") val minimumPlatformVersion: kotlin.Int, | ||
|
||
@get:NotNull | ||
@field:JsonProperty("name") val name: kotlin.String, | ||
|
||
@get:NotNull | ||
@field:JsonProperty("shortName") val shortName: kotlin.String, | ||
|
||
@get:NotNull | ||
@field:JsonProperty("targetPlatformVersion") val targetPlatformVersion: kotlin.Int, | ||
|
||
@get:NotNull | ||
@field:JsonProperty("type") val type: kotlin.String, | ||
|
||
@get:NotNull | ||
@field:JsonProperty("vendor") val vendor: kotlin.String, | ||
|
||
@get:NotNull | ||
@field:JsonProperty("version") val version: kotlin.String | ||
) { | ||
|
||
} | ||
|
25 changes: 25 additions & 0 deletions
25
...rg/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DiagnoseNodeV1Request.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model | ||
|
||
import java.util.Objects | ||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import javax.validation.constraints.DecimalMax | ||
import javax.validation.constraints.DecimalMin | ||
import javax.validation.constraints.Max | ||
import javax.validation.constraints.Min | ||
import javax.validation.constraints.NotNull | ||
import javax.validation.constraints.Pattern | ||
import javax.validation.constraints.Size | ||
import javax.validation.Valid | ||
|
||
/** | ||
* | ||
* @param nodeIds Optional property specifying which Corda Node should be the one being diagnosed in case the Connector has multiple connections established for different nodes (which is not yet a supported feature, but we want to keep this possibility open for the future). | ||
*/ | ||
data class DiagnoseNodeV1Request( | ||
|
||
@get:Size(min=0,max=1024) | ||
@field:JsonProperty("nodeIds") val nodeIds: kotlin.collections.List<kotlin.String>? = null | ||
) { | ||
|
||
} | ||
|
27 changes: 27 additions & 0 deletions
27
...g/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DiagnoseNodeV1Response.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model | ||
|
||
import java.util.Objects | ||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.NodeDiagnosticInfo | ||
import javax.validation.constraints.DecimalMax | ||
import javax.validation.constraints.DecimalMin | ||
import javax.validation.constraints.Max | ||
import javax.validation.constraints.Min | ||
import javax.validation.constraints.NotNull | ||
import javax.validation.constraints.Pattern | ||
import javax.validation.constraints.Size | ||
import javax.validation.Valid | ||
|
||
/** | ||
* | ||
* @param nodeDiagnosticInfo | ||
*/ | ||
data class DiagnoseNodeV1Response( | ||
|
||
@get:NotNull | ||
@field:Valid | ||
@field:JsonProperty("nodeDiagnosticInfo") val nodeDiagnosticInfo: NodeDiagnosticInfo | ||
) { | ||
|
||
} | ||
|
44 changes: 44 additions & 0 deletions
44
...n/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NodeDiagnosticInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.hyperledger.cactus.plugin.ledger.connector.corda.server.model | ||
|
||
import java.util.Objects | ||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.CordappInfo | ||
import javax.validation.constraints.DecimalMax | ||
import javax.validation.constraints.DecimalMin | ||
import javax.validation.constraints.Max | ||
import javax.validation.constraints.Min | ||
import javax.validation.constraints.NotNull | ||
import javax.validation.constraints.Pattern | ||
import javax.validation.constraints.Size | ||
import javax.validation.Valid | ||
|
||
/** | ||
* A NodeDiagnosticInfo holds information about the current node version. | ||
* @param cordapps A list of CorDapps currently installed on this node | ||
* @param platformVersion The platform version of this node. This number represents a released API version, and should be used to make functionality decisions (e.g. enabling an app feature only if an underlying platform feature exists) | ||
* @param revision The git commit hash this node was built from | ||
* @param vendor The vendor of this node | ||
* @param version The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note that this string is effectively freeform, and so should only be used for providing diagnostic information. It should not be used to make functionality decisions (the platformVersion is a better fit for this). | ||
*/ | ||
data class NodeDiagnosticInfo( | ||
|
||
@get:NotNull | ||
@field:Valid | ||
@get:Size(min=0,max=4096) | ||
@field:JsonProperty("cordapps") val cordapps: kotlin.collections.List<CordappInfo>, | ||
|
||
@get:NotNull | ||
@field:JsonProperty("platformVersion") val platformVersion: kotlin.Int, | ||
|
||
@get:NotNull | ||
@field:JsonProperty("revision") val revision: kotlin.String, | ||
|
||
@get:NotNull | ||
@field:JsonProperty("vendor") val vendor: kotlin.String, | ||
|
||
@get:NotNull | ||
@field:JsonProperty("version") val version: kotlin.String | ||
) { | ||
|
||
} | ||
|
Oops, something went wrong.