diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/healthcheck.sh b/packages/cactus-plugin-ledger-connector-corda/src/main-server/healthcheck.sh old mode 100755 new mode 100644 diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/.openapi-generator/FILES index 5a2e4929d7a..b04dee42bbf 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/.openapi-generator/FILES +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/.openapi-generator/FILES @@ -4,6 +4,7 @@ settings.gradle src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaController.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaService.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiUtil.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CPIIDV1.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ClearMonitorTransactionsV1Request.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ClearMonitorTransactionsV1Response.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CordaNodeSshCredentials.kt @@ -17,6 +18,11 @@ src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/mode src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DiagnoseNodeV1Request.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/DiagnoseNodeV1Response.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowInvocationType.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowStatusV1Responses.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowStatusV1ResponsesFlowStatusResponsesInner.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowV1Error.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetFlowCidV1Request.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetFlowCidV1Response.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1Request.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1Response.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetMonitorTransactionsV1ResponseTxInner.kt @@ -26,6 +32,10 @@ src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/mode src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmObject.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmType.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/JvmTypeKind.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1Request.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1Response.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1ResponseCpisInner.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1ResponseCpisInnerCpksInner.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListFlowsV1Request.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListFlowsV1Response.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/NetworkHostAndPort.kt @@ -34,6 +44,9 @@ src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/mode src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/Party.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/PublicKey.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/SHA256.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartFlowV1Request.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartFlowV1RequestRequestBody.kt +src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartFlowV1Response.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartMonitorV1Request.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartMonitorV1Response.kt src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StopMonitorV1Request.kt diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/gradlew b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/gradlew old mode 100755 new mode 100644 diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaController.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaController.kt index 4c90ba58cf4..329e4973bef 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaController.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaController.kt @@ -7,13 +7,20 @@ import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.DeployC import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.DeployContractJarsV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.DiagnoseNodeV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.DiagnoseNodeV1Response +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.FlowStatusV1Responses +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.GetFlowCidV1Request +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.GetFlowCidV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.GetMonitorTransactionsV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.GetMonitorTransactionsV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.InvokeContractV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.InvokeContractV1Response +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.ListCpiV1Request +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.ListCpiV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.ListFlowsV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.ListFlowsV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.NodeInfo +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StartFlowV1Request +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StartFlowV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StartMonitorV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StartMonitorV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StopMonitorV1Request @@ -79,6 +86,17 @@ class ApiPluginLedgerConnectorCordaController(@Autowired(required = true) val se } + @RequestMapping( + method = [RequestMethod.GET], + value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/getFlowCid"], + produces = ["text/plain"], + consumes = ["application/json"] + ) + fun getFlowV1( @Valid @RequestBody getFlowCidV1Request: GetFlowCidV1Request): ResponseEntity { + return ResponseEntity(service.getFlowV1(getFlowCidV1Request), HttpStatus.valueOf(200)) + } + + @RequestMapping( method = [RequestMethod.GET], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions"], @@ -111,6 +129,28 @@ class ApiPluginLedgerConnectorCordaController(@Autowired(required = true) val se } + @RequestMapping( + method = [RequestMethod.GET], + value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listCPI"], + produces = ["application/json"], + consumes = ["application/json"] + ) + fun listCpiV1( @Valid @RequestBody listCpiV1Request: ListCpiV1Request): ResponseEntity { + return ResponseEntity(service.listCpiV1(listCpiV1Request), HttpStatus.valueOf(200)) + } + + + @RequestMapping( + method = [RequestMethod.GET], + value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listFlows"], + produces = ["text/plain"], + consumes = ["application/json"] + ) + fun listFlowV1( @Valid @RequestBody getFlowCidV1Request: GetFlowCidV1Request): ResponseEntity { + return ResponseEntity(service.listFlowV1(getFlowCidV1Request), HttpStatus.valueOf(200)) + } + + @RequestMapping( method = [RequestMethod.POST], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows"], @@ -133,6 +173,17 @@ class ApiPluginLedgerConnectorCordaController(@Autowired(required = true) val se } + @RequestMapping( + method = [RequestMethod.POST], + value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/startFlow"], + produces = ["application/json"], + consumes = ["application/json"] + ) + fun startFlowV1( @Valid @RequestBody startFlowV1Request: StartFlowV1Request): ResponseEntity { + return ResponseEntity(service.startFlowV1(startFlowV1Request), HttpStatus.valueOf(200)) + } + + @RequestMapping( method = [RequestMethod.POST], value = ["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor"], diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaService.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaService.kt index 9a9aeb8fd4e..fe3a40aa6cc 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaService.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaService.kt @@ -7,13 +7,20 @@ import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.DeployC import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.DeployContractJarsV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.DiagnoseNodeV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.DiagnoseNodeV1Response +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.FlowStatusV1Responses +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.GetFlowCidV1Request +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.GetFlowCidV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.GetMonitorTransactionsV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.GetMonitorTransactionsV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.InvokeContractV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.InvokeContractV1Response +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.ListCpiV1Request +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.ListCpiV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.ListFlowsV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.ListFlowsV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.NodeInfo +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StartFlowV1Request +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StartFlowV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StartMonitorV1Request import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StartMonitorV1Response import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StopMonitorV1Request @@ -50,6 +57,17 @@ interface ApiPluginLedgerConnectorCordaService { */ fun diagnoseNodeV1(diagnoseNodeV1Request: DiagnoseNodeV1Request?): DiagnoseNodeV1Response + /** + * GET /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/getFlowCid : This method gets the current status of the specified flow instance. + * + * @param getFlowCidV1Request This method gets the current status of the specified flow instance. (required) + * @return OK (status code 200) + * or Unauthorized (status code 401) + * or Forbidden (status code 403) + * @see ApiPluginLedgerConnectorCorda#getFlowV1 + */ + fun getFlowV1(getFlowCidV1Request: GetFlowCidV1Request): GetFlowCidV1Response + /** * GET /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions : Get transactions for monitored state classes. * @@ -76,6 +94,26 @@ interface ApiPluginLedgerConnectorCordaService { */ fun invokeContractV1(invokeContractV1Request: InvokeContractV1Request?): InvokeContractV1Response + /** + * GET /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listCPI : List all CPIs uploaded to the cluster + * + * @param listCpiV1Request (required) + * @return OK (status code 200) + * @see ApiPluginLedgerConnectorCorda#listCpiV1 + */ + fun listCpiV1(listCpiV1Request: ListCpiV1Request): ListCpiV1Response + + /** + * GET /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listFlows : This method returns an array containing the statuses of all flows running for a specified holding identity. An empty array is returned if there are no flows running. + * + * @param getFlowCidV1Request This method gets the current status of the specified flow instance. (required) + * @return OK (status code 200) + * or Unauthorized (status code 401) + * or Forbidden (status code 403) + * @see ApiPluginLedgerConnectorCorda#listFlowV1 + */ + fun listFlowV1(getFlowCidV1Request: GetFlowCidV1Request): FlowStatusV1Responses + /** * POST /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows * Responds with a list of the flows on the Corda node. @@ -96,6 +134,15 @@ interface ApiPluginLedgerConnectorCordaService { */ fun networkMapV1(body: kotlin.Any?): List + /** + * POST /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/startFlow : This method starts a new instance for the specified flow for the specified holding identity. + * + * @param startFlowV1Request Request body for starting a flow (required) + * @return OK (status code 200) + * @see ApiPluginLedgerConnectorCorda#startFlowV1 + */ + fun startFlowV1(startFlowV1Request: StartFlowV1Request): StartFlowV1Response + /** * POST /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor : Start monitoring corda changes (transactions) of given state class * diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CPIIDV1.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CPIIDV1.kt new file mode 100644 index 00000000000..143fea9f02c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/CPIIDV1.kt @@ -0,0 +1,30 @@ +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.Email +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 name + * @param version + * @param signerSummaryHash + */ +data class CPIIDV1( + + @get:JsonProperty("name", required = true) val name: kotlin.String, + + @get:JsonProperty("version", required = true) val version: kotlin.String, + + @get:JsonProperty("signerSummaryHash") val signerSummaryHash: kotlin.String? = null +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowStatusV1Responses.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowStatusV1Responses.kt new file mode 100644 index 00000000000..23e16451a35 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowStatusV1Responses.kt @@ -0,0 +1,26 @@ +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.FlowStatusV1ResponsesFlowStatusResponsesInner +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +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 flowStatusResponses + */ +data class FlowStatusV1Responses( + + @field:Valid + @get:JsonProperty("flowStatusResponses") val flowStatusResponses: kotlin.collections.List? = null +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowStatusV1ResponsesFlowStatusResponsesInner.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowStatusV1ResponsesFlowStatusResponsesInner.kt new file mode 100644 index 00000000000..4c175dc0abf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowStatusV1ResponsesFlowStatusResponsesInner.kt @@ -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.FlowV1Error +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +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 clientRequestId + * @param flowError + * @param flowId + * @param flowResult + * @param flowStatus + * @param holdingIDShortHash + * @param timestamp + */ +data class FlowStatusV1ResponsesFlowStatusResponsesInner( + + @get:JsonProperty("clientRequestId") val clientRequestId: kotlin.String? = null, + + @field:Valid + @get:JsonProperty("flowError") val flowError: FlowV1Error? = null, + + @get:JsonProperty("flowId") val flowId: kotlin.String? = null, + + @get:JsonProperty("flowResult") val flowResult: kotlin.String? = null, + + @get:JsonProperty("flowStatus") val flowStatus: kotlin.String? = null, + + @get:JsonProperty("holdingIDShortHash") val holdingIDShortHash: kotlin.String? = null, + + @get:JsonProperty("timestamp") val timestamp: java.time.OffsetDateTime? = null +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowV1Error.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowV1Error.kt new file mode 100644 index 00000000000..e4873b9bded --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/FlowV1Error.kt @@ -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 javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +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 message + * @param type + */ +data class FlowV1Error( + + @get:JsonProperty("message", required = true) val message: kotlin.String, + + @get:JsonProperty("type", required = true) val type: kotlin.String +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetFlowCidV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetFlowCidV1Request.kt new file mode 100644 index 00000000000..0d137220718 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetFlowCidV1Request.kt @@ -0,0 +1,36 @@ +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.Email +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 + +/** + * This method gets the current status of the specified flow instance. + * @param username + * @param password + * @param baseUrl + * @param holdingIDShortHash + * @param clientRequestId + */ +data class GetFlowCidV1Request( + + @get:JsonProperty("username", required = true) val username: kotlin.String, + + @get:JsonProperty("password", required = true) val password: kotlin.String, + + @get:JsonProperty("baseUrl", required = true) val baseUrl: kotlin.String, + + @get:JsonProperty("holdingIDShortHash") val holdingIDShortHash: kotlin.String? = null, + + @get:JsonProperty("clientRequestId") val clientRequestId: kotlin.String? = null +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetFlowCidV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetFlowCidV1Response.kt new file mode 100644 index 00000000000..a79f7120ca1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/GetFlowCidV1Response.kt @@ -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.FlowV1Error +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +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 flowStatus + * @param holdingIDShortHash + * @param timestamp + * @param clientRequestId + * @param flowError + * @param flowId + * @param flowResult + */ +data class GetFlowCidV1Response( + + @get:JsonProperty("flowStatus", required = true) val flowStatus: kotlin.String, + + @get:JsonProperty("holdingIDShortHash", required = true) val holdingIDShortHash: kotlin.String, + + @get:JsonProperty("timestamp", required = true) val timestamp: java.time.OffsetDateTime, + + @get:JsonProperty("clientRequestId") val clientRequestId: kotlin.String? = null, + + @field:Valid + @get:JsonProperty("flowError") val flowError: FlowV1Error? = null, + + @get:JsonProperty("flowId") val flowId: kotlin.String? = null, + + @get:JsonProperty("flowResult") val flowResult: kotlin.String? = null +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1Request.kt new file mode 100644 index 00000000000..54e48cdb965 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1Request.kt @@ -0,0 +1,30 @@ +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.Email +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 username + * @param password + * @param baseUrl + */ +data class ListCpiV1Request( + + @get:JsonProperty("username", required = true) val username: kotlin.String, + + @get:JsonProperty("password", required = true) val password: kotlin.String, + + @get:JsonProperty("baseUrl", required = true) val baseUrl: kotlin.String +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1Response.kt new file mode 100644 index 00000000000..b55eb9335fb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1Response.kt @@ -0,0 +1,26 @@ +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.ListCpiV1ResponseCpisInner +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +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 cpis + */ +data class ListCpiV1Response( + + @field:Valid + @get:JsonProperty("cpis") val cpis: kotlin.collections.List? = null +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1ResponseCpisInner.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1ResponseCpisInner.kt new file mode 100644 index 00000000000..909630fbf7a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1ResponseCpisInner.kt @@ -0,0 +1,43 @@ +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.CPIIDV1 +import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.ListCpiV1ResponseCpisInnerCpksInner +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +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 cpiFileChecksum + * @param cpiFileFullChecksum + * @param cpks + * @param groupPolicy + * @param id + * @param timestamp + */ +data class ListCpiV1ResponseCpisInner( + + @get:JsonProperty("cpiFileChecksum") val cpiFileChecksum: kotlin.String? = null, + + @get:JsonProperty("cpiFileFullChecksum") val cpiFileFullChecksum: kotlin.String? = null, + + @field:Valid + @get:JsonProperty("cpks") val cpks: kotlin.collections.List? = null, + + @get:JsonProperty("groupPolicy") val groupPolicy: kotlin.String? = null, + + @field:Valid + @get:JsonProperty("id") val id: CPIIDV1? = null, + + @get:JsonProperty("timestamp") val timestamp: java.time.OffsetDateTime? = null +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1ResponseCpisInnerCpksInner.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1ResponseCpisInnerCpksInner.kt new file mode 100644 index 00000000000..28ef9d1b62f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/ListCpiV1ResponseCpisInnerCpksInner.kt @@ -0,0 +1,41 @@ +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.CPIIDV1 +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +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 hash + * @param id + * @param libraries + * @param mainBundle + * @param timestamp + * @param type + */ +data class ListCpiV1ResponseCpisInnerCpksInner( + + @get:JsonProperty("hash") val hash: kotlin.String? = null, + + @field:Valid + @get:JsonProperty("id") val id: CPIIDV1? = null, + + @get:JsonProperty("libraries") val libraries: kotlin.collections.List? = null, + + @get:JsonProperty("mainBundle") val mainBundle: kotlin.String? = null, + + @get:JsonProperty("timestamp") val timestamp: java.time.OffsetDateTime? = null, + + @get:JsonProperty("type") val type: kotlin.String? = null +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartFlowV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartFlowV1Request.kt new file mode 100644 index 00000000000..c79eea954c6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartFlowV1Request.kt @@ -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.StartFlowV1RequestRequestBody +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +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 + +/** + * This method starts a new instance for the specified flow for the specified holding identity. + * @param username + * @param password + * @param clientRequestId + * @param flowClassName + * @param requestBody + * @param baseUrl + * @param holdingIDShortHash + */ +data class StartFlowV1Request( + + @get:JsonProperty("username", required = true) val username: kotlin.String, + + @get:JsonProperty("password", required = true) val password: kotlin.String, + + @get:JsonProperty("clientRequestId", required = true) val clientRequestId: kotlin.String, + + @get:JsonProperty("flowClassName", required = true) val flowClassName: kotlin.String, + + @field:Valid + @get:JsonProperty("requestBody", required = true) val requestBody: StartFlowV1RequestRequestBody, + + @get:JsonProperty("baseUrl") val baseUrl: kotlin.String? = null, + + @get:JsonProperty("holdingIDShortHash") val holdingIDShortHash: kotlin.String? = null +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartFlowV1RequestRequestBody.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartFlowV1RequestRequestBody.kt new file mode 100644 index 00000000000..cb010c02e57 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartFlowV1RequestRequestBody.kt @@ -0,0 +1,33 @@ +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.Email +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 chatName + * @param otherMember + * @param message + * @param numberOfRecords + */ +data class StartFlowV1RequestRequestBody( + + @get:JsonProperty("chatName") val chatName: kotlin.String? = null, + + @get:JsonProperty("otherMember") val otherMember: kotlin.String? = null, + + @get:JsonProperty("message") val message: kotlin.String? = null, + + @get:JsonProperty("numberOfRecords") val numberOfRecords: kotlin.String? = null +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartFlowV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartFlowV1Response.kt new file mode 100644 index 00000000000..48965e722f5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/model/StartFlowV1Response.kt @@ -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.FlowV1Error +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +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 flowStatus + * @param holdingIDShortHash + * @param timestamp + * @param clientRequestId + * @param flowError + * @param flowId + * @param flowResult + */ +data class StartFlowV1Response( + + @get:JsonProperty("flowStatus", required = true) val flowStatus: kotlin.String, + + @get:JsonProperty("holdingIDShortHash", required = true) val holdingIDShortHash: kotlin.String, + + @get:JsonProperty("timestamp", required = true) val timestamp: java.time.OffsetDateTime, + + @get:JsonProperty("clientRequestId") val clientRequestId: kotlin.String? = null, + + @field:Valid + @get:JsonProperty("flowError") val flowError: FlowV1Error? = null, + + @get:JsonProperty("flowId") val flowId: kotlin.String? = null, + + @get:JsonProperty("flowResult") val flowResult: kotlin.String? = null +) { + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/resources/openapi.yaml b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..b528e281937 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/resources/openapi.yaml @@ -0,0 +1,1837 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Corda ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Corda + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars: + post: + operationId: deployContractJarsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsSuccessV1Response' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsBadRequestV1Response' + description: Bad Request + summary: "Deploys a set of jar files (Cordapps, e.g. the contracts in Corda\ + \ speak)." + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a Corda ledger (e.g. a flow) + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor: + post: + operationId: startMonitorV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartMonitorV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StartMonitorV1Response' + description: OK + summary: Start monitoring corda changes (transactions) of given state class + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions: + get: + operationId: GetMonitorTransactionsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetMonitorTransactionsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetMonitorTransactionsV1Response' + description: OK + summary: Get transactions for monitored state classes. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions + verbLowerCase: get + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions: + delete: + operationId: ClearMonitorTransactionsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClearMonitorTransactionsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClearMonitorTransactionsV1Response' + description: OK + summary: Clear transactions from internal store so they'll not be available + by GetMonitorTransactionsV1 anymore. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions + verbLowerCase: delete + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor: + delete: + operationId: stopMonitorV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StopMonitorV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StopMonitorV1Response' + description: OK + summary: Stop monitoring corda changes (transactions) of given state class + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor + verbLowerCase: delete + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map: + post: + description: "Responds with a snapshot of the network map as provided by the\ + \ Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun\ + \ networkMapSnapshot(): List" + operationId: networkMapV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkMapV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkMapV1Response' + description: OK + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows: + post: + description: Responds with a list of the flows on the Corda node. + operationId: listFlowsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ListFlowsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ListFlowsV1Response' + description: OK + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node: + post: + description: Responds with diagnostic information about the Corda node + operationId: diagnoseNodeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DiagnoseNodeV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DiagnoseNodeV1Response' + description: OK + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/cpi: + get: + operationId: getCPIResponse + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CPIV5Response' + description: OK + summary: List all CPIs uploaded to the cluster + x-hyperledger-cactus: + https: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/cpi + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/flow/{holdingIDShortHash}: + get: + operationId: flowStatusResponses + parameters: + - description: Holding identity short hash + explode: false + in: path + name: holdingIDShortHash + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/FlowStatusV5Responses' + description: OK + "401": + description: Unauthorized + "403": + description: Forbidden + summary: This method returns an array containing the statuses of all flows running + for a specified holding identity. An empty array is returned if there are + no flows running. + x-hyperledger-cactus: + http: + verbLowerCase: get + path: "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/flow/{holdingIDShortHash}" + post: + operationId: startFlowParameters + parameters: + - description: Holding identity short hash + explode: false + in: path + name: holdingIDShortHash + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartFlowV5Request' + description: Request body for starting a flow + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FlowStatusV5Response' + description: OK + summary: This method starts a new instance for the specified flow for the specified + holding identity. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/flow/{holdingIDShortHash}" + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/flow/{holdingIDShortHash}/{clientRequestID}: + get: + operationId: flowStatusResponse + parameters: + - description: Holding identity short hash + explode: false + in: path + name: holdingIDShortHash + required: true + schema: + type: string + style: simple + - description: Client request ID + explode: false + in: path + name: clientRequestID + required: true + schema: + type: string + style: simple + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/FlowStatusV5Response' + description: OK + "401": + description: Unauthorized + "403": + description: Forbidden + summary: This method gets the current status of the specified flow instance. + x-hyperledger-cactus: + http: + verbLowerCase: get + path: "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/flow/{holdingIDShortHash}/{clientRequestID}" +components: + schemas: + SHA256: + description: "SHA-256 is part of the SHA-2 hash function family. Generated hash\ + \ is fixed size, 256-bits (32-bytes)." + example: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + externalDocs: + description: Official Corda documentation of the SHA256 class. + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.crypto/-secure-hash/-s-h-a256/index.html + properties: + bytes: + example: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + type: string + offset: + example: 0 + type: integer + size: + example: 32 + type: integer + required: + - bytes + - offset + - size + type: object + CordappInfo: + description: A CordappInfo describes a single CorDapp currently installed on + the node + example: + licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + externalDocs: + description: Official Corda Documentation of the class CordappInfo + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.cordapp/-cordapp-info/index.html + properties: + jarHash: + $ref: '#/components/schemas/SHA256' + licence: + description: The name of the licence this CorDapp is released under + type: string + minimumPlatformVersion: + description: The minimum platform version the node must be at for the CorDapp + to run + type: integer + name: + description: The name of the JAR file that defines the CorDapp + type: string + shortName: + description: The name of the CorDapp + type: string + targetPlatformVersion: + description: The target platform version this CorDapp has been tested against + type: integer + type: + description: "A description of what sort of CorDapp this is - either a contract,\ + \ workflow, or a combination." + type: string + vendor: + description: The vendor of this CorDapp + type: string + version: + description: The version of this CorDapp + type: string + required: + - jarHash + - licence + - minimumPlatformVersion + - name + - shortName + - targetPlatformVersion + - type + - vendor + - version + type: object + NodeDiagnosticInfo: + description: A NodeDiagnosticInfo holds information about the current node version. + example: + vendor: vendor + platformVersion: 1 + version: version + cordapps: + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + revision: revision + externalDocs: + description: Official Corda Documentation of the class NodeDiagnosticInfo + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.node/-node-diagnostic-info/index.html + properties: + cordapps: + description: A list of CorDapps currently installed on this node + items: + $ref: '#/components/schemas/CordappInfo' + maxItems: 4096 + minItems: 0 + type: array + platformVersion: + description: "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)" + type: integer + revision: + description: The git commit hash this node was built from + type: string + vendor: + description: The vendor of this node + type: string + version: + description: "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)." + type: string + required: + - cordapps + - platformVersion + - revision + - vendor + - version + type: object + FlowInvocationType: + description: Determines which flow starting method will be used on the back-end + when invoking the flow. Based on the value here the plugin back-end might + invoke the rpc.startFlowDynamic() method or the rpc.startTrackedFlowDynamic() + method. Streamed responses are aggregated and returned in a single response + to HTTP callers who are not equipped to handle streams like WebSocket/gRPC/etc. + do. + enum: + - TRACKED_FLOW_DYNAMIC + - FLOW_DYNAMIC + nullable: false + type: string + JarFile: + additionalProperties: true + example: + filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + properties: + filename: + maxLength: 255 + minLength: 1 + nullable: false + type: string + hasDbMigrations: + description: Indicates whether the cordapp jar in question contains any + embedded migrations that Cactus can/should execute between copying the + jar into the cordapp directory and starting the node back up. + nullable: false + type: boolean + contentBase64: + format: base64 + maxLength: 1073741824 + minLength: 1 + nullable: false + type: string + required: + - contentBase64 + - filename + - hasDbMigrations + type: object + JvmType: + description: Represents a reference to a JVM type (such as a Java class) + example: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + properties: + fqClassName: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + constructorName: + description: This parameter is used to specify that the function used to + construct this JvmType is not a constructor function but instead is a + factory function. Setting this parameter will cause the plugin to look + up methods of the class denoted by fqClassName instead of its constructors. + maxLength: 65535 + minLength: 1 + nullable: false + type: string + invocationTarget: + $ref: '#/components/schemas/JvmObject' + required: + - fqClassName + type: object + JvmTypeKind: + enum: + - PRIMITIVE + - REFERENCE + nullable: false + type: string + JvmObject: + description: "Can represent JVM primitive and reference types as well. The jvmTypeKind\ + \ field indicates which one is being stored. If the jvmTypeKind field is set\ + \ to REFERENCE then the jvmCtorArgs array is expected to be filled, otherwise\ + \ (e.g. PRIMITIVE jvmTypeKind) it is expected that the primitiveValue property\ + \ is filled with a primitive data type supported by the JSON standard such\ + \ as strings, booleans, numbers, etc." + example: + jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + properties: + jvmTypeKind: + $ref: '#/components/schemas/JvmTypeKind' + primitiveValue: + type: object + jvmCtorArgs: + default: [] + items: + $ref: '#/components/schemas/JvmObject' + maxLength: 1024 + minLength: 0 + nullable: false + type: array + jvmType: + $ref: '#/components/schemas/JvmType' + required: + - jvmType + - jvmTypeKind + type: object + CordappDeploymentConfig: + example: + cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + sshCredentials: + $ref: '#/components/schemas/CordaNodeSshCredentials' + rpcCredentials: + $ref: '#/components/schemas/CordaRpcCredentials' + cordaNodeStartCmd: + description: The shell command to execute in order to start back up a Corda + node after having placed new jars in the cordapp directory of said node. + example: ./build/nodes/runNodes + maxLength: 65535 + minLength: 1 + nullable: false + type: string + cordappDir: + description: The absolute file system path where the Corda Node is expecting + deployed Cordapp jar files to be placed. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + cordaJarPath: + description: The absolute file system path where the corda.jar file of the + node can be found. This is used to execute database schema migrations + where applicable (H2 database in use in development environments). + maxLength: 2048 + minLength: 1 + nullable: false + type: string + nodeBaseDirPath: + description: The absolute file system path where the base directory of the + Corda node can be found. This is used to pass in to corda.jar when being + invoked for certain tasks such as executing database schema migrations + for a deployed contract. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + required: + - cordaJarPath + - cordaNodeStartCmd + - cordappDir + - nodeBaseDirPath + - rpcCredentials + - sshCredentials + type: object + CordaRpcCredentials: + example: + hostname: hostname + password: password + port: 39501 + username: username + properties: + hostname: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + port: + maximum: 65535 + minimum: 1 + nullable: false + type: integer + username: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + password: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + required: + - hostname + - password + - port + - username + type: object + CordaNodeSshCredentials: + example: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + hostKeyEntry: + example: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + maxLength: 65535 + minLength: 1 + nullable: false + type: string + username: + maxLength: 32 + minLength: 1 + nullable: false + type: string + password: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + hostname: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + port: + maximum: 65535 + minimum: 1 + nullable: false + type: integer + required: + - hostKeyEntry + - hostname + - password + - port + - username + type: object + DeployContractJarsV1Request: + additionalProperties: false + example: + jarFiles: + - filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + - filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + cordappDeploymentConfigs: + - cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + - cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + cordappDeploymentConfigs: + default: [] + description: The list of deployment configurations pointing to the nodes + where the provided cordapp jar files are to be deployed . + items: + $ref: '#/components/schemas/CordappDeploymentConfig' + maxLength: 1024 + minLength: 0 + type: array + jarFiles: + items: + $ref: '#/components/schemas/JarFile' + nullable: false + type: array + required: + - cordappDeploymentConfigs + - jarFiles + type: object + DeployContractJarsSuccessV1Response: + example: + deployedJarFiles: + - deployedJarFiles + - deployedJarFiles + properties: + deployedJarFiles: + items: + minItems: 1 + nullable: false + type: string + type: array + required: + - deployedJarFiles + type: object + DeployContractJarsBadRequestV1Response: + properties: + errors: + items: + maxItems: 2048 + maxLength: 65535 + minItems: 1 + minLength: 1 + type: string + type: array + required: + - errors + type: object + InvokeContractV1Request: + additionalProperties: false + example: + flowInvocationType: null + timeoutMs: 0 + flowFullClassName: net.corda.samples.obligation.flows.IOUIssueFlow + params: + - jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + - jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + properties: + flowFullClassName: + description: The fully qualified name of the Corda flow to invoke + example: net.corda.samples.obligation.flows.IOUIssueFlow + maxLength: 1024 + minLength: 1 + nullable: false + type: string + flowInvocationType: + $ref: '#/components/schemas/FlowInvocationType' + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: + $ref: '#/components/schemas/JvmObject' + nullable: false + type: array + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. + minimum: 0 + nullable: false + type: integer + required: + - flowFullClassName + - flowInvocationType + - params + - signingCredential + type: object + InvokeContractV1Response: + example: + callOutput: "{}" + success: true + progress: + - progress + - progress + flowId: flowId + transactionId: transactionId + properties: + success: + nullable: false + type: boolean + callOutput: + description: Data returned from the JVM when no transaction is running + type: object + transactionId: + description: The net.corda.core.flows.StateMachineRunId value returned by + the flow execution. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + progress: + default: [] + description: "An array of strings representing the aggregated stream of\ + \ progress updates provided by a *tracked* flow invocation. If the flow\ + \ invocation was not tracked, this array is still returned, but as empty." + items: + maxItems: 10000000 + minItems: 0 + type: string + type: array + flowId: + description: The id for the flow handle + type: string + required: + - callOutput + - flowId + - success + type: object + StartMonitorV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + StartMonitorV1Response: + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if monitoring started correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + GetMonitorTransactionsV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + GetMonitorTransactionsV1Response: + example: + msg: msg + tx: + - data: data + index: index + - data: data + index: index + success: true + stateFullClassName: net.corda.samples.example.states.IOUState + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + tx: + default: [] + items: + $ref: '#/components/schemas/GetMonitorTransactionsV1Response_tx_inner' + type: array + required: + - msg + - success + type: object + ClearMonitorTransactionsV1Request: + additionalProperties: false + example: + txIndexes: + - txIndexes + - txIndexes + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + txIndexes: + default: [] + items: + type: string + type: array + required: + - clientAppId + - stateFullClassName + - txIndexes + type: object + ClearMonitorTransactionsV1Response: + additionalProperties: false + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + StopMonitorV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + StopMonitorV1Response: + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + ListFlowsV1Request: + additionalProperties: false + example: + filter: filter + properties: + filter: + type: string + type: object + ListFlowsV1Response: + example: + flowNames: + - net.corda.finance.flows.CashExitFlow + - net.corda.finance.flows.CashIssueAndPaymentFlow + - net.corda.finance.flows.CashIssueFlow + - net.corda.finance.flows.CashPaymentFlow + - net.corda.finance.internal.CashConfigDataFlow + - net.corda.samples.obligation.flows.IOUIssueFlow + - net.corda.samples.obligation.flows.IOUSettleFlow + - net.corda.samples.obligation.flows.IOUTransferFlow + - net.corda.samples.obligation.flows.SelfIssueCashFlow + properties: + flowNames: + default: [] + description: An array of strings storing the names of the flows as returned + by the flowList Corda RPC. + example: + - net.corda.finance.flows.CashExitFlow + - net.corda.finance.flows.CashIssueAndPaymentFlow + - net.corda.finance.flows.CashIssueFlow + - net.corda.finance.flows.CashPaymentFlow + - net.corda.finance.internal.CashConfigDataFlow + - net.corda.samples.obligation.flows.IOUIssueFlow + - net.corda.samples.obligation.flows.IOUSettleFlow + - net.corda.samples.obligation.flows.IOUTransferFlow + - net.corda.samples.obligation.flows.SelfIssueCashFlow + items: + maxItems: 10000000 + minItems: 0 + type: string + type: array + required: + - flowNames + type: object + NetworkHostAndPort: + example: + port: 0.8008281904610115 + host: host + properties: + host: + type: string + port: + type: number + required: + - host + - port + type: object + PartyAndCertificate: + type: object + PublicKey: + description: An instance of a java.security.PublicKey (which is an interface) + implementation such as org.hyperledger.cactus.plugin.ledger.connector.corda.server.impl.PublicKeyImpl + example: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + properties: + algorithm: + example: EdDSA + type: string + format: + example: X.509 + type: string + encoded: + example: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + type: string + required: + - algorithm + - encoded + - format + type: object + X500Principal: + example: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + properties: + name: + example: "O=PartyA,L=London,C=GB" + type: string + encoded: + description: Base64 encoded public key + example: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + type: string + required: + - encoded + - name + type: object + CordaX500Name: + example: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + properties: + commonName: + type: string + organisationUnit: + type: string + organisation: + example: PartyA + type: string + locality: + example: London + type: string + state: + type: string + country: + example: GB + type: string + x500Principal: + $ref: '#/components/schemas/X500Principal' + required: + - country + - locality + - organisation + - x500Principal + type: object + Party: + example: + owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + properties: + name: + $ref: '#/components/schemas/CordaX500Name' + owningKey: + $ref: '#/components/schemas/PublicKey' + required: + - name + - owningKey + type: object + NodeInfo: + example: + legalIdentities: + - owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + - owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + addresses: + - port: 0.8008281904610115 + host: host + - port: 0.8008281904610115 + host: host + serial: 1.4658129805029452 + platformVersion: 6 + legalIdentitiesAndCerts: + - null + - null + properties: + addresses: + items: + $ref: '#/components/schemas/NetworkHostAndPort' + type: array + platformVersion: + type: integer + serial: + type: number + legalIdentities: + items: + $ref: '#/components/schemas/Party' + type: array + legalIdentitiesAndCerts: + items: + $ref: '#/components/schemas/PartyAndCertificate' + type: array + required: + - addresses + - legalIdentities + - legalIdentitiesAndCerts + - platformVersion + - serial + type: object + NetworkMapV1Request: + type: object + NetworkMapV1Response: + items: + $ref: '#/components/schemas/NodeInfo' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + DiagnoseNodeV1Request: + additionalProperties: false + example: + nodeIds: + - nodeIds + - nodeIds + - nodeIds + - nodeIds + - nodeIds + properties: + nodeIds: + default: [] + description: "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)." + items: + nullable: false + type: string + maxItems: 1024 + minItems: 0 + type: array + type: object + DiagnoseNodeV1Response: + example: + nodeDiagnosticInfo: + vendor: vendor + platformVersion: 1 + version: version + cordapps: + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + revision: revision + properties: + nodeDiagnosticInfo: + $ref: '#/components/schemas/NodeDiagnosticInfo' + required: + - nodeDiagnosticInfo + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + CPIV5Response: + example: + cpis: + - cpiFileFullChecksum: string + cpiFileChecksum: string + cpks: + - libraries: + - string + - string + id: + signerSummaryHash: string + name: string + version: string + mainBundle: string + type: string + hash: string + timestamp: 2022-06-24T10:15:30Z + - libraries: + - string + - string + id: + signerSummaryHash: string + name: string + version: string + mainBundle: string + type: string + hash: string + timestamp: 2022-06-24T10:15:30Z + groupPolicy: string + id: + signerSummaryHash: string + name: string + version: string + timestamp: 2022-06-24T10:15:30Z + - cpiFileFullChecksum: string + cpiFileChecksum: string + cpks: + - libraries: + - string + - string + id: + signerSummaryHash: string + name: string + version: string + mainBundle: string + type: string + hash: string + timestamp: 2022-06-24T10:15:30Z + - libraries: + - string + - string + id: + signerSummaryHash: string + name: string + version: string + mainBundle: string + type: string + hash: string + timestamp: 2022-06-24T10:15:30Z + groupPolicy: string + id: + signerSummaryHash: string + name: string + version: string + timestamp: 2022-06-24T10:15:30Z + properties: + cpis: + items: + $ref: '#/components/schemas/CPIV5Response_cpis_inner' + type: array + required: + - hash + - id + - libraries + - mainBundle + - timestamp + - type + type: object + StartFlowV5Request: + description: This method starts a new instance for the specified flow for the + specified holding identity. + example: + requestBody: + numberOfRecords: numberOfRecords + otherMember: otherMember + chatName: chatName + message: message + clientRequestId: clientRequestId + flowClassName: flowClassName + properties: + clientRequestId: + nullable: false + type: string + flowClassName: + nullable: false + type: string + requestBody: + $ref: '#/components/schemas/StartFlowV5Request_requestBody' + required: + - clientRequestId + - flowClassName + - requestBody + type: object + FlowStatusV5Response: + example: + holdingIDShortHash: string + flowError: + message: string + type: string + clientRequestId: string + flowResult: string + flowStatus: string + flowId: string + timestamp: 2022-06-24T10:15:30Z + properties: + clientRequestId: + example: string + nullable: true + type: string + flowError: + $ref: '#/components/schemas/FlowV5Error' + flowId: + example: string + nullable: true + type: string + flowResult: + example: string + nullable: true + type: string + flowStatus: + example: string + nullable: false + type: string + holdingIDShortHash: + example: string + nullable: false + type: string + timestamp: + example: 2022-06-24T10:15:30Z + format: date-time + nullable: false + type: string + required: + - flowStatus + - holdingIDShortHash + - timestamp + type: object + FlowStatusV5Responses: + properties: + flowStatusResponses: + items: + $ref: '#/components/schemas/FlowStatusV5Responses_flowStatusResponses_inner' + type: array + required: + - flowStatus + - holdingIDShortHash + - timestamp + type: object + CPIIDV5: + example: + signerSummaryHash: string + name: string + version: string + properties: + name: + example: string + nullable: false + type: string + signerSummaryHash: + example: string + nullable: true + type: string + version: + example: string + nullable: false + type: string + required: + - name + - version + type: object + FlowV5Error: + example: + message: string + type: string + properties: + message: + example: string + nullable: false + type: string + type: + example: string + nullable: false + type: string + required: + - message + - type + type: object + GetMonitorTransactionsV1Response_tx_inner: + example: + data: data + index: index + properties: + index: + type: string + data: + maxItems: 10000000 + minItems: 0 + type: string + type: object + CPIV5Response_cpis_inner_cpks_inner: + example: + libraries: + - string + - string + id: + signerSummaryHash: string + name: string + version: string + mainBundle: string + type: string + hash: string + timestamp: 2022-06-24T10:15:30Z + properties: + hash: + example: string + nullable: false + type: string + id: + $ref: '#/components/schemas/CPIIDV5' + libraries: + items: + example: string + nullable: false + type: string + type: array + mainBundle: + example: string + nullable: false + type: string + timestamp: + example: 2022-06-24T10:15:30Z + format: date-time + nullable: false + type: string + type: + example: string + nullable: false + type: string + type: object + CPIV5Response_cpis_inner: + example: + cpiFileFullChecksum: string + cpiFileChecksum: string + cpks: + - libraries: + - string + - string + id: + signerSummaryHash: string + name: string + version: string + mainBundle: string + type: string + hash: string + timestamp: 2022-06-24T10:15:30Z + - libraries: + - string + - string + id: + signerSummaryHash: string + name: string + version: string + mainBundle: string + type: string + hash: string + timestamp: 2022-06-24T10:15:30Z + groupPolicy: string + id: + signerSummaryHash: string + name: string + version: string + timestamp: 2022-06-24T10:15:30Z + properties: + cpiFileChecksum: + example: string + nullable: false + type: string + cpiFileFullChecksum: + example: string + nullable: false + type: string + cpks: + items: + $ref: '#/components/schemas/CPIV5Response_cpis_inner_cpks_inner' + type: array + groupPolicy: + example: string + nullable: true + type: string + id: + $ref: '#/components/schemas/CPIIDV5' + timestamp: + example: 2022-06-24T10:15:30Z + format: date-time + nullable: false + type: string + type: object + StartFlowV5Request_requestBody: + example: + numberOfRecords: numberOfRecords + otherMember: otherMember + chatName: chatName + message: message + properties: + chatName: + type: string + otherMember: + type: string + message: + type: string + numberOfRecords: + type: string + type: object + FlowStatusV5Responses_flowStatusResponses_inner: + properties: + clientRequestId: + example: string + nullable: true + type: string + flowError: + $ref: '#/components/schemas/FlowV5Error' + flowId: + example: string + nullable: true + type: string + flowResult: + example: string + nullable: true + type: string + flowStatus: + example: string + nullable: false + type: string + holdingIDShortHash: + example: string + nullable: false + type: string + timestamp: + example: 2022-06-24T10:15:30Z + format: date-time + nullable: false + type: string + type: object diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/start-app.sh b/packages/cactus-plugin-ledger-connector-corda/src/main-server/start-app.sh old mode 100755 new mode 100644 diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/json/openapi.json b/packages/cactus-plugin-ledger-connector-corda/src/main/json/openapi.json index d7719d2a105..6f232a1eac7 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/json/openapi.json +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/json/openapi.json @@ -864,7 +864,341 @@ "PrometheusExporterMetricsResponse": { "type": "string", "nullable": false + }, + "ListCpiV1Response":{ + "type": "object", + "required": ["hash", "id", "libraries", "mainBundle", "timestamp", "type"], + "properties": { + "cpis": { + "type": "array", + "items": { + "type": "object", + "properties": { + "cpiFileChecksum": { + "type": "string", + "nullable": false, + "example": "string" + }, + "cpiFileFullChecksum": { + "type": "string", + "nullable": false, + "example": "string" + }, + "cpks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "hash": { + "type": "string", + "nullable": false, + "example": "string" + }, + "id": { + "$ref": "#/components/schemas/CPIIDV1" + }, + "libraries": { + "type": "array", + "items": { + "type": "string", + "nullable": false, + "example": "string" + } + }, + "mainBundle": { + "type": "string", + "nullable": false, + "example": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "nullable": false, + "example": "2022-06-24T10:15:30Z" + }, + "type": { + "type": "string", + "nullable": false, + "example": "string" + } + } + } + }, + "groupPolicy": { + "type": "string", + "nullable": true, + "example": "string" + }, + "id": { + "$ref": "#/components/schemas/CPIIDV1" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "nullable": false, + "example": "2022-06-24T10:15:30Z" + } + } + } + } + } + }, + "ListCpiV1Request" : { + "required": ["username", "password", "baseUrl"], + "properties": { + "username": { + "type": "string", + "nullable": false + }, + "password": { + "type": "string", + "nullable": false + }, + "baseUrl": { + "type": "string", + "nullable": false + } + } + }, + "StartFlowV1Request": { + "description": "This method starts a new instance for the specified flow for the specified holding identity.", + "type": "object", + "required": ["clientRequestId", "flowClassName", "requestBody", "username", "password"], + "properties": { + "username": { + "type": "string", + "nullable": false + }, + "password": { + "type": "string", + "nullable": false + }, + "baseUrl": { + "type": "string", + "nullable": false + }, + "holdingIDShortHash":{ + "type": "string", + "nullable": false + }, + "clientRequestId": { + "type": "string", + "nullable": false + }, + "flowClassName": { + "type": "string", + "nullable": false + }, + "requestBody": { + "type": "object", + "properties": { + "chatName": { + "type": "string" + }, + "otherMember": { + "type": "string" + }, + "message": { + "type": "string" + }, + "numberOfRecords": { + "type": "string" + } + } + } + } + }, + "GetFlowCidV1Request" : { + "description": "This method gets the current status of the specified flow instance.", + "required": ["username", "password", "baseUrl"], + "properties": { + "username": { + "type": "string", + "nullable": false + }, + "password": { + "type": "string", + "nullable": false + }, + "baseUrl": { + "type": "string", + "nullable": false + }, + "holdingIDShortHash":{ + "type": "string", + "nullable": false + }, + "clientRequestId": { + "type": "string", + "nullable": false + } + } + }, + "GetFlowCidV1Response": { + "type": "object", + "required": ["flowStatus", "holdingIDShortHash", "timestamp"], + "properties": { + "clientRequestId": { + "type": "string", + "nullable": true, + "example": "string" + }, + "flowError": { + "$ref": "#/components/schemas/FlowV1Error" + }, + "flowId": { + "type": "string", + "nullable": true, + "example": "string" + }, + "flowResult": { + "type": "string", + "nullable": true, + "example": "string" + }, + "flowStatus": { + "type": "string", + "nullable": false, + "example": "string" + }, + "holdingIDShortHash": { + "type": "string", + "nullable": false, + "example": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "nullable": false, + "example": "2022-06-24T10:15:30Z" + } + } + }, + "FlowStatusV1Responses": { + "type": "object", + "required": ["flowStatus", "holdingIDShortHash", "timestamp"], + "properties": { + "flowStatusResponses": { + "type": "array", + "items": { + "type": "object", + "properties": { + "clientRequestId": { + "type": "string", + "nullable": true, + "example": "string" + }, + "flowError": { + "$ref": "#/components/schemas/FlowV1Error" + }, + "flowId": { + "type": "string", + "nullable": true, + "example": "string" + }, + "flowResult": { + "type": "string", + "nullable": true, + "example": "string" + }, + "flowStatus": { + "type": "string", + "nullable": false, + "example": "string" + }, + "holdingIDShortHash": { + "type": "string", + "nullable": false, + "example": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "nullable": false, + "example": "2022-06-24T10:15:30Z" + } + } + } + } + } + }, + "StartFlowV1Response": { + "type": "object", + "required": ["flowStatus", "holdingIDShortHash", "timestamp"], + "properties": { + "clientRequestId": { + "type": "string", + "nullable": true, + "example": "string" + }, + "flowError": { + "$ref": "#/components/schemas/FlowV1Error" + }, + "flowId": { + "type": "string", + "nullable": true, + "example": "string" + }, + "flowResult": { + "type": "string", + "nullable": true, + "example": "string" + }, + "flowStatus": { + "type": "string", + "nullable": false, + "example": "string" + }, + "holdingIDShortHash": { + "type": "string", + "nullable": false, + "example": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "nullable": false, + "example": "2022-06-24T10:15:30Z" + } } + }, + "CPIIDV1":{ + "type": "object", + "required": ["name", "version"], + "properties": { + "name": { + "type": "string", + "nullable": false, + "example": "string" + }, + "signerSummaryHash": { + "type": "string", + "nullable": true, + "example": "string" + }, + "version": { + "type": "string", + "nullable": false, + "example": "string" + } + } + }, + "FlowV1Error": { + "type": "object", + "required": ["message", "type"], + "properties": { + "message": { + "type": "string", + "nullable": false, + "example": "string" + }, + "type": { + "type": "string", + "nullable": false, + "example": "string" + } + } + } } }, "paths": { @@ -1208,6 +1542,160 @@ } } } + }, + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listCPI": { + "get": { + "x-hyperledger-cactus": { + "https": { + "verbLowerCase": "get", + "path": "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listCPI" + } + }, + "operationId": "listCpiV1", + "summary": "List all CPIs uploaded to the cluster", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCpiV1Request" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCpiV1Response" + } + } + } + } + } + } + }, + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listFlows": { + "get": { + "x-hyperledger-cactus": { + "http": { + "verbLowerCase": "get", + "path": "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listFlows" + } + }, + "operationId": "listFlowV1", + "summary": "This method returns an array containing the statuses of all flows running for a specified holding identity. An empty array is returned if there are no flows running.", + "parameters": [], + "requestBody": { + "description": "This method gets the current status of the specified flow instance.", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetFlowCidV1Request" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/FlowStatusV1Responses" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + } + } + }, + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/getFlowCid": { + "get": { + "x-hyperledger-cactus": { + "http": { + "verbLowerCase": "get", + "path": "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/getFlowCid" + } + }, + "operationId": "getFlowV1", + "summary": "This method gets the current status of the specified flow instance.", + "requestBody": { + "description": "This method gets the current status of the specified flow instance.", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetFlowCidV1Request" + } + } + } + }, + "parameters": [], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/GetFlowCidV1Response" + } + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + } + } + }, + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/startFlow": { + "post": { + "x-hyperledger-cactus": { + "http": { + "verbLowerCase": "post", + "path": "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/startFlow" + } + }, + "operationId": "startFlowV1", + "summary": "This method starts a new instance for the specified flow for the specified holding identity.", + "requestBody": { + "description": "Request body for starting a flow", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartFlowV1Request" + } + } + } + }, + "parameters": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartFlowV1Response" + } + } + } + } + } + } } } } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES index e53c49ad829..eda5d4d08c0 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/.openapi-generator/FILES @@ -21,6 +21,7 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +src/main/kotlin/org/openapitools/client/models/CPIIDV1.kt src/main/kotlin/org/openapitools/client/models/ClearMonitorTransactionsV1Request.kt src/main/kotlin/org/openapitools/client/models/ClearMonitorTransactionsV1Response.kt src/main/kotlin/org/openapitools/client/models/CordaNodeSshCredentials.kt @@ -34,6 +35,11 @@ src/main/kotlin/org/openapitools/client/models/DeployContractJarsV1Request.kt src/main/kotlin/org/openapitools/client/models/DiagnoseNodeV1Request.kt src/main/kotlin/org/openapitools/client/models/DiagnoseNodeV1Response.kt src/main/kotlin/org/openapitools/client/models/FlowInvocationType.kt +src/main/kotlin/org/openapitools/client/models/FlowStatusV1Responses.kt +src/main/kotlin/org/openapitools/client/models/FlowStatusV1ResponsesFlowStatusResponsesInner.kt +src/main/kotlin/org/openapitools/client/models/FlowV1Error.kt +src/main/kotlin/org/openapitools/client/models/GetFlowCidV1Request.kt +src/main/kotlin/org/openapitools/client/models/GetFlowCidV1Response.kt src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1Request.kt src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1Response.kt src/main/kotlin/org/openapitools/client/models/GetMonitorTransactionsV1ResponseTxInner.kt @@ -43,6 +49,10 @@ src/main/kotlin/org/openapitools/client/models/JarFile.kt src/main/kotlin/org/openapitools/client/models/JvmObject.kt src/main/kotlin/org/openapitools/client/models/JvmType.kt src/main/kotlin/org/openapitools/client/models/JvmTypeKind.kt +src/main/kotlin/org/openapitools/client/models/ListCpiV1Request.kt +src/main/kotlin/org/openapitools/client/models/ListCpiV1Response.kt +src/main/kotlin/org/openapitools/client/models/ListCpiV1ResponseCpisInner.kt +src/main/kotlin/org/openapitools/client/models/ListCpiV1ResponseCpisInnerCpksInner.kt src/main/kotlin/org/openapitools/client/models/ListFlowsV1Request.kt src/main/kotlin/org/openapitools/client/models/ListFlowsV1Response.kt src/main/kotlin/org/openapitools/client/models/NetworkHostAndPort.kt @@ -51,6 +61,9 @@ src/main/kotlin/org/openapitools/client/models/NodeInfo.kt src/main/kotlin/org/openapitools/client/models/Party.kt src/main/kotlin/org/openapitools/client/models/PublicKey.kt src/main/kotlin/org/openapitools/client/models/SHA256.kt +src/main/kotlin/org/openapitools/client/models/StartFlowV1Request.kt +src/main/kotlin/org/openapitools/client/models/StartFlowV1RequestRequestBody.kt +src/main/kotlin/org/openapitools/client/models/StartFlowV1Response.kt src/main/kotlin/org/openapitools/client/models/StartMonitorV1Request.kt src/main/kotlin/org/openapitools/client/models/StartMonitorV1Response.kt src/main/kotlin/org/openapitools/client/models/StopMonitorV1Request.kt diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/README.md b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/README.md index 3f23c110252..cbe176dba49 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/README.md +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/README.md @@ -47,11 +47,15 @@ Class | Method | HTTP request | Description *DefaultApi* | [**clearMonitorTransactionsV1**](docs/DefaultApi.md#clearmonitortransactionsv1) | **DELETE** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions | Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. *DefaultApi* | [**deployContractJarsV1**](docs/DefaultApi.md#deploycontractjarsv1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars | Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). *DefaultApi* | [**diagnoseNodeV1**](docs/DefaultApi.md#diagnosenodev1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node | +*DefaultApi* | [**getFlowV1**](docs/DefaultApi.md#getflowv1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/getFlowCid | This method gets the current status of the specified flow instance. *DefaultApi* | [**getMonitorTransactionsV1**](docs/DefaultApi.md#getmonitortransactionsv1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions | Get transactions for monitored state classes. *DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics | Get the Prometheus Metrics *DefaultApi* | [**invokeContractV1**](docs/DefaultApi.md#invokecontractv1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract | Invokes a contract on a Corda ledger (e.g. a flow) +*DefaultApi* | [**listCpiV1**](docs/DefaultApi.md#listcpiv1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listCPI | List all CPIs uploaded to the cluster +*DefaultApi* | [**listFlowV1**](docs/DefaultApi.md#listflowv1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listFlows | This method returns an array containing the statuses of all flows running for a specified holding identity. An empty array is returned if there are no flows running. *DefaultApi* | [**listFlowsV1**](docs/DefaultApi.md#listflowsv1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows | *DefaultApi* | [**networkMapV1**](docs/DefaultApi.md#networkmapv1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map | +*DefaultApi* | [**startFlowV1**](docs/DefaultApi.md#startflowv1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/startFlow | This method starts a new instance for the specified flow for the specified holding identity. *DefaultApi* | [**startMonitorV1**](docs/DefaultApi.md#startmonitorv1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor | Start monitoring corda changes (transactions) of given state class *DefaultApi* | [**stopMonitorV1**](docs/DefaultApi.md#stopmonitorv1) | **DELETE** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor | Stop monitoring corda changes (transactions) of given state class @@ -59,6 +63,7 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [org.openapitools.client.models.CPIIDV1](docs/CPIIDV1.md) - [org.openapitools.client.models.ClearMonitorTransactionsV1Request](docs/ClearMonitorTransactionsV1Request.md) - [org.openapitools.client.models.ClearMonitorTransactionsV1Response](docs/ClearMonitorTransactionsV1Response.md) - [org.openapitools.client.models.CordaNodeSshCredentials](docs/CordaNodeSshCredentials.md) @@ -72,6 +77,11 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.DiagnoseNodeV1Request](docs/DiagnoseNodeV1Request.md) - [org.openapitools.client.models.DiagnoseNodeV1Response](docs/DiagnoseNodeV1Response.md) - [org.openapitools.client.models.FlowInvocationType](docs/FlowInvocationType.md) + - [org.openapitools.client.models.FlowStatusV1Responses](docs/FlowStatusV1Responses.md) + - [org.openapitools.client.models.FlowStatusV1ResponsesFlowStatusResponsesInner](docs/FlowStatusV1ResponsesFlowStatusResponsesInner.md) + - [org.openapitools.client.models.FlowV1Error](docs/FlowV1Error.md) + - [org.openapitools.client.models.GetFlowCidV1Request](docs/GetFlowCidV1Request.md) + - [org.openapitools.client.models.GetFlowCidV1Response](docs/GetFlowCidV1Response.md) - [org.openapitools.client.models.GetMonitorTransactionsV1Request](docs/GetMonitorTransactionsV1Request.md) - [org.openapitools.client.models.GetMonitorTransactionsV1Response](docs/GetMonitorTransactionsV1Response.md) - [org.openapitools.client.models.GetMonitorTransactionsV1ResponseTxInner](docs/GetMonitorTransactionsV1ResponseTxInner.md) @@ -81,6 +91,10 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.JvmObject](docs/JvmObject.md) - [org.openapitools.client.models.JvmType](docs/JvmType.md) - [org.openapitools.client.models.JvmTypeKind](docs/JvmTypeKind.md) + - [org.openapitools.client.models.ListCpiV1Request](docs/ListCpiV1Request.md) + - [org.openapitools.client.models.ListCpiV1Response](docs/ListCpiV1Response.md) + - [org.openapitools.client.models.ListCpiV1ResponseCpisInner](docs/ListCpiV1ResponseCpisInner.md) + - [org.openapitools.client.models.ListCpiV1ResponseCpisInnerCpksInner](docs/ListCpiV1ResponseCpisInnerCpksInner.md) - [org.openapitools.client.models.ListFlowsV1Request](docs/ListFlowsV1Request.md) - [org.openapitools.client.models.ListFlowsV1Response](docs/ListFlowsV1Response.md) - [org.openapitools.client.models.NetworkHostAndPort](docs/NetworkHostAndPort.md) @@ -89,6 +103,9 @@ Class | Method | HTTP request | Description - [org.openapitools.client.models.Party](docs/Party.md) - [org.openapitools.client.models.PublicKey](docs/PublicKey.md) - [org.openapitools.client.models.SHA256](docs/SHA256.md) + - [org.openapitools.client.models.StartFlowV1Request](docs/StartFlowV1Request.md) + - [org.openapitools.client.models.StartFlowV1RequestRequestBody](docs/StartFlowV1RequestRequestBody.md) + - [org.openapitools.client.models.StartFlowV1Response](docs/StartFlowV1Response.md) - [org.openapitools.client.models.StartMonitorV1Request](docs/StartMonitorV1Request.md) - [org.openapitools.client.models.StartMonitorV1Response](docs/StartMonitorV1Response.md) - [org.openapitools.client.models.StopMonitorV1Request](docs/StopMonitorV1Request.md) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 2ee32d5289f..a3efe835376 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -26,13 +26,20 @@ import org.openapitools.client.models.DeployContractJarsSuccessV1Response import org.openapitools.client.models.DeployContractJarsV1Request import org.openapitools.client.models.DiagnoseNodeV1Request import org.openapitools.client.models.DiagnoseNodeV1Response +import org.openapitools.client.models.FlowStatusV1Responses +import org.openapitools.client.models.GetFlowCidV1Request +import org.openapitools.client.models.GetFlowCidV1Response import org.openapitools.client.models.GetMonitorTransactionsV1Request import org.openapitools.client.models.GetMonitorTransactionsV1Response import org.openapitools.client.models.InvokeContractV1Request import org.openapitools.client.models.InvokeContractV1Response +import org.openapitools.client.models.ListCpiV1Request +import org.openapitools.client.models.ListCpiV1Response import org.openapitools.client.models.ListFlowsV1Request import org.openapitools.client.models.ListFlowsV1Response import org.openapitools.client.models.NodeInfo +import org.openapitools.client.models.StartFlowV1Request +import org.openapitools.client.models.StartFlowV1Response import org.openapitools.client.models.StartMonitorV1Request import org.openapitools.client.models.StartMonitorV1Response import org.openapitools.client.models.StopMonitorV1Request @@ -278,6 +285,77 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient ) } + /** + * This method gets the current status of the specified flow instance. + * + * @param getFlowCidV1Request This method gets the current status of the specified flow instance. + * @return GetFlowCidV1Response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getFlowV1(getFlowCidV1Request: GetFlowCidV1Request) : GetFlowCidV1Response { + val localVarResponse = getFlowV1WithHttpInfo(getFlowCidV1Request = getFlowCidV1Request) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as GetFlowCidV1Response + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * This method gets the current status of the specified flow instance. + * + * @param getFlowCidV1Request This method gets the current status of the specified flow instance. + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getFlowV1WithHttpInfo(getFlowCidV1Request: GetFlowCidV1Request) : ApiResponse { + val localVariableConfig = getFlowV1RequestConfig(getFlowCidV1Request = getFlowCidV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation getFlowV1 + * + * @param getFlowCidV1Request This method gets the current status of the specified flow instance. + * @return RequestConfig + */ + fun getFlowV1RequestConfig(getFlowCidV1Request: GetFlowCidV1Request) : RequestConfig { + val localVariableBody = getFlowCidV1Request + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + + return RequestConfig( + method = RequestMethod.GET, + path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/getFlowCid", + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + /** * Get transactions for monitored state classes. * @@ -489,6 +567,149 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient ) } + /** + * List all CPIs uploaded to the cluster + * + * @param listCpiV1Request + * @return ListCpiV1Response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun listCpiV1(listCpiV1Request: ListCpiV1Request) : ListCpiV1Response { + val localVarResponse = listCpiV1WithHttpInfo(listCpiV1Request = listCpiV1Request) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ListCpiV1Response + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * List all CPIs uploaded to the cluster + * + * @param listCpiV1Request + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun listCpiV1WithHttpInfo(listCpiV1Request: ListCpiV1Request) : ApiResponse { + val localVariableConfig = listCpiV1RequestConfig(listCpiV1Request = listCpiV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation listCpiV1 + * + * @param listCpiV1Request + * @return RequestConfig + */ + fun listCpiV1RequestConfig(listCpiV1Request: ListCpiV1Request) : RequestConfig { + val localVariableBody = listCpiV1Request + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" + + return RequestConfig( + method = RequestMethod.GET, + path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listCPI", + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + /** + * This method returns an array containing the statuses of all flows running for a specified holding identity. An empty array is returned if there are no flows running. + * + * @param getFlowCidV1Request This method gets the current status of the specified flow instance. + * @return FlowStatusV1Responses + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun listFlowV1(getFlowCidV1Request: GetFlowCidV1Request) : FlowStatusV1Responses { + val localVarResponse = listFlowV1WithHttpInfo(getFlowCidV1Request = getFlowCidV1Request) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as FlowStatusV1Responses + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * This method returns an array containing the statuses of all flows running for a specified holding identity. An empty array is returned if there are no flows running. + * + * @param getFlowCidV1Request This method gets the current status of the specified flow instance. + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun listFlowV1WithHttpInfo(getFlowCidV1Request: GetFlowCidV1Request) : ApiResponse { + val localVariableConfig = listFlowV1RequestConfig(getFlowCidV1Request = getFlowCidV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation listFlowV1 + * + * @param getFlowCidV1Request This method gets the current status of the specified flow instance. + * @return RequestConfig + */ + fun listFlowV1RequestConfig(getFlowCidV1Request: GetFlowCidV1Request) : RequestConfig { + val localVariableBody = getFlowCidV1Request + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + + return RequestConfig( + method = RequestMethod.GET, + path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listFlows", + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + /** * * Responds with a list of the flows on the Corda node. @@ -633,6 +854,78 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient ) } + /** + * This method starts a new instance for the specified flow for the specified holding identity. + * + * @param startFlowV1Request Request body for starting a flow + * @return StartFlowV1Response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun startFlowV1(startFlowV1Request: StartFlowV1Request) : StartFlowV1Response { + val localVarResponse = startFlowV1WithHttpInfo(startFlowV1Request = startFlowV1Request) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as StartFlowV1Response + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * This method starts a new instance for the specified flow for the specified holding identity. + * + * @param startFlowV1Request Request body for starting a flow + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun startFlowV1WithHttpInfo(startFlowV1Request: StartFlowV1Request) : ApiResponse { + val localVariableConfig = startFlowV1RequestConfig(startFlowV1Request = startFlowV1Request) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation startFlowV1 + * + * @param startFlowV1Request Request body for starting a flow + * @return RequestConfig + */ + fun startFlowV1RequestConfig(startFlowV1Request: StartFlowV1Request) : RequestConfig { + val localVariableBody = startFlowV1Request + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" + + return RequestConfig( + method = RequestMethod.POST, + path = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/startFlow", + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + /** * Start monitoring corda changes (transactions) of given state class * diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CPIIDV1.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CPIIDV1.kt new file mode 100644 index 00000000000..a8d6a8ed1dd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/CPIIDV1.kt @@ -0,0 +1,43 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * + * + * @param name + * @param version + * @param signerSummaryHash + */ + + +data class CPIIDV1 ( + + @Json(name = "name") + val name: kotlin.String, + + @Json(name = "version") + val version: kotlin.String, + + @Json(name = "signerSummaryHash") + val signerSummaryHash: kotlin.String? = null + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowStatusV1Responses.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowStatusV1Responses.kt new file mode 100644 index 00000000000..ec65d761cf1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowStatusV1Responses.kt @@ -0,0 +1,36 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.FlowStatusV1ResponsesFlowStatusResponsesInner + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * + * + * @param flowStatusResponses + */ + + +data class FlowStatusV1Responses ( + + @Json(name = "flowStatusResponses") + val flowStatusResponses: kotlin.collections.List? = null + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowStatusV1ResponsesFlowStatusResponsesInner.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowStatusV1ResponsesFlowStatusResponsesInner.kt new file mode 100644 index 00000000000..8e97285f91d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowStatusV1ResponsesFlowStatusResponsesInner.kt @@ -0,0 +1,60 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.FlowV1Error + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * + * + * @param clientRequestId + * @param flowError + * @param flowId + * @param flowResult + * @param flowStatus + * @param holdingIDShortHash + * @param timestamp + */ + + +data class FlowStatusV1ResponsesFlowStatusResponsesInner ( + + @Json(name = "clientRequestId") + val clientRequestId: kotlin.String? = null, + + @Json(name = "flowError") + val flowError: FlowV1Error? = null, + + @Json(name = "flowId") + val flowId: kotlin.String? = null, + + @Json(name = "flowResult") + val flowResult: kotlin.String? = null, + + @Json(name = "flowStatus") + val flowStatus: kotlin.String? = null, + + @Json(name = "holdingIDShortHash") + val holdingIDShortHash: kotlin.String? = null, + + @Json(name = "timestamp") + val timestamp: java.time.OffsetDateTime? = null + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowV1Error.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowV1Error.kt new file mode 100644 index 00000000000..937ef910a9d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/FlowV1Error.kt @@ -0,0 +1,39 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * + * + * @param message + * @param type + */ + + +data class FlowV1Error ( + + @Json(name = "message") + val message: kotlin.String, + + @Json(name = "type") + val type: kotlin.String + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetFlowCidV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetFlowCidV1Request.kt new file mode 100644 index 00000000000..fb11bf28e07 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetFlowCidV1Request.kt @@ -0,0 +1,51 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * This method gets the current status of the specified flow instance. + * + * @param username + * @param password + * @param baseUrl + * @param holdingIDShortHash + * @param clientRequestId + */ + + +data class GetFlowCidV1Request ( + + @Json(name = "username") + val username: kotlin.String, + + @Json(name = "password") + val password: kotlin.String, + + @Json(name = "baseUrl") + val baseUrl: kotlin.String, + + @Json(name = "holdingIDShortHash") + val holdingIDShortHash: kotlin.String? = null, + + @Json(name = "clientRequestId") + val clientRequestId: kotlin.String? = null + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetFlowCidV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetFlowCidV1Response.kt new file mode 100644 index 00000000000..4a3890b7279 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetFlowCidV1Response.kt @@ -0,0 +1,60 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.FlowV1Error + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * + * + * @param flowStatus + * @param holdingIDShortHash + * @param timestamp + * @param clientRequestId + * @param flowError + * @param flowId + * @param flowResult + */ + + +data class GetFlowCidV1Response ( + + @Json(name = "flowStatus") + val flowStatus: kotlin.String, + + @Json(name = "holdingIDShortHash") + val holdingIDShortHash: kotlin.String, + + @Json(name = "timestamp") + val timestamp: java.time.OffsetDateTime, + + @Json(name = "clientRequestId") + val clientRequestId: kotlin.String? = null, + + @Json(name = "flowError") + val flowError: FlowV1Error? = null, + + @Json(name = "flowId") + val flowId: kotlin.String? = null, + + @Json(name = "flowResult") + val flowResult: kotlin.String? = null + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListCpiV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListCpiV1Request.kt new file mode 100644 index 00000000000..56f051a4998 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListCpiV1Request.kt @@ -0,0 +1,43 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * + * + * @param username + * @param password + * @param baseUrl + */ + + +data class ListCpiV1Request ( + + @Json(name = "username") + val username: kotlin.String, + + @Json(name = "password") + val password: kotlin.String, + + @Json(name = "baseUrl") + val baseUrl: kotlin.String + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListCpiV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListCpiV1Response.kt new file mode 100644 index 00000000000..cdccb81ee18 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListCpiV1Response.kt @@ -0,0 +1,36 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.ListCpiV1ResponseCpisInner + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * + * + * @param cpis + */ + + +data class ListCpiV1Response ( + + @Json(name = "cpis") + val cpis: kotlin.collections.List? = null + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListCpiV1ResponseCpisInner.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListCpiV1ResponseCpisInner.kt new file mode 100644 index 00000000000..6fe2958dc93 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListCpiV1ResponseCpisInner.kt @@ -0,0 +1,57 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.CPIIDV1 +import org.openapitools.client.models.ListCpiV1ResponseCpisInnerCpksInner + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * + * + * @param cpiFileChecksum + * @param cpiFileFullChecksum + * @param cpks + * @param groupPolicy + * @param id + * @param timestamp + */ + + +data class ListCpiV1ResponseCpisInner ( + + @Json(name = "cpiFileChecksum") + val cpiFileChecksum: kotlin.String? = null, + + @Json(name = "cpiFileFullChecksum") + val cpiFileFullChecksum: kotlin.String? = null, + + @Json(name = "cpks") + val cpks: kotlin.collections.List? = null, + + @Json(name = "groupPolicy") + val groupPolicy: kotlin.String? = null, + + @Json(name = "id") + val id: CPIIDV1? = null, + + @Json(name = "timestamp") + val timestamp: java.time.OffsetDateTime? = null + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListCpiV1ResponseCpisInnerCpksInner.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListCpiV1ResponseCpisInnerCpksInner.kt new file mode 100644 index 00000000000..ee0b917e368 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/ListCpiV1ResponseCpisInnerCpksInner.kt @@ -0,0 +1,56 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.CPIIDV1 + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * + * + * @param hash + * @param id + * @param libraries + * @param mainBundle + * @param timestamp + * @param type + */ + + +data class ListCpiV1ResponseCpisInnerCpksInner ( + + @Json(name = "hash") + val hash: kotlin.String? = null, + + @Json(name = "id") + val id: CPIIDV1? = null, + + @Json(name = "libraries") + val libraries: kotlin.collections.List? = null, + + @Json(name = "mainBundle") + val mainBundle: kotlin.String? = null, + + @Json(name = "timestamp") + val timestamp: java.time.OffsetDateTime? = null, + + @Json(name = "type") + val type: kotlin.String? = null + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartFlowV1Request.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartFlowV1Request.kt new file mode 100644 index 00000000000..e85e443e304 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartFlowV1Request.kt @@ -0,0 +1,60 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.StartFlowV1RequestRequestBody + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * This method starts a new instance for the specified flow for the specified holding identity. + * + * @param username + * @param password + * @param clientRequestId + * @param flowClassName + * @param requestBody + * @param baseUrl + * @param holdingIDShortHash + */ + + +data class StartFlowV1Request ( + + @Json(name = "username") + val username: kotlin.String, + + @Json(name = "password") + val password: kotlin.String, + + @Json(name = "clientRequestId") + val clientRequestId: kotlin.String, + + @Json(name = "flowClassName") + val flowClassName: kotlin.String, + + @Json(name = "requestBody") + val requestBody: StartFlowV1RequestRequestBody, + + @Json(name = "baseUrl") + val baseUrl: kotlin.String? = null, + + @Json(name = "holdingIDShortHash") + val holdingIDShortHash: kotlin.String? = null + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartFlowV1RequestRequestBody.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartFlowV1RequestRequestBody.kt new file mode 100644 index 00000000000..2fe79b77683 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartFlowV1RequestRequestBody.kt @@ -0,0 +1,47 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * + * + * @param chatName + * @param otherMember + * @param message + * @param numberOfRecords + */ + + +data class StartFlowV1RequestRequestBody ( + + @Json(name = "chatName") + val chatName: kotlin.String? = null, + + @Json(name = "otherMember") + val otherMember: kotlin.String? = null, + + @Json(name = "message") + val message: kotlin.String? = null, + + @Json(name = "numberOfRecords") + val numberOfRecords: kotlin.String? = null + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartFlowV1Response.kt b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartFlowV1Response.kt new file mode 100644 index 00000000000..359b7079683 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/StartFlowV1Response.kt @@ -0,0 +1,60 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.FlowV1Error + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * + * + * @param flowStatus + * @param holdingIDShortHash + * @param timestamp + * @param clientRequestId + * @param flowError + * @param flowId + * @param flowResult + */ + + +data class StartFlowV1Response ( + + @Json(name = "flowStatus") + val flowStatus: kotlin.String, + + @Json(name = "holdingIDShortHash") + val holdingIDShortHash: kotlin.String, + + @Json(name = "timestamp") + val timestamp: java.time.OffsetDateTime, + + @Json(name = "clientRequestId") + val clientRequestId: kotlin.String? = null, + + @Json(name = "flowError") + val flowError: FlowV1Error? = null, + + @Json(name = "flowId") + val flowId: kotlin.String? = null, + + @Json(name = "flowResult") + val flowResult: kotlin.String? = null + +) + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/.env b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/.env new file mode 100644 index 00000000000..b24056cca27 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/.env @@ -0,0 +1 @@ +REJECT_UNAUTHORIZED=false \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/api.ts index d9c951b6f90..1ca5a987bff 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -23,6 +23,31 @@ import type { RequestArgs } from './base'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; +/** + * + * @export + * @interface CPIIDV1 + */ +export interface CPIIDV1 { + /** + * + * @type {string} + * @memberof CPIIDV1 + */ + 'name': string; + /** + * + * @type {string} + * @memberof CPIIDV1 + */ + 'signerSummaryHash'?: string | null; + /** + * + * @type {string} + * @memberof CPIIDV1 + */ + 'version': string; +} /** * * @export @@ -373,6 +398,173 @@ export const FlowInvocationType = { export type FlowInvocationType = typeof FlowInvocationType[keyof typeof FlowInvocationType]; +/** + * + * @export + * @interface FlowStatusV1Responses + */ +export interface FlowStatusV1Responses { + /** + * + * @type {Array} + * @memberof FlowStatusV1Responses + */ + 'flowStatusResponses'?: Array; +} +/** + * + * @export + * @interface FlowStatusV1ResponsesFlowStatusResponsesInner + */ +export interface FlowStatusV1ResponsesFlowStatusResponsesInner { + /** + * + * @type {string} + * @memberof FlowStatusV1ResponsesFlowStatusResponsesInner + */ + 'clientRequestId'?: string | null; + /** + * + * @type {FlowV1Error} + * @memberof FlowStatusV1ResponsesFlowStatusResponsesInner + */ + 'flowError'?: FlowV1Error; + /** + * + * @type {string} + * @memberof FlowStatusV1ResponsesFlowStatusResponsesInner + */ + 'flowId'?: string | null; + /** + * + * @type {string} + * @memberof FlowStatusV1ResponsesFlowStatusResponsesInner + */ + 'flowResult'?: string | null; + /** + * + * @type {string} + * @memberof FlowStatusV1ResponsesFlowStatusResponsesInner + */ + 'flowStatus'?: string; + /** + * + * @type {string} + * @memberof FlowStatusV1ResponsesFlowStatusResponsesInner + */ + 'holdingIDShortHash'?: string; + /** + * + * @type {string} + * @memberof FlowStatusV1ResponsesFlowStatusResponsesInner + */ + 'timestamp'?: string; +} +/** + * + * @export + * @interface FlowV1Error + */ +export interface FlowV1Error { + /** + * + * @type {string} + * @memberof FlowV1Error + */ + 'message': string; + /** + * + * @type {string} + * @memberof FlowV1Error + */ + 'type': string; +} +/** + * This method gets the current status of the specified flow instance. + * @export + * @interface GetFlowCidV1Request + */ +export interface GetFlowCidV1Request { + /** + * + * @type {string} + * @memberof GetFlowCidV1Request + */ + 'username': string; + /** + * + * @type {string} + * @memberof GetFlowCidV1Request + */ + 'password': string; + /** + * + * @type {string} + * @memberof GetFlowCidV1Request + */ + 'baseUrl': string; + /** + * + * @type {string} + * @memberof GetFlowCidV1Request + */ + 'holdingIDShortHash'?: string; + /** + * + * @type {string} + * @memberof GetFlowCidV1Request + */ + 'clientRequestId'?: string; +} +/** + * + * @export + * @interface GetFlowCidV1Response + */ +export interface GetFlowCidV1Response { + /** + * + * @type {string} + * @memberof GetFlowCidV1Response + */ + 'clientRequestId'?: string | null; + /** + * + * @type {FlowV1Error} + * @memberof GetFlowCidV1Response + */ + 'flowError'?: FlowV1Error; + /** + * + * @type {string} + * @memberof GetFlowCidV1Response + */ + 'flowId'?: string | null; + /** + * + * @type {string} + * @memberof GetFlowCidV1Response + */ + 'flowResult'?: string | null; + /** + * + * @type {string} + * @memberof GetFlowCidV1Response + */ + 'flowStatus': string; + /** + * + * @type {string} + * @memberof GetFlowCidV1Response + */ + 'holdingIDShortHash': string; + /** + * + * @type {string} + * @memberof GetFlowCidV1Response + */ + 'timestamp': string; +} /** * * @export @@ -611,6 +803,130 @@ export const JvmTypeKind = { export type JvmTypeKind = typeof JvmTypeKind[keyof typeof JvmTypeKind]; +/** + * + * @export + * @interface ListCpiV1Request + */ +export interface ListCpiV1Request { + /** + * + * @type {string} + * @memberof ListCpiV1Request + */ + 'username': string; + /** + * + * @type {string} + * @memberof ListCpiV1Request + */ + 'password': string; + /** + * + * @type {string} + * @memberof ListCpiV1Request + */ + 'baseUrl': string; +} +/** + * + * @export + * @interface ListCpiV1Response + */ +export interface ListCpiV1Response { + /** + * + * @type {Array} + * @memberof ListCpiV1Response + */ + 'cpis'?: Array; +} +/** + * + * @export + * @interface ListCpiV1ResponseCpisInner + */ +export interface ListCpiV1ResponseCpisInner { + /** + * + * @type {string} + * @memberof ListCpiV1ResponseCpisInner + */ + 'cpiFileChecksum'?: string; + /** + * + * @type {string} + * @memberof ListCpiV1ResponseCpisInner + */ + 'cpiFileFullChecksum'?: string; + /** + * + * @type {Array} + * @memberof ListCpiV1ResponseCpisInner + */ + 'cpks'?: Array; + /** + * + * @type {string} + * @memberof ListCpiV1ResponseCpisInner + */ + 'groupPolicy'?: string | null; + /** + * + * @type {CPIIDV1} + * @memberof ListCpiV1ResponseCpisInner + */ + 'id'?: CPIIDV1; + /** + * + * @type {string} + * @memberof ListCpiV1ResponseCpisInner + */ + 'timestamp'?: string; +} +/** + * + * @export + * @interface ListCpiV1ResponseCpisInnerCpksInner + */ +export interface ListCpiV1ResponseCpisInnerCpksInner { + /** + * + * @type {string} + * @memberof ListCpiV1ResponseCpisInnerCpksInner + */ + 'hash'?: string; + /** + * + * @type {CPIIDV1} + * @memberof ListCpiV1ResponseCpisInnerCpksInner + */ + 'id'?: CPIIDV1; + /** + * + * @type {Array} + * @memberof ListCpiV1ResponseCpisInnerCpksInner + */ + 'libraries'?: Array; + /** + * + * @type {string} + * @memberof ListCpiV1ResponseCpisInnerCpksInner + */ + 'mainBundle'?: string; + /** + * + * @type {string} + * @memberof ListCpiV1ResponseCpisInnerCpksInner + */ + 'timestamp'?: string; + /** + * + * @type {string} + * @memberof ListCpiV1ResponseCpisInnerCpksInner + */ + 'type'?: string; +} /** * * @export @@ -799,6 +1115,135 @@ export interface SHA256 { */ 'size': number; } +/** + * This method starts a new instance for the specified flow for the specified holding identity. + * @export + * @interface StartFlowV1Request + */ +export interface StartFlowV1Request { + /** + * + * @type {string} + * @memberof StartFlowV1Request + */ + 'username': string; + /** + * + * @type {string} + * @memberof StartFlowV1Request + */ + 'password': string; + /** + * + * @type {string} + * @memberof StartFlowV1Request + */ + 'baseUrl'?: string; + /** + * + * @type {string} + * @memberof StartFlowV1Request + */ + 'holdingIDShortHash'?: string; + /** + * + * @type {string} + * @memberof StartFlowV1Request + */ + 'clientRequestId': string; + /** + * + * @type {string} + * @memberof StartFlowV1Request + */ + 'flowClassName': string; + /** + * + * @type {StartFlowV1RequestRequestBody} + * @memberof StartFlowV1Request + */ + 'requestBody': StartFlowV1RequestRequestBody; +} +/** + * + * @export + * @interface StartFlowV1RequestRequestBody + */ +export interface StartFlowV1RequestRequestBody { + /** + * + * @type {string} + * @memberof StartFlowV1RequestRequestBody + */ + 'chatName'?: string; + /** + * + * @type {string} + * @memberof StartFlowV1RequestRequestBody + */ + 'otherMember'?: string; + /** + * + * @type {string} + * @memberof StartFlowV1RequestRequestBody + */ + 'message'?: string; + /** + * + * @type {string} + * @memberof StartFlowV1RequestRequestBody + */ + 'numberOfRecords'?: string; +} +/** + * + * @export + * @interface StartFlowV1Response + */ +export interface StartFlowV1Response { + /** + * + * @type {string} + * @memberof StartFlowV1Response + */ + 'clientRequestId'?: string | null; + /** + * + * @type {FlowV1Error} + * @memberof StartFlowV1Response + */ + 'flowError'?: FlowV1Error; + /** + * + * @type {string} + * @memberof StartFlowV1Response + */ + 'flowId'?: string | null; + /** + * + * @type {string} + * @memberof StartFlowV1Response + */ + 'flowResult'?: string | null; + /** + * + * @type {string} + * @memberof StartFlowV1Response + */ + 'flowStatus': string; + /** + * + * @type {string} + * @memberof StartFlowV1Response + */ + 'holdingIDShortHash': string; + /** + * + * @type {string} + * @memberof StartFlowV1Response + */ + 'timestamp': string; +} /** * * @export @@ -1002,6 +1447,42 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati options: localVarRequestOptions, }; }, + /** + * + * @summary This method gets the current status of the specified flow instance. + * @param {GetFlowCidV1Request} getFlowCidV1Request This method gets the current status of the specified flow instance. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getFlowV1: async (getFlowCidV1Request: GetFlowCidV1Request, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'getFlowCidV1Request' is not null or undefined + assertParamExists('getFlowV1', 'getFlowCidV1Request', getFlowCidV1Request) + const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/getFlowCid`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(getFlowCidV1Request, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @summary Get transactions for monitored state classes. @@ -1100,6 +1581,78 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati options: localVarRequestOptions, }; }, + /** + * + * @summary List all CPIs uploaded to the cluster + * @param {ListCpiV1Request} listCpiV1Request + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listCpiV1: async (listCpiV1Request: ListCpiV1Request, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'listCpiV1Request' is not null or undefined + assertParamExists('listCpiV1', 'listCpiV1Request', listCpiV1Request) + const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listCPI`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(listCpiV1Request, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary This method returns an array containing the statuses of all flows running for a specified holding identity. An empty array is returned if there are no flows running. + * @param {GetFlowCidV1Request} getFlowCidV1Request This method gets the current status of the specified flow instance. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listFlowV1: async (getFlowCidV1Request: GetFlowCidV1Request, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'getFlowCidV1Request' is not null or undefined + assertParamExists('listFlowV1', 'getFlowCidV1Request', getFlowCidV1Request) + const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listFlows`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(getFlowCidV1Request, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Responds with a list of the flows on the Corda node. * @param {ListFlowsV1Request} [listFlowsV1Request] @@ -1166,6 +1719,42 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati options: localVarRequestOptions, }; }, + /** + * + * @summary This method starts a new instance for the specified flow for the specified holding identity. + * @param {StartFlowV1Request} startFlowV1Request Request body for starting a flow + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + startFlowV1: async (startFlowV1Request: StartFlowV1Request, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'startFlowV1Request' is not null or undefined + assertParamExists('startFlowV1', 'startFlowV1Request', startFlowV1Request) + const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/startFlow`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(startFlowV1Request, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @summary Start monitoring corda changes (transactions) of given state class @@ -1276,6 +1865,17 @@ export const DefaultApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.diagnoseNodeV1(diagnoseNodeV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @summary This method gets the current status of the specified flow instance. + * @param {GetFlowCidV1Request} getFlowCidV1Request This method gets the current status of the specified flow instance. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getFlowV1(getFlowCidV1Request: GetFlowCidV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getFlowV1(getFlowCidV1Request, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @summary Get transactions for monitored state classes. @@ -1308,6 +1908,28 @@ export const DefaultApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.invokeContractV1(invokeContractV1Request, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @summary List all CPIs uploaded to the cluster + * @param {ListCpiV1Request} listCpiV1Request + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listCpiV1(listCpiV1Request: ListCpiV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listCpiV1(listCpiV1Request, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary This method returns an array containing the statuses of all flows running for a specified holding identity. An empty array is returned if there are no flows running. + * @param {GetFlowCidV1Request} getFlowCidV1Request This method gets the current status of the specified flow instance. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listFlowV1(getFlowCidV1Request: GetFlowCidV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listFlowV1(getFlowCidV1Request, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * Responds with a list of the flows on the Corda node. * @param {ListFlowsV1Request} [listFlowsV1Request] @@ -1328,6 +1950,17 @@ export const DefaultApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.networkMapV1(body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @summary This method starts a new instance for the specified flow for the specified holding identity. + * @param {StartFlowV1Request} startFlowV1Request Request body for starting a flow + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async startFlowV1(startFlowV1Request: StartFlowV1Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.startFlowV1(startFlowV1Request, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @summary Start monitoring corda changes (transactions) of given state class @@ -1389,6 +2022,16 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa diagnoseNodeV1(diagnoseNodeV1Request?: DiagnoseNodeV1Request, options?: any): AxiosPromise { return localVarFp.diagnoseNodeV1(diagnoseNodeV1Request, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary This method gets the current status of the specified flow instance. + * @param {GetFlowCidV1Request} getFlowCidV1Request This method gets the current status of the specified flow instance. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getFlowV1(getFlowCidV1Request: GetFlowCidV1Request, options?: any): AxiosPromise { + return localVarFp.getFlowV1(getFlowCidV1Request, options).then((request) => request(axios, basePath)); + }, /** * * @summary Get transactions for monitored state classes. @@ -1418,6 +2061,26 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: any): AxiosPromise { return localVarFp.invokeContractV1(invokeContractV1Request, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary List all CPIs uploaded to the cluster + * @param {ListCpiV1Request} listCpiV1Request + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listCpiV1(listCpiV1Request: ListCpiV1Request, options?: any): AxiosPromise { + return localVarFp.listCpiV1(listCpiV1Request, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary This method returns an array containing the statuses of all flows running for a specified holding identity. An empty array is returned if there are no flows running. + * @param {GetFlowCidV1Request} getFlowCidV1Request This method gets the current status of the specified flow instance. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listFlowV1(getFlowCidV1Request: GetFlowCidV1Request, options?: any): AxiosPromise { + return localVarFp.listFlowV1(getFlowCidV1Request, options).then((request) => request(axios, basePath)); + }, /** * Responds with a list of the flows on the Corda node. * @param {ListFlowsV1Request} [listFlowsV1Request] @@ -1436,6 +2099,16 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa networkMapV1(body?: object, options?: any): AxiosPromise> { return localVarFp.networkMapV1(body, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary This method starts a new instance for the specified flow for the specified holding identity. + * @param {StartFlowV1Request} startFlowV1Request Request body for starting a flow + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + startFlowV1(startFlowV1Request: StartFlowV1Request, options?: any): AxiosPromise { + return localVarFp.startFlowV1(startFlowV1Request, options).then((request) => request(axios, basePath)); + }, /** * * @summary Start monitoring corda changes (transactions) of given state class @@ -1501,6 +2174,18 @@ export class DefaultApi extends BaseAPI { return DefaultApiFp(this.configuration).diagnoseNodeV1(diagnoseNodeV1Request, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary This method gets the current status of the specified flow instance. + * @param {GetFlowCidV1Request} getFlowCidV1Request This method gets the current status of the specified flow instance. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getFlowV1(getFlowCidV1Request: GetFlowCidV1Request, options?: AxiosRequestConfig) { + return DefaultApiFp(this.configuration).getFlowV1(getFlowCidV1Request, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @summary Get transactions for monitored state classes. @@ -1536,6 +2221,30 @@ export class DefaultApi extends BaseAPI { return DefaultApiFp(this.configuration).invokeContractV1(invokeContractV1Request, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary List all CPIs uploaded to the cluster + * @param {ListCpiV1Request} listCpiV1Request + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public listCpiV1(listCpiV1Request: ListCpiV1Request, options?: AxiosRequestConfig) { + return DefaultApiFp(this.configuration).listCpiV1(listCpiV1Request, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary This method returns an array containing the statuses of all flows running for a specified holding identity. An empty array is returned if there are no flows running. + * @param {GetFlowCidV1Request} getFlowCidV1Request This method gets the current status of the specified flow instance. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public listFlowV1(getFlowCidV1Request: GetFlowCidV1Request, options?: AxiosRequestConfig) { + return DefaultApiFp(this.configuration).listFlowV1(getFlowCidV1Request, options).then((request) => request(this.axios, this.basePath)); + } + /** * Responds with a list of the flows on the Corda node. * @param {ListFlowsV1Request} [listFlowsV1Request] @@ -1558,6 +2267,18 @@ export class DefaultApi extends BaseAPI { return DefaultApiFp(this.configuration).networkMapV1(body, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary This method starts a new instance for the specified flow for the specified holding identity. + * @param {StartFlowV1Request} startFlowV1Request Request body for starting a flow + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public startFlowV1(startFlowV1Request: StartFlowV1Request, options?: AxiosRequestConfig) { + return DefaultApiFp(this.configuration).startFlowV1(startFlowV1Request, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @summary Start monitoring corda changes (transactions) of given state class diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/plugin-ledger-connector-corda.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/plugin-ledger-connector-corda.ts index 02729494edd..40630ce92e5 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/plugin-ledger-connector-corda.ts +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/plugin-ledger-connector-corda.ts @@ -4,6 +4,13 @@ import type { Config as SshConfig } from "node-ssh"; import type { Express } from "express"; import OAS from "../json/openapi.json"; +import { + ListCpiV1Response, + StartFlowV1Request, + GetFlowCidV1Response, + GetFlowCidV1Request, + ListCpiV1Request, +} from "./generated/openapi/typescript-axios"; import { IPluginLedgerConnector, @@ -32,6 +39,19 @@ import { IInvokeContractEndpointV1Options, InvokeContractEndpointV1, } from "./web-services/invoke-contract-endpoint-v1"; + +import { + IListCPIEndpointV1Options, + ListCPIEndpointV1, +} from "./web-services/list-cpi-endpoint-v1"; +import { + IFlowStatusEndpointV1Options, + FlowStatusEndpointV1, +} from "./web-services/list-flow-endpoint-v1"; +import { + IFlowStatusResponseEndpointV1Options, + FlowStatusResponseEndpointV1, +} from "./web-services/get-flow-endpoint-v1"; import { IListFlowsEndpointV1Options, ListFlowsEndpointV1, @@ -44,9 +64,20 @@ import { IDiagnoseNodeEndpointV1Options, DiagnoseNodeEndpointV1, } from "./web-services/diagnose-node-endpoint-v1"; - +import { + IStartFlowEndpointV1Options, + StartFlowEndpointV1, +} from "./web-services/start-flow-endpoint-v1"; import fs from "fs"; - +import fetch from "node-fetch"; +import https from "https"; +export enum CordaVersion { + CORDA_V4X = "CORDA_V4X", + CORDA_V5 = "CORDA_V5X", +} +import dotenv from "dotenv"; +import * as path from "path"; +dotenv.config({ path: path.resolve(__dirname, ".env") }); export interface IPluginLedgerConnectorCordaOptions extends ICactusPluginOptions { logLevel?: LogLevelDesc; @@ -56,6 +87,9 @@ export interface IPluginLedgerConnectorCordaOptions cordaStartCmd?: string; cordaStopCmd?: string; apiUrl?: string; + cordaVersion?: CordaVersion; + holdingIDShortHash?: any; + clientRequestID?: any; /** * Path to the file where the private key for the ssh configuration is located * This property is optional. Its use is not recommended for most cases, it will override the privateKey property of the sshConfigAdminShell. @@ -66,14 +100,20 @@ export interface IPluginLedgerConnectorCordaOptions } export class PluginLedgerConnectorCorda - implements IPluginLedgerConnector, IPluginWebService + implements + IPluginLedgerConnector< + GetFlowCidV1Response, + StartFlowV1Request, + ListCpiV1Response, + any + >, + IPluginWebService { public static readonly CLASS_NAME = "DeployContractJarsEndpoint"; private readonly instanceId: string; private readonly log: Logger; public prometheusExporter: PrometheusExporter; - private endpoints: IWebServiceEndpoint[] | undefined; public get className(): string { @@ -204,7 +244,6 @@ export class PluginLedgerConnectorCorda const endpoint = new GetPrometheusExporterMetricsEndpointV1(opts); endpoints.push(endpoint); } - { const opts: IListFlowsEndpointV1Options = { apiUrl: this.options.apiUrl, @@ -232,6 +271,47 @@ export class PluginLedgerConnectorCorda endpoints.push(endpoint); } + { + const opts: IListCPIEndpointV1Options = { + apiUrl: this.options.apiUrl, + logLevel: this.options.logLevel, + connector: this, + }; + const endpoint = new ListCPIEndpointV1(opts); + endpoints.push(endpoint); + } + + { + const opts: IFlowStatusEndpointV1Options = { + apiUrl: this.options.apiUrl, + logLevel: this.options.logLevel, + holdingIDShortHash: this.options.holdingIDShortHash, + connector: this, + }; + const endpoint = new FlowStatusEndpointV1(opts); + endpoints.push(endpoint); + } + + { + const opts: IFlowStatusResponseEndpointV1Options = { + apiUrl: this.options.apiUrl, + logLevel: this.options.logLevel, + holdingIDShortHash: this.options.holdingIDShortHash, + clientRequestID: this.options.clientRequestID, + connector: this, + }; + const endpoint = new FlowStatusResponseEndpointV1(opts); + endpoints.push(endpoint); + } + { + const opts: IStartFlowEndpointV1Options = { + apiUrl: this.options.apiUrl, + logLevel: this.options.logLevel, + connector: this, + }; + const endpoint = new StartFlowEndpointV1(opts); + endpoints.push(endpoint); + } this.log.info(`Instantiated endpoints of ${pkgName}`); return endpoints; } @@ -243,4 +323,169 @@ export class PluginLedgerConnectorCorda public async getFlowList(): Promise { return ["getFlowList()_NOT_IMPLEMENTED"]; } + + private async setupRequest( + username: string, + password: string, + ): Promise<{ headers: any; agent: any }> { + const authString = Buffer.from(`${username}:${password}`).toString( + "base64", + ); + const headers = { Authorization: `Basic ${authString}` }; + const rejectUnauthorized = process.env.REJECT_UNAUTHORIZED !== "false"; + const httpsAgent = new https.Agent({ + rejectUnauthorized, + }); + return { headers, agent: httpsAgent }; + } + + public async startFlow(req: StartFlowV1Request): Promise { + try { + const { headers, agent } = await this.setupRequest( + req.username, + req.password, + ); + const holdingIDShortHash = req.holdingIDShortHash; + const cordaReq = { + clientRequestId: req.clientRequestId, + flowClassName: req.flowClassName, + requestBody: req.requestBody, + }; + const cordaReqBuff = Buffer.from(JSON.stringify(cordaReq)); + const response = await fetch(`${req.baseUrl}flow/${holdingIDShortHash}`, { + method: `POST`, + headers, + body: cordaReqBuff, + agent, + }); + await new Promise((resolve) => setTimeout(resolve, 5000)); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const responseData = await this.pollEndpointUntilCompleted( + req.holdingIDShortHash!, + req.clientRequestId, + ); + return responseData; + } catch (error) { + console.error("Error starting flow:", error); + throw error; + } + } + + public async listCPI(req: ListCpiV1Request): Promise { + try { + const { headers, agent } = await this.setupRequest( + req.username, + req.password, + ); + const response = await fetch(`${req.baseUrl}cpi`, { + method: `GET`, + headers: headers, + agent, + }); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const responseData = await response.json(); + return responseData; + } catch (error) { + console.error("Error fetching data:", error); + } + } + public async getFlow(req: GetFlowCidV1Request): Promise { + try { + const { headers, agent } = await this.setupRequest( + req.username, + req.password, + ); + const holdingIDShortHash = req.holdingIDShortHash; + const clientRequestId = req.clientRequestId; + const response = await fetch( + `${req.baseUrl}flow/${holdingIDShortHash}/${clientRequestId}`, + { + method: `GET`, + headers: headers, + agent, + }, + ); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const responseData = await response.json(); + return responseData; + } catch (error) { + console.error("Error fetching data:", error); + } + } + public async listFlows(req: GetFlowCidV1Request): Promise { + try { + const { headers, agent } = await this.setupRequest( + req.username, + req.password, + ); + const holdingIDShortHash = req.holdingIDShortHash; + const response = await fetch(`${req.baseUrl}flow/${holdingIDShortHash}`, { + method: `GET`, + headers: headers, + agent, + }); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + const responseData = await response.json(); + return responseData; + } catch (error) { + console.error("Error fetching data:", error); + } + } + public async pollEndpointUntilCompleted( + shortHash: string, + clientRequestId: string, + interval = 5000, + maxAttempts = 10, + ): Promise { + return new Promise(async (resolve, reject) => { + let attempts = 0; + + const poll = async () => { + attempts++; + const queryVar: GetFlowCidV1Request = { + username: "admin", + password: "admin", + baseUrl: "https://127.0.0.1:8888/api/v1/", + holdingIDShortHash: shortHash, + clientRequestId, + }; + try { + const response = await this.getFlow(queryVar); + if (response.flowStatus === "COMPLETED") { + resolve(response); + } else { + if (attempts < maxAttempts) { + setTimeout(poll, interval); + } else { + reject( + new Error( + `Max attempts (${maxAttempts}) reached. Flow status not completed.`, + ), + ); + } + } + } catch (error) { + if (attempts < maxAttempts) { + setTimeout(poll, interval); + } else { + reject( + new Error( + `Max attempts (${maxAttempts}) reached. Unable to get flow status.`, + ), + ); + } + } + }; + + poll(); + }); + } } diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/public-api.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/public-api.ts index 96b4e6e71f3..902ddf6467e 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/public-api.ts +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/public-api.ts @@ -1,6 +1,7 @@ export { PluginLedgerConnectorCorda, IPluginLedgerConnectorCordaOptions, + CordaVersion, } from "./plugin-ledger-connector-corda"; export * from "./generated/openapi/typescript-axios/index"; diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/diagnose-node-endpoint-v1.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/diagnose-node-endpoint-v1.ts index 201039dda18..a7300d9507d 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/diagnose-node-endpoint-v1.ts +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/diagnose-node-endpoint-v1.ts @@ -24,9 +24,15 @@ import { DiagnoseNodeV1Response, } from "../generated/openapi/typescript-axios"; +import { + PluginLedgerConnectorCorda, + CordaVersion, +} from "../plugin-ledger-connector-corda"; export interface IDiagnoseNodeEndpointV1Options { logLevel?: LogLevelDesc; apiUrl?: string; + cordaVersion?: CordaVersion; + connector?: PluginLedgerConnectorCorda; } export class DiagnoseNodeEndpointV1 implements IWebServiceEndpoint { diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/get-flow-endpoint-v1.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/get-flow-endpoint-v1.ts new file mode 100644 index 00000000000..6c452708e90 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/get-flow-endpoint-v1.ts @@ -0,0 +1,111 @@ +import { Express, Request, Response } from "express"; + +import { + IWebServiceEndpoint, + IExpressRequestHandler, + IEndpointAuthzOptions, +} from "@hyperledger/cactus-core-api"; + +import { registerWebServiceEndpoint } from "@hyperledger/cactus-core"; + +import { + Checks, + IAsyncProvider, + Logger, + LoggerProvider, + LogLevelDesc, +} from "@hyperledger/cactus-common"; + +import OAS from "../../json/openapi.json"; +import { PluginLedgerConnectorCorda } from "../plugin-ledger-connector-corda"; + +export interface IFlowStatusResponseEndpointV1Options { + logLevel?: LogLevelDesc; + apiUrl?: string; + holdingIDShortHash: string; + clientRequestID: string; + connector: PluginLedgerConnectorCorda; +} + +export class FlowStatusResponseEndpointV1 implements IWebServiceEndpoint { + public static readonly CLASS_NAME = "FlowStatusResponseEndpointV1"; + + private readonly log: Logger; + private readonly apiUrl?: string; + public get className(): string { + return FlowStatusResponseEndpointV1.CLASS_NAME; + } + + constructor(public readonly options: IFlowStatusResponseEndpointV1Options) { + const fnTag = `${this.className}#constructor()`; + + Checks.truthy(options, `${fnTag} options`); + Checks.truthy(options.connector, `${fnTag} options.connector`); + + this.log = LoggerProvider.getOrCreate({ + label: "list-flow-status-response-endpoint-v1", + level: options.logLevel || "INFO", + }); + + this.apiUrl = options.apiUrl; + } + + getAuthorizationOptionsProvider(): IAsyncProvider { + return { + get: async () => ({ + isProtected: true, + requiredRoles: [], + }), + }; + } + + public get oasPath(): (typeof OAS.paths)["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/getFlowCid"] { + return OAS.paths[ + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/getFlowCid" + ]; + } + + /** + * Returns the endpoint path to be used when installing the endpoint into the + * API server of Cactus. + */ + public getPath(): string { + return this.oasPath.get["x-hyperledger-cactus"].http.path; + } + + public getVerbLowerCase(): string { + return this.oasPath.get["x-hyperledger-cactus"].http.verbLowerCase; + } + + public getOperationId(): string { + return this.oasPath.get.operationId; + } + + public getExpressRequestHandler(): IExpressRequestHandler { + return this.handleRequest.bind(this); + } + + public async registerExpress( + expressApp: Express, + ): Promise { + await registerWebServiceEndpoint(expressApp, this); + return this; + } + + async handleRequest(req: Request, res: Response): Promise { + const fnTag = "getFlowV1#handleRequest()"; + const verbUpper = this.getVerbLowerCase().toUpperCase(); + this.log.debug(`${verbUpper} ${this.getPath()}`); + try { + if (this.apiUrl === undefined) throw "apiUrl option is necessary"; + const body = await this.options.connector.getFlow(req.body); + res.status(200); + res.json(body); + } catch (ex) { + this.log.error(`${fnTag} failed to serve request`, ex); + res.status(500); + res.statusMessage = ex.message; + res.json({ error: ex.stack }); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/list-cpi-endpoint-v1.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/list-cpi-endpoint-v1.ts new file mode 100644 index 00000000000..43a871ba54b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/list-cpi-endpoint-v1.ts @@ -0,0 +1,110 @@ +import { Express, Request, Response } from "express"; +import { + IWebServiceEndpoint, + IExpressRequestHandler, + IEndpointAuthzOptions, +} from "@hyperledger/cactus-core-api"; + +import { registerWebServiceEndpoint } from "@hyperledger/cactus-core"; + +import { + Checks, + IAsyncProvider, + Logger, + LoggerProvider, + LogLevelDesc, +} from "@hyperledger/cactus-common"; + +import OAS from "../../json/openapi.json"; +import https from "https"; +import { PluginLedgerConnectorCorda } from "../plugin-ledger-connector-corda"; +export interface IListCPIEndpointV1Options { + logLevel?: LogLevelDesc; + apiUrl?: string; + connector: PluginLedgerConnectorCorda; +} + +export class ListCPIEndpointV1 implements IWebServiceEndpoint { + public static readonly CLASS_NAME = "ListCPIEndpointV1"; + + private readonly log: Logger; + private readonly apiUrl?: string; + + public get className(): string { + return ListCPIEndpointV1.CLASS_NAME; + } + + constructor(public readonly options: IListCPIEndpointV1Options) { + const fnTag = `${this.className}#constructor()`; + + Checks.truthy(options, `${fnTag} options`); + + this.log = LoggerProvider.getOrCreate({ + label: "list-cpi-endpoint-v1", + level: options.logLevel || "INFO", + }); + + this.apiUrl = options.apiUrl; + } + + getAuthorizationOptionsProvider(): IAsyncProvider { + return { + get: async () => ({ + isProtected: true, + requiredRoles: [], + httpsAgent: new https.Agent({ rejectUnauthorized: false }), + }), + }; + } + + public get oasPath(): (typeof OAS.paths)["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listCPI"] { + return OAS.paths[ + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listCPI" + ]; + } + + /** + * Returns the endpoint path to be used when installing the endpoint into the + * API server of Cactus. + */ + public getPath(): string { + return this.oasPath.get["x-hyperledger-cactus"].https.path; + } + + public getVerbLowerCase(): string { + return this.oasPath.get["x-hyperledger-cactus"].https.verbLowerCase; + } + + public getOperationId(): string { + return this.oasPath.get.operationId; + } + + public getExpressRequestHandler(): IExpressRequestHandler { + return this.handleRequest.bind(this); + } + + public async registerExpress( + expressApp: Express, + ): Promise { + await registerWebServiceEndpoint(expressApp, this); + return this; + } + + async handleRequest(req: Request, res: Response): Promise { + const fnTag = "listCPIV1#handleRequest()"; + const verbUpper = this.getVerbLowerCase().toUpperCase(); + this.log.debug(`${verbUpper} ${this.getPath()}`); + + try { + if (this.apiUrl === undefined) throw "apiUrl option is necessary"; + const body = await this.options.connector.listCPI(req.body); + res.status(200); + res.json(body); + } catch (ex) { + this.log.error(`${fnTag} failed to serve request`, ex); + res.status(500); + res.statusMessage = ex.message; + res.json({ error: ex.stack }); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/list-flow-endpoint-v1.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/list-flow-endpoint-v1.ts new file mode 100644 index 00000000000..f835c2b77f1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/list-flow-endpoint-v1.ts @@ -0,0 +1,111 @@ +import { Express, Request, Response } from "express"; + +import { + IWebServiceEndpoint, + IExpressRequestHandler, + IEndpointAuthzOptions, +} from "@hyperledger/cactus-core-api"; + +import { registerWebServiceEndpoint } from "@hyperledger/cactus-core"; + +import { + Checks, + IAsyncProvider, + Logger, + LoggerProvider, + LogLevelDesc, +} from "@hyperledger/cactus-common"; + +// import {} from "../generated/openapi/typescript-axios"; + +import OAS from "../../json/openapi.json"; +import { PluginLedgerConnectorCorda } from "../plugin-ledger-connector-corda"; + +export interface IFlowStatusEndpointV1Options { + logLevel?: LogLevelDesc; + apiUrl?: string; + holdingIDShortHash: string; + connector: PluginLedgerConnectorCorda; +} + +export class FlowStatusEndpointV1 implements IWebServiceEndpoint { + public static readonly CLASS_NAME = "FlowStatusEndpointV1"; + + private readonly log: Logger; + private readonly apiUrl?: string; + + public get className(): string { + return FlowStatusEndpointV1.CLASS_NAME; + } + + constructor(public readonly options: IFlowStatusEndpointV1Options) { + const fnTag = `${this.className}#constructor()`; + + Checks.truthy(options, `${fnTag} options`); + Checks.truthy(options.connector, `${fnTag} options.connector`); + this.log = LoggerProvider.getOrCreate({ + label: "list-flow-status-endpoint-v1", + level: options.logLevel || "INFO", + }); + + this.apiUrl = options.apiUrl; + } + + getAuthorizationOptionsProvider(): IAsyncProvider { + return { + get: async () => ({ + isProtected: true, + requiredRoles: [], + }), + }; + } + + public get oasPath(): (typeof OAS.paths)["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listFlows"] { + return OAS.paths[ + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/listFlows" + ]; + } + + /** + * Returns the endpoint path to be used when installing the endpoint into the + * API server of Cactus. + */ + public getPath(): string { + return this.oasPath.get["x-hyperledger-cactus"].http.path; + } + + public getVerbLowerCase(): string { + return this.oasPath.get["x-hyperledger-cactus"].http.verbLowerCase; + } + + public getOperationId(): string { + return this.oasPath.get.operationId; + } + + public getExpressRequestHandler(): IExpressRequestHandler { + return this.handleRequest.bind(this); + } + + public async registerExpress( + expressApp: Express, + ): Promise { + await registerWebServiceEndpoint(expressApp, this); + return this; + } + async handleRequest(req: Request, res: Response): Promise { + const fnTag = "listFlowV1#handleRequest()"; + const verbUpper = this.getVerbLowerCase().toUpperCase(); + this.log.debug(`${verbUpper} ${this.getPath()}`); + try { + if (this.apiUrl === undefined) throw "apiUrl option is necessary"; + const body = await this.options.connector.listFlows(req.body); + res.status(200); + res.json(body); + } catch (ex) { + this.log.error(`${fnTag} failed to serve request`, ex); + res.status(500); + res.statusMessage = ex.message; + res.json({ error: ex.stack }); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/list-flows-endpoint-v1.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/list-flows-endpoint-v1.ts index f867924eeb4..1d52c215f4a 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/list-flows-endpoint-v1.ts +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/list-flows-endpoint-v1.ts @@ -23,7 +23,6 @@ import { ListFlowsV1Request, ListFlowsV1Response, } from "../generated/openapi/typescript-axios"; - export interface IListFlowsEndpointV1Options { logLevel?: LogLevelDesc; apiUrl?: string; diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/start-flow-endpoint-v1.ts b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/start-flow-endpoint-v1.ts new file mode 100644 index 00000000000..26e4478ced0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/typescript/web-services/start-flow-endpoint-v1.ts @@ -0,0 +1,108 @@ +import { Express, Request, Response } from "express"; + +import { + IWebServiceEndpoint, + IExpressRequestHandler, + IEndpointAuthzOptions, +} from "@hyperledger/cactus-core-api"; + +import { registerWebServiceEndpoint } from "@hyperledger/cactus-core"; + +import { + Checks, + IAsyncProvider, + Logger, + LoggerProvider, + LogLevelDesc, +} from "@hyperledger/cactus-common"; + +import OAS from "../../json/openapi.json"; +import { PluginLedgerConnectorCorda } from "../plugin-ledger-connector-corda"; + +export interface IStartFlowEndpointV1Options { + logLevel?: LogLevelDesc; + apiUrl?: string; + connector: PluginLedgerConnectorCorda; +} + +export class StartFlowEndpointV1 implements IWebServiceEndpoint { + public static readonly CLASS_NAME = "StartFlowEndpointV1"; + + private readonly log: Logger; + private readonly apiUrl?: string; + + public get className(): string { + return StartFlowEndpointV1.CLASS_NAME; + } + + constructor(public readonly options: IStartFlowEndpointV1Options) { + const fnTag = `${this.className}#constructor()`; + + Checks.truthy(options, `${fnTag} options`); + Checks.truthy(options.connector, `${fnTag} options.connector`); + this.log = LoggerProvider.getOrCreate({ + label: "start-flow-endpoint-v1", + level: options.logLevel || "INFO", + }); + + this.apiUrl = options.apiUrl; + } + + getAuthorizationOptionsProvider(): IAsyncProvider { + return { + get: async () => ({ + isProtected: true, + requiredRoles: [], + }), + }; + } + + public get oasPath(): (typeof OAS.paths)["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/startFlow"] { + return OAS.paths[ + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/startFlow" + ]; + } + + /** + * Returns the endpoint path to be used when installing the endpoint into the + * API server of Cactus. + */ + public getPath(): string { + return this.oasPath.post["x-hyperledger-cactus"].http.path; + } + + public getVerbLowerCase(): string { + return this.oasPath.post["x-hyperledger-cactus"].http.verbLowerCase; + } + + public getOperationId(): string { + return this.oasPath.post.operationId; + } + + public getExpressRequestHandler(): IExpressRequestHandler { + return this.handleRequest.bind(this); + } + + public async registerExpress( + expressApp: Express, + ): Promise { + await registerWebServiceEndpoint(expressApp, this); + return this; + } + async handleRequest(req: Request, res: Response): Promise { + const fnTag = "startFlowV1#handleRequest()"; + const verbUpper = this.getVerbLowerCase().toUpperCase(); + this.log.debug(`${verbUpper} ${this.getPath()}`); + try { + if (this.apiUrl === undefined) throw "apiUrl option is necessary"; + const body = await this.options.connector.startFlow(req.body); + res.status(200); + res.json(body); + } catch (ex) { + this.log.error(`${fnTag} failed to serve request`, ex); + res.status(500); + res.statusMessage = ex.message; + res.json({ error: ex.stack }); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/corda-v5-x/corda-v5-flow.test.ts b/packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/corda-v5-x/corda-v5-flow.test.ts new file mode 100644 index 00000000000..beaa9e8b55b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/corda-v5-x/corda-v5-flow.test.ts @@ -0,0 +1,327 @@ +import { v4 as uuidv4 } from "uuid"; +import "jest-extended"; +import { + CordaV5TestLedger, + Containers, + pruneDockerAllIfGithubAction, +} from "@hyperledger/cactus-test-tooling"; + +import { + IListenOptions, + LogLevelDesc, + Servers, +} from "@hyperledger/cactus-common"; +import { + PluginLedgerConnectorCorda, + CordaVersion, +} from "../../../../main/typescript/plugin-ledger-connector-corda"; +import { DefaultApi } from "../../../../main/typescript/generated/openapi/typescript-axios/index"; + +const logLevel: LogLevelDesc = "TRACE"; + +import http from "http"; +import { extractShortHash } from "./../../../../../../cactus-test-tooling/src/main/typescript/corda/corda-v5-test-ledger"; +import express from "express"; +import bodyParser from "body-parser"; +import { AddressInfo } from "net"; +import { Configuration } from "@hyperledger/cactus-core-api"; + +describe("Corda Test Case", () => { + const cordaV5TestLedger = new CordaV5TestLedger(); + let apiClient: DefaultApi; + const expressApp = express(); + const server = http.createServer(expressApp); + let plugin: PluginLedgerConnectorCorda; + + beforeAll(async () => { + await cordaV5TestLedger.start(); + expect(cordaV5TestLedger).toBeTruthy(); + const pruning = pruneDockerAllIfGithubAction({ logLevel }); + await expect(pruning).resolves.toBeTruthy(); + expressApp.use(bodyParser.json({ limit: "250mb" })); + const sshConfig = await cordaV5TestLedger.getSshConfig(); + + plugin = new PluginLedgerConnectorCorda({ + instanceId: uuidv4(), + sshConfigAdminShell: sshConfig, + corDappsDir: "", + logLevel, + cordaVersion: CordaVersion.CORDA_V5, + apiUrl: "https://127.0.0.1:8888", + }); + const listenOptions: IListenOptions = { + hostname: "127.0.0.1", + port: 0, + server, + }; + const addressInfo = (await Servers.listen(listenOptions)) as AddressInfo; + const { address, port } = addressInfo; + const apiHost = `http://${address}:${port}`; + const config = new Configuration({ basePath: apiHost }); + await plugin.registerWebServices(expressApp); + apiClient = new DefaultApi(config); + }); + afterAll(async () => { + await cordaV5TestLedger.stop(); + await cordaV5TestLedger.destroy(); + await Servers.shutdown(server); + }); + let shortHashID: string; + it("Listing VNodes", async () => { + const container = cordaV5TestLedger.getContainer(); + const cmd = ["./gradlew", "listVNodes"]; + const timeout = 180000; // 3 minutes + const cwd = "/CSDE-cordapp-template-kotlin"; + shortHashID = await Containers.exec(container, cmd, timeout, logLevel, cwd); + // TODO: Remove the timeout below. This is a temporary fix to the flakiness of the test. + // Will do further investigation on this issue + await new Promise((resolve) => setTimeout(resolve, 60000)); + }); + + describe("Endpoint Testing", () => { + let shortHashAlice = ""; + let shortHashBob = ""; + let shortHashCharlie = ""; + let shortHashDave = ""; + it("Extract short hash for Alice", () => { + shortHashAlice = extractShortHash(shortHashID, "Alice"); + expect(shortHashAlice).toBeTruthy(); + expect(`Short hash ID for Alice: ${shortHashAlice}`).toMatch( + /Short hash ID for Alice:/, + ); + console.log(`Short hash ID for Alice: ${shortHashAlice}`); + }); + it("Extract short hash for Bob", () => { + shortHashBob = extractShortHash(shortHashID, "Bob"); + expect(shortHashBob).toBeTruthy(); + expect(`Short hash ID for Bob: ${shortHashBob}`).toMatch( + /Short hash ID for Bob:/, + ); + console.log(`Short hash ID for Bob: ${shortHashBob}`); + }); + it("Extract short hash for Charlie", () => { + shortHashCharlie = extractShortHash(shortHashID, "Charlie"); + expect(typeof shortHashCharlie === "string").toBe(true); + expect(shortHashCharlie).toBeTruthy(); + expect(`Short hash ID for Charlie: ${shortHashCharlie}`).toMatch( + /Short hash ID for Charlie:/, + ); + console.log(`Short hash ID for Charlie: ${shortHashCharlie}`); + }); + it("Extract short hash for Dave", () => { + shortHashDave = extractShortHash(shortHashID, "Dave"); + expect(shortHashDave).toBeTruthy(); + expect(`Short hash ID for Dave: ${shortHashDave}`).toMatch( + /Short hash ID for Dave:/, + ); + console.log(`Short hash ID for Dave: ${shortHashDave}`); + }); + + it("Listing CPIs", async () => { + const req = { + username: "admin", + password: "admin", + baseUrl: "https://127.0.0.1:8888/api/v1/", + }; + const listCPI = await apiClient.listCpiV1(req); + expect(listCPI).toBeTruthy(); + }); + test("Simulate conversation between Alice and Bob", async () => { + const username = "admin"; + const password = "admin"; + const baseUrl = "https://127.0.0.1:8888/api/v1/"; + //1. Alice creates a new chat + const aliceCreateChat = { + username, + password, + baseUrl, + holdingIDShortHash: shortHashAlice, + clientRequestId: "create-1", + flowClassName: + "com.r3.developers.csdetemplate.utxoexample.workflows.CreateNewChatFlow", + requestBody: { + chatName: "Chat with Bob", + otherMember: "CN=Bob, OU=Test Dept, O=R3, L=London, C=GB", + message: "Hello Bob", + }, + }; + let startflowChat = await apiClient.startFlowV1(aliceCreateChat); + expect(startflowChat).toBeTruthy(); + + //2. Bob lists his chats + const bobListChats = { + username, + password, + baseUrl, + holdingIDShortHash: shortHashBob, + clientRequestId: "list-1", + flowClassName: + "com.r3.developers.csdetemplate.utxoexample.workflows.ListChatsFlow", + requestBody: {}, + }; + startflowChat = await apiClient.startFlowV1(bobListChats); + expect(startflowChat).toBeTruthy(); + const flowResult = + startflowChat.data !== null && startflowChat.data !== undefined + ? startflowChat.data.flowResult + : null; + const chatWithBobId = (() => { + if (typeof flowResult === "string") { + const parseFlowResult = JSON.parse(flowResult); + const chatWithBobObj = parseFlowResult.find( + (item: { chatName: string }) => item.chatName === "Chat with Bob", + ); + return chatWithBobObj && "id" in chatWithBobObj + ? chatWithBobObj.id + : undefined; + } + })(); + //3. Bob updates chat twice + const bobUpdate1 = { + username, + password, + baseUrl, + holdingIDShortHash: shortHashBob, + clientRequestId: "update-1", + flowClassName: + "com.r3.developers.csdetemplate.utxoexample.workflows.UpdateChatFlow", + requestBody: { + id: chatWithBobId, + message: "Hi Alice", + }, + }; + const bobUpdate1Response = await apiClient.startFlowV1(bobUpdate1); + expect(bobUpdate1Response).toBeTruthy(); + const bobUpdate2 = { + username, + password, + baseUrl, + holdingIDShortHash: shortHashBob, + clientRequestId: "update-2", + flowClassName: + "com.r3.developers.csdetemplate.utxoexample.workflows.UpdateChatFlow", + requestBody: { + id: chatWithBobId, + message: "How are you today?", + }, + }; + const bobUpdate2Response = await apiClient.startFlowV1(bobUpdate2); + expect(bobUpdate2Response).toBeTruthy(); + + //4. Alice lists chat + const aliceListsChat = { + username, + password, + baseUrl, + holdingIDShortHash: shortHashAlice, + clientRequestId: "list-2", + flowClassName: + "com.r3.developers.csdetemplate.utxoexample.workflows.ListChatsFlow", + requestBody: {}, + }; + const aliceList2Response = await apiClient.startFlowV1(aliceListsChat); + expect(aliceList2Response).toBeTruthy(); + + //5. Alice checks the history of the chat with Bob + const aliceHistoryRequest = { + username, + password, + baseUrl, + holdingIDShortHash: shortHashAlice, + clientRequestId: "get-1", + flowClassName: + "com.r3.developers.csdetemplate.utxoexample.workflows.GetChatFlow", + requestBody: { + id: chatWithBobId, + numberOfRecords: "4", + }, + }; + const aliceHistoryResponse = + await apiClient.startFlowV1(aliceHistoryRequest); + expect(aliceHistoryResponse).toBeTruthy(); + + //6. Alice replies to Bob + const aliceReply = { + username, + password, + baseUrl, + holdingIDShortHash: shortHashAlice, + clientRequestId: "update-4", + flowClassName: + "com.r3.developers.csdetemplate.utxoexample.workflows.UpdateChatFlow", + requestBody: { + id: chatWithBobId, + message: "I am very well thank you", + }, + }; + + const aliceReplyResponse = await apiClient.startFlowV1(aliceReply); + expect(aliceReplyResponse).toBeTruthy(); + + //7. Bob gets the chat history + const bobHistoryRequest = { + username, + password, + baseUrl, + holdingIDShortHash: shortHashBob, + clientRequestId: "get-2", + flowClassName: + "com.r3.developers.csdetemplate.utxoexample.workflows.GetChatFlow", + requestBody: { + id: chatWithBobId, + numberOfRecords: "2", + }, + }; + const bobHistoryResponse = await apiClient.startFlowV1(bobHistoryRequest); + expect(bobHistoryResponse).toBeTruthy(); + + //8. List Flows Endpoint Test + const queryVar = { + username, + password, + baseUrl, + holdingIDShortHash: shortHashBob, + }; + const response = await apiClient.listFlowV1(queryVar); + expect(response).toBeTruthy(); + }); + + describe("Negative Testing", () => { + it("Invalid username and password", async () => { + const request = { + username: "invalidUsername", + password: "invalidPassword", + baseUrl: "https://127.0.0.1:8888/api/v1/", + }; + try { + await apiClient.listCpiV1(request); + fail("Expected an error for unauthorized access but it succeeded."); + } catch (error) { + expect(error).toBeDefined(); + } + }); + + it("Invalid flow class name", async () => { + const invalidFlowName = "nonExistentFlow"; + const request = { + username: "admin", + password: "admin", + baseUrl: "https://127.0.0.1:8888/api/v1/", + holdingIDShortHash: shortHashBob, + clientRequestId: "test-1", + flowClassName: invalidFlowName, + requestBody: { + chatName: "Test-1", + otherMember: "CN=Bob, OU=Test Dept, O=R3, L=London, C=GB", + message: "Testing", + }, + }; + try { + await apiClient.startFlowV1(request); + } catch (error) { + expect(error).toBeDefined(); + } + }); + }); + }); +}); diff --git a/packages/cactus-test-tooling/src/main/typescript/corda/corda-v5-test-ledger.ts b/packages/cactus-test-tooling/src/main/typescript/corda/corda-v5-test-ledger.ts new file mode 100644 index 00000000000..57c452be1af --- /dev/null +++ b/packages/cactus-test-tooling/src/main/typescript/corda/corda-v5-test-ledger.ts @@ -0,0 +1,267 @@ +import { EventEmitter } from "events"; +//import path from "path"; + +import { Config as SshConfig } from "node-ssh"; +import Docker, { Container, ContainerInfo } from "dockerode"; +import Joi from "joi"; + +import { ITestLedger } from "../i-test-ledger"; +import { Containers } from "../common/containers"; + +import { + LogLevelDesc, + Logger, + LoggerProvider, + Checks, + Bools, +} from "@hyperledger/cactus-common"; + +/* + * Contains options for Corda container + */ +export interface ICordaV5TestLedgerConstructorOptions { + imageVersion?: string; + imageName?: string; + publicPort?: number; + postgresPort?: number; + logLevel?: LogLevelDesc; + emitContainerLogs?: boolean; + rpcPortA?: number; +} + +/* + * Provides default options for Corda container + */ +const DEFAULTS = Object.freeze({ + imageVersion: "2024-06-18-issue3293-3e1660df4", + imageName: "ghcr.io/hyperledger/cacti-corda-5-all-in-one", + publicPort: 8888, + postgresPort: 5431, + rpcPortA: 10008, +}); +export const CORDA_V5_TEST_LEDGER_DEFAULT_OPTIONS = DEFAULTS; + +/* + * Provides validations for the Corda container's options + */ +export const JOI_SCHEMA: Joi.Schema = Joi.object().keys({ + imageVersion: Joi.string().min(5).required(), + imageName: Joi.string().min(1).required(), + publicPort: Joi.number().min(1).max(65535).required(), + postgresPort: Joi.number().min(1).max(65535).required(), +}); +export const CORDA_V5_TEST_LEDGER_OPTIONS_JOI_SCHEMA = JOI_SCHEMA; + +export class CordaV5TestLedger implements ITestLedger { + public static readonly CLASS_NAME = "CordaV5TestLedger"; + + private readonly log: Logger; + //private readonly envVars: string[]; + + public get className(): string { + return CordaV5TestLedger.CLASS_NAME; + } + public readonly rpcPortA: number; + public readonly imageVersion: string; + public readonly imageName: string; + public readonly publicPort: number; + public readonly postgresPort: number; + public readonly emitContainerLogs: boolean; + + private container: Container | undefined; + private containerId: string | undefined; + + constructor(public readonly opts: ICordaV5TestLedgerConstructorOptions = {}) { + const fnTag = `${this.className}#constructor()`; + Checks.truthy(opts, `${fnTag} options`); + + this.imageVersion = opts.imageVersion || DEFAULTS.imageVersion; + this.imageName = opts.imageName || DEFAULTS.imageName; + + this.publicPort = opts.publicPort || DEFAULTS.publicPort; + this.postgresPort = opts.postgresPort || DEFAULTS.postgresPort; + this.emitContainerLogs = Bools.isBooleanStrict(opts.emitContainerLogs) + ? (opts.emitContainerLogs as boolean) + : true; + + this.rpcPortA = opts.rpcPortA || DEFAULTS.rpcPortA; + + this.validateConstructorOptions(); + const label = "corda-v5-test-ledger"; + const level = opts.logLevel || "INFO"; + this.log = LoggerProvider.getOrCreate({ level, label }); + } + + public getContainerId(): string { + const fnTag = `${this.className}.getContainerId()`; + Checks.nonBlankString(this.containerId, `${fnTag}::containerId`); + return this.containerId as string; + } + + public async start(skipPull = false): Promise { + const imageFqn = this.getContainerImageName(); + + if (this.container) { + await this.container.stop(); + await this.container.remove(); + } + const docker = new Docker(); + + if (!skipPull) { + await Containers.pullImage(imageFqn, {}, this.opts.logLevel); + } + + return new Promise((resolve, reject) => { + const eventEmitter: EventEmitter = docker.run( + imageFqn, + [], + [], + { + User: "root", + NetworkMode: "host", // Set the container to use the host network + Binds: ["/var/run/docker.sock:/var/run/docker.sock"], // Mount the Docker socket + PublishAllPorts: true, + Privileged: true, + }, + {}, + (err: unknown) => { + if (err) { + reject(err); + } + }, + ); + + eventEmitter.once("start", async (container: Container) => { + this.container = container; + this.containerId = container.id; + + if (this.emitContainerLogs) { + const fnTag = `[${this.getContainerImageName()}]`; + await Containers.streamLogs({ + container: this.getContainer(), + tag: fnTag, + log: this.log, + }); + } + + try { + let isHealthy = false; + do { + const containerInfo = await this.getContainerInfo(); + this.log.debug(`ContainerInfo.Status=%o`, containerInfo.Status); + this.log.debug(`ContainerInfo.State=%o`, containerInfo.State); + isHealthy = containerInfo.Status.endsWith("(healthy)"); + if (!isHealthy) { + await new Promise((resolve2) => setTimeout(resolve2, 1000)); + } + } while (!isHealthy); + resolve(container); + } catch (ex) { + reject(ex); + } + }); + }); + } + + public async logDebugPorts(): Promise { + const publicPort = await this.getPublicPort(); + this.log.info(`R3 Corda V5 public port: ${publicPort}`); + + const supervisorDUrl = await this.getSupervisorDLocalhostUrl(); + this.log.info(`SupervisorD Web UI accessible: %o`, supervisorDUrl); + } + + public stop(): Promise { + return Containers.stop(this.getContainer()); + } + + public destroy(): Promise { + const fnTag = `${this.className}.destroy()`; + if (this.container) { + return this.container.remove(); + } else { + return Promise.reject( + new Error(`${fnTag} Container was never created, nothing to destroy.`), + ); + } + } + + protected async getContainerInfo(): Promise { + const fnTag = `${this.className}.getContainerInfo()`; + const docker = new Docker(); + const containerInfos = await docker.listContainers({}); + const id = this.getContainerId(); + + const aContainerInfo = containerInfos.find((ci) => ci.Id === id); + + if (aContainerInfo) { + return aContainerInfo; + } else { + throw new Error(`${fnTag} no container with ID "${id}"`); + } + } + + public async getPublicPort(): Promise { + const aContainerInfo = await this.getContainerInfo(); + return Containers.getPublicPort(8888, aContainerInfo); + } + + public async getSupervisorDLocalhostUrl(): Promise { + const port = await this.getPublicPort(); + return `https://localhost:${port}/api/v1/swagger#`; + } + + public async getSSHPublicPort(): Promise { + const aContainerInfo = await this.getContainerInfo(); + return Containers.getPublicPort(22, aContainerInfo); + } + + public async getSshConfig(): Promise { + //port 22 is not being checked as of now because we can't modify the export ports unless we change the gradle sample + //const publicPort = await this.getSSHPublicPort(); + const sshConfig: SshConfig = { + host: "127.0.0.1", + port: 22, + username: "root", + }; + + return sshConfig; + } + + public getContainer(): Container { + const fnTag = `${this.className}.getContainer()`; + if (!this.container) { + throw new Error(`${fnTag} container not set on this instance yet.`); + } else { + return this.container; + } + } + + public getContainerImageName(): string { + return `${this.imageName}:${this.imageVersion}`; + } + + private validateConstructorOptions(): void { + const fnTag = `${this.className}#validateConstructorOptions()`; + const validationResult = JOI_SCHEMA.validate({ + imageVersion: this.imageVersion, + imageName: this.imageName, + publicPort: this.publicPort, + postgresPort: this.postgresPort, + }); + + if (validationResult.error) { + throw new Error(`${fnTag} ${validationResult.error.annotate()}`); + } + } +} + +export function extractShortHash(shortHashID: string, name: string) { + const regex = new RegExp(`MyCorDapp\\s*([A-Z0-9]*)\\s*CN=${name}`); + const match = shortHashID.match(regex); + if (match) { + return match[1]; + } else { + return "err"; + } +} diff --git a/packages/cactus-test-tooling/src/main/typescript/public-api.ts b/packages/cactus-test-tooling/src/main/typescript/public-api.ts index fb13f15d19d..1bacab1cf5e 100755 --- a/packages/cactus-test-tooling/src/main/typescript/public-api.ts +++ b/packages/cactus-test-tooling/src/main/typescript/public-api.ts @@ -34,6 +34,13 @@ export { export { ICordappJarFile } from "./corda/cordapp-jar-file"; +export { + CordaV5TestLedger, + ICordaV5TestLedgerConstructorOptions, + CORDA_V5_TEST_LEDGER_DEFAULT_OPTIONS, + CORDA_V5_TEST_LEDGER_OPTIONS_JOI_SCHEMA, +} from "./corda/corda-v5-test-ledger"; + export * from "./quorum/i-quorum-genesis-options"; export { Containers, diff --git a/tools/docker/corda-all-in-one/corda-v5/Dockerfile b/tools/docker/corda-all-in-one/corda-v5/Dockerfile index 4316e323d55..b75fec94e28 100644 --- a/tools/docker/corda-all-in-one/corda-v5/Dockerfile +++ b/tools/docker/corda-all-in-one/corda-v5/Dockerfile @@ -1,84 +1,81 @@ -FROM cruizba/ubuntu-dind:20.10.9 - -WORKDIR / - -RUN apt update -RUN apt -y upgrade - -# # Install git so we can check out the corda5-solarsystem-contracts-demo repo of Corda -RUN apt install -y git - -# Need curl to run healthchecks -RUN apt install -y curl - -RUN export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends openjdk-11-jdk - -# jq is needed by the /download-frozen-image-v2.sh script to pre-fetch docker images without docker. -RUN apt install -y jq - -# Get the utility script that can pre-fetch the container images without -# a functioning Docker daemon available which we do not have at image build -# time so have to resort to manually get the images instead of just saying -# "docker pull my/cool-image..." etc. -# The reason to jump trough these hoops is to avoid DockerHub rate limiting issues -RUN curl -sSL https://raw.githubusercontent.com/moby/moby/dedf8528a51c6db40686ed6676e9486d1ed5f9c0/contrib/download-frozen-image-v2.sh > /download-frozen-image-v2.sh -RUN chmod +x /download-frozen-image-v2.sh -RUN mkdir -p /etc/corda/corda-dev/ -RUN /download-frozen-image-v2.sh /etc/corda/corda-dev/ corda/corda-dev:5.0.0-devpreview-1.0 - -RUN curl https://download.corda.net/corda-cli/1.0.0-DevPreview/get-corda-cli.sh > /get-corda-cli.sh -RUN chmod +x /get-corda-cli.sh -RUN /get-corda-cli.sh - -RUN curl https://download.corda.net/cordapp-builder/5.0.0-DevPreview-1.0/cordapp-builder-installer.jar --output /cordapp-builder-installer.jar -RUN java -jar /cordapp-builder-installer.jar - -RUN git clone https://github.com/corda/corda5-solarsystem-contracts-demo.git -WORKDIR /corda5-solarsystem-contracts-demo - -# Placing the ARG here instead of the top may seem like bad form, but it has -# better build performance this way when we change the ARG's value it will -# not spend 5 to 10 minutes installing the OS level dependencies on the top of -# the image definition file because the cached layers will be the same for those. -ARG SOLARSYSTEM_DEMO_SHA=a3be5ad48d249be7f71c5f15074c874dc0d09b41 -RUN git checkout ${SOLARSYSTEM_DEMO_SHA} - -RUN /root/bin/corda-cli/bin/corda-cli network config docker-compose solar-system -RUN chmod +x gradlew -RUN ./gradlew build - -RUN /root/bin/corda-cli/bin/corda-cli network deploy -n solar-system -f solar-system.yaml > docker-compose.yaml - -RUN sed -i 's+corda/corda-dev:latest+corda/corda-dev:5.0.0-devpreview-1.0+g' /corda5-solarsystem-contracts-demo/docker-compose.yaml - -RUN /root/.local/lib/cordapp-builder/bin/cordapp-builder create --cpk contracts/build/libs/corda5-solar-system-contracts-demo-contracts-1.0-SNAPSHOT-cordapp.cpk --cpk workflows/build/libs/corda5-solar-system-contracts-demo-workflows-1.0-SNAPSHOT-cordapp.cpk -o solar-system.cpb - -# OpenSSH server +FROM docker:20.10.3-dind + +RUN apk update +RUN apk add py-pip python3-dev libffi-dev openssl-dev gcc libc-dev make + +# Need curl for healthchecks +RUN apk add --no-cache curl + +# Need to run shell script run.sh for Corda CLI +RUN apk add --no-cache bash + +# The file binary is used to inspect exectubles when debugging container image issues +RUN apk add --no-cache file +RUN apk add --no-cache ca-certificates +RUN apk add --no-cache tzdata +RUN apk add --no-cache gnupg + +#----------------- INSTALLING CORDA CDSE PREREQUISITES -------------------- +#-------------------------------------------------------------------------- + +# Installing Zulu17 JDK +RUN wget -P /etc/apk/keys/ \ +https://cdn.azul.com/public_keys/alpine-signing@azul.com-5d5dc44c.rsa.pub +RUN echo "https://repos.azul.com/zulu/alpine" | tee -a /etc/apk/repositories +RUN apk update +RUN apk add --no-cache zulu17-jdk + +# ENV JAVA_HOME /usr/lib/jvm/zulu17-ca +# ENV PATH $PATH:$JAVA_HOME/bin + +# Installing Corda CLI +RUN mkdir /platform-jars && \ + wget -O /platform-jars/binary.tar.gz \ + https://download.corda.net/c5-release-pack/f82c7008-3b72-48fb-8e25-5ca38a9483b1-5.1.0/platform-jars-5.1.0.tar.gz + +RUN cd /platform-jars/ && \ + tar -xvzf binary.tar.gz && \ + cp net/corda/cli/deployment/corda-cli-installer/5.1.0.0/corda-cli-installer-5.1.0.0.zip . && \ + unzip corda-cli-installer-5.1.0.0.zip -d corda-cli-installer && \ + corda-cli-installer/./install.sh +ENV PATH="$PATH:~/.corda/cli" + +#-------------------------------------------------------------------------- +#-------------------------------------------------------------------------- + +# Installing CORDA CDSE +RUN apk add --no-cache git +RUN git clone https://github.com/corda/CSDE-cordapp-template-kotlin.git + +RUN cd CSDE-cordapp-template-kotlin/ && \ + git checkout release/corda-5-0 && \ + sed -i 's/cordaNotaryPluginsVersion=5.0.0.0/cordaNotaryPluginsVersion=5.0.1.0/' gradle.properties && \ + sed -i 's/combinedWorkerJarVersion=5.0.0.0/combinedWorkerJarVersion=5.0.1.0/' gradle.properties && \ + sed -i 's/import static org.gradle.api.JavaVersion.VERSION_11/import static org.gradle.api.JavaVersion.VERSION_17/' build.gradle && \ + sed -i 's/def javaVersion = VERSION_11/def javaVersion = VERSION_17/' build.gradle + +RUN apk add --no-cache supervisor +## TO FIX: Exposing the required ports 5005, 5432 and 8888 for CSDE +## and 9001 for supervisor. Currently commented because of "--network host" being used to run the container +# EXPOSE 5005 +# EXPOSE 5432 +# EXPOSE 8888 +# EXPOSE 9001 EXPOSE 22 -# supervisord web ui/dashboard -EXPOSE 9001 - -# earth-node RPC -EXPOSE 12112 - -# mars-node RPC -EXPOSE 12116 +COPY supervisord.conf /etc/supervisord.conf -# pluto-node RPC -EXPOSE 12119 +COPY start-services.sh /start-services.sh +RUN chmod +x /start-services.sh -# notary-node RPC -EXPOSE 12122 +COPY healthcheck.sh /healthcheck.sh +RUN chmod +x /healthcheck.sh -COPY ./start-services.sh /start-services.sh +WORKDIR /CSDE-cordapp-template-kotlin/ -COPY ./supervisor/ /etc/supervisor/conf.d/ +# Extend the parent image's entrypoint +# https://superuser.com/questions/1459466/can-i-add-an-additional-docker-entrypoint-script ENTRYPOINT ["/usr/bin/supervisord"] -CMD ["--nodaemon"] +CMD ["--configuration", "/etc/supervisord.conf", "--nodaemon"] -# Add our healthcheck script that determines when do we consider the container healthy -COPY healthcheck.sh / -HEALTHCHECK --interval=2s --timeout=5s --start-period=30s --retries=180 CMD /healthcheck.sh -#RUN ~/bin/corda-cli/bin/corda-cli package install -n solar-system solar-system.cpb +HEALTHCHECK --interval=30s --timeout=60s --start-period=200s --retries=100 CMD /healthcheck.sh diff --git a/tools/docker/corda-all-in-one/corda-v5/README.md b/tools/docker/corda-all-in-one/corda-v5/README.md new file mode 100644 index 00000000000..fe53d2d4513 --- /dev/null +++ b/tools/docker/corda-all-in-one/corda-v5/README.md @@ -0,0 +1,7 @@ +# Instructions to compile and run the new Corda v5.0 test network + +To create an image of the dockerfile run: +`DOCKER_BUILDKIT=1 docker build ./tools/docker/corda-all-in-one/corda-v5 -t newcordaimg` + +To run the AIO, execute: +`docker run -it --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock --network host -d newcordaimg` \ No newline at end of file diff --git a/tools/docker/corda-all-in-one/corda-v5/healthcheck.sh b/tools/docker/corda-all-in-one/corda-v5/healthcheck.sh index 469aab00863..e73a66ef35f 100755 --- a/tools/docker/corda-all-in-one/corda-v5/healthcheck.sh +++ b/tools/docker/corda-all-in-one/corda-v5/healthcheck.sh @@ -1,8 +1,25 @@ -#!/bin/bash +# #!/bin/bash set -e -#/root/bin/corda-cli/bin/corda-cli network status -n solar-system +# Function to check if all nodes are up and running +checkNodesStatus() { + local gradleOutput + # Run Gradle task and get the output + cd /CSDE-cordapp-template-kotlin/ + gradleOutput=$(./gradlew listVNodes) + echo "gradleOutput: $gradleOutput" + local upAndRunningCount + upAndRunningCount=$(echo "$gradleOutput" | grep -c -E "MyCorDapp|NotaryServer") -curl -u martian:password --insecure https://localhost:12116/api/v1/nodestatus/getnetworkreadinessstatus -curl -u earthling:password --insecure https://localhost:12112/api/v1/nodestatus/getnetworkreadinessstatus -curl -u plutonian:password --insecure https://localhost:12119/api/v1/nodestatus/getnetworkreadinessstatus + # Check if all 5 nodes are up and running + if [ "$upAndRunningCount" -eq 5 ]; then + echo "All 5 nodes are up and running." + exit 0 + else + echo "Waiting for all nodes to be up and running..." + sleep 5 + checkNodesStatus + fi +} + +checkNodesStatus \ No newline at end of file diff --git a/tools/docker/corda-all-in-one/corda-v5/start-services.sh b/tools/docker/corda-all-in-one/corda-v5/start-services.sh index 9df798835be..2fd31d2cc31 100755 --- a/tools/docker/corda-all-in-one/corda-v5/start-services.sh +++ b/tools/docker/corda-all-in-one/corda-v5/start-services.sh @@ -1,11 +1,14 @@ #!/bin/bash +set -e -# Load the cached container images into the Docker Daemon before launching -# the Docker Compose network. This is the preferred workaround to synchronizing -# different processes of a supervisord configuration -tar -cC '/etc/corda/corda-dev/' . | docker load +cd /CSDE-cordapp-template-kotlin/ +while true; do + echo "Waiting for startCorda to execute..." + if ./gradlew listVNodes | grep "X500"; then + echo "Starting v5NodeSetup..."; + ./gradlew 5-vNodeSetup + break; + fi + sleep 5; +done -# Now that the images are cached **and** loaded to the daemon, we can start the -# corda network via the docker-compose file and it will not need to download -# anything from DockerHub (if it does, that's a bug) -supervisorctl start corda5-solarsystem-contracts-demo-network diff --git a/tools/docker/corda-all-in-one/corda-v5/supervisor/corda5-solarsystem-contracts-demo-network.conf b/tools/docker/corda-all-in-one/corda-v5/supervisord.conf similarity index 58% rename from tools/docker/corda-all-in-one/corda-v5/supervisor/corda5-solarsystem-contracts-demo-network.conf rename to tools/docker/corda-all-in-one/corda-v5/supervisord.conf index 8d7bbe324b5..a7a8dd04054 100644 --- a/tools/docker/corda-all-in-one/corda-v5/supervisor/corda5-solarsystem-contracts-demo-network.conf +++ b/tools/docker/corda-all-in-one/corda-v5/supervisord.conf @@ -1,30 +1,27 @@ [supervisord] -logfile = /var/log/supervisord.log logfile_maxbytes = 50MB logfile_backups=10 loglevel = info -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[supervisorctl] -serverurl=http://127.0.0.1:9001 - [inet_http_server] port = 0.0.0.0:9001 -[program:start-services] -command=/start-services.sh +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[program:startCorda] +directory=/CSDE-cordapp-template-kotlin +command=/bin/bash -c "./gradlew startCorda" autostart=true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -[program:corda5-solarsystem-contracts-demo-network] -command=/usr/local/bin/docker-compose -f /corda5-solarsystem-contracts-demo/docker-compose.yaml up -autostart=false -autorestart=true +[program:5vNodeSetup] +directory=/ +command=/bin/bash -c "./start-services.sh" +autostart=true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr