-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(corda4): implement monitoring of state changes
Add new endpoints to corda kotlin server used to start and stop monitoring, and get/clean state changes from its internal buffer. Monitoring session is started separately for each client, each client can monitor many corda states. Clients that are not active for specified amount of time are removed. Implementation uses transaction queues that are polled periodically by the client, instead of socketio-based solution because we want to minimize probability of losing a transaction from corda. This can happen when WS connection is disconnected, for instance. With transaction queue on the connector, and explicit get/remove calls from the client, we have greater control over what transactions are delivered to the client code. Also, setting up socketio on spring boot seems overly complicated and would obscurificate the implementation. Add reactive watchBlocksV1 that polls kotlin server and reports new transactions asynchronously. Add CordaApiClient support to VerifierClient. Add functional test for both monitoring interfaces. Update corda setup in corda-all-in-one to newer version. Closes: #1610 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
- Loading branch information
Showing
28 changed files
with
2,706 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...r/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,43 @@ | ||
package org.hyperledger.cactus.plugin.ledger.connector.corda.server.api | ||
|
||
import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.ClearMonitorTransactionsV1Request | ||
import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.ClearMonitorTransactionsV1Response | ||
import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.DeployContractJarsBadRequestV1Response | ||
import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.DeployContractJarsSuccessV1Response | ||
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.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.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.StartMonitorV1Request | ||
import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StartMonitorV1Response | ||
import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StopMonitorV1Request | ||
import org.hyperledger.cactus.plugin.ledger.connector.corda.server.model.StopMonitorV1Response | ||
|
||
interface ApiPluginLedgerConnectorCordaService { | ||
|
||
fun clearMonitorTransactionsV1(clearMonitorTransactionsV1Request: ClearMonitorTransactionsV1Request?): ClearMonitorTransactionsV1Response | ||
|
||
fun deployContractJarsV1(deployContractJarsV1Request: DeployContractJarsV1Request?): DeployContractJarsSuccessV1Response | ||
|
||
fun diagnoseNodeV1(diagnoseNodeV1Request: DiagnoseNodeV1Request?): DiagnoseNodeV1Response | ||
|
||
fun getMonitorTransactionsV1(getMonitorTransactionsV1Request: GetMonitorTransactionsV1Request?): GetMonitorTransactionsV1Response | ||
|
||
fun getPrometheusMetricsV1(): kotlin.String | ||
|
||
fun invokeContractV1(invokeContractV1Request: InvokeContractV1Request?): InvokeContractV1Response | ||
|
||
fun listFlowsV1(listFlowsV1Request: ListFlowsV1Request?): ListFlowsV1Response | ||
|
||
fun networkMapV1(body: kotlin.Any?): List<NodeInfo> | ||
|
||
fun startMonitorV1(startMonitorV1Request: StartMonitorV1Request?): StartMonitorV1Response | ||
|
||
fun stopMonitorV1(stopMonitorV1Request: StopMonitorV1Request?): StopMonitorV1Response | ||
} |
Oops, something went wrong.