corda

Corda: Large serialized transaction size: Are there alternatives to current serialization design?

醉酒当歌 提交于 2019-12-09 13:44:27
问题 It appears to me as if the current version of Corda (3.1) stores a (signed) transaction via a BLOB as a serialized byte-array of the Java class SignedTransaction . (The SignedTransaction is a WireTransaction , i.e. contains a byte array representing the serialized transaction). For some projects this approach might pose a challenge as it seems comparably wasteful w.r.t to memory and hence throughput. Is this the standard way Corda will serialize transactions? What options exist to change the

How to get Input states for flow testing

谁都会走 提交于 2019-12-08 14:44:49
I have two flows, say their names are: flow_out (requires 1 input state) flow_in (the above input state/transaction is stored by this) My flow(flow_out) have 1 input state and 1 output state. The input state is retrieved from vault in the flow(flow_out) and the same is verified in contract by all the parties(Currrently 3 parties in test MockNetwork). Now the test case is failing as my flow(flow_out) is unable to get that state, as that transaction never occurred(it's part of a different flow i.e flow_in). To get around it, I initiated the other flow(flow_in) also in @Before of Junit, to store

In Corda, `No installed custom CorDapps.` on node's built-in webserver

一曲冷凌霜 提交于 2019-12-08 14:26:05
问题 I have defined a CorDapp including an API. However, when I deploy the CorDapp and run my nodes, I see the following message at the webserver URL: No installed custom CorDapps. How can I get my node's built-in webserver to load my API? 回答1: For the node's built-in webserver to load the API, you must do two things: Create a WebServerPluginRegistry class that lists your API (example): class MyWebPlugin : WebServerPluginRegistry { override val webApis = listOf(Function(::MyApi)) } List the fully

Exception while connecting to RPC when using the Corda 3 node driver

别说谁变了你拦得住时间么 提交于 2019-12-08 13:44:44
问题 When I run Corda 3 nodes using the node driver, I intermittently get the following exception: [INFO ] 15:09:20,485 [driver-pool-thread-0] (DriverDSLImpl.kt:169) internal.DriverDSLImpl.invoke - Exception while connecting to RPC, retrying to connect at localhost:10013 {} org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException: AMQ119007: Cannot connect to server(s). Tried with all available servers. at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl

Is there a way to add a spending to a transaction received?

你。 提交于 2019-12-08 13:37:56
问题 I would like to represent in a single transaction two payments, one from party A (the first to create the transaction) and one from party B (the one supposed to receive the transaction). I've already tried by passing a TransactionBuilder object through a session between A and B but the object is not serializable. How can I do it? 回答1: Option 1 - Marking the TransactionBuilder as serialisable By default, the only objects that can be sent between nodes as part of flows are instances of classes

Error encountered in the “session.sendAndReceiveWithRetry(tx)”

给你一囗甜甜゛ 提交于 2019-12-08 11:39:48
问题 our app is using Corda V2.0 currently, and is deployed to dedicated server, we are using 3 notaries with RAFT configured, but when there is an input state of the transaction, below error was found in the log messaging.NodeMessagingClient.sendWithRetry - Reached the maximum number of retries (3) for message ClientMessageImpl And after reading the code of FinalityFlow, we found this error should happened in the step "session.sendAndReceiveWithRetry(tx)" of below codes in NotaryFlow.kt val

In Corda, how to get the timestamp of when a transaction happened?

浪子不回头ぞ 提交于 2019-12-08 10:05:22
问题 I am using Corda 3.2. Given a SignedTransaction , how can I establish when it was recorded? 回答1: There is no direct API for determining when a transaction was recorded. However, you can achieve this by checking either: When one of the transaction's inputs was consumed: val inputStateRef = signedTx.inputs[0] val queryCriteria = QueryCriteria.VaultQueryCriteria(stateRefs = listOf(inputStateRef)) val results = serviceHub.vaultService.queryBy<ContractState>(queryCriteria) val consumedTime =

Corda Controller Node

拜拜、爱过 提交于 2019-12-08 09:56:39
问题 With respect to Corda Nodes, Controller node serves as network map and offers validating notary service. What if the controller node is shut down? Will the other nodes function independently ? 回答1: There is no concept of a "Controller" node in Corda. We simply gace the node that played the role of both the network map and notary the name "Controller" in our example application. In real deployments, these roles would be separate. Regarding the shutdown of the network map/notary: If the network

How to get Input states for flow testing

那年仲夏 提交于 2019-12-08 08:09:43
问题 I have two flows, say their names are: flow_out (requires 1 input state) flow_in (the above input state/transaction is stored by this) My flow(flow_out) have 1 input state and 1 output state. The input state is retrieved from vault in the flow(flow_out) and the same is verified in contract by all the parties(Currrently 3 parties in test MockNetwork). Now the test case is failing as my flow(flow_out) is unable to get that state, as that transaction never occurred(it's part of a different flow

When to add @Suspendable to methods in a flow?

我的未来我决定 提交于 2019-12-08 05:48:46
问题 Whats the best practice here to annotate a method as @Suspendable ? In a Flow, there may be multiple private methods that query the vault/ compute business logic. Should these be annotated with @Suspendable so it can recover if a node crashes midway? Or is @Suspendable only for methods where send / sendAndReceived are involved where its waiting for responses from counterparties? 回答1: From paralleluniverse: The run methods in Fiber, SuspendableRunnable, and SuspendableCallable declare that