Corda Transaction verification failed when using different type of states as input and output

I am trying to create a corda transaction where I am consuming one type of input state while creating another type of state as output but while verification the input and the output state are being evaluated using the same command in different contracts hence the verification part is failing. Is there any way through which the input contract would be evaluated using the command for the first state while output state would be verified using another contract. In both contracts I am doing somethin

Corda: Kryo Buffer Underflow

I'm attempting to connect to a running Corda node via RPC using the Corda Explorer. As soon as I hit login I see this exception: ( - AMQ214000: Failed to call onMessage com.esotericsoftware.kryo.KryoException: Buffer underflow. Serialization trace: owningKey (net.corda.core.identity.Party) value (net.corda.core.utilities.Try$Success) at ~[kryo-4.0.0.jar:?] at com.esotericsoftware.kryo

List of CorDapps

I am trying to identify which CorDapps are running on a node this information is displayed in the console and in the log during startup Loaded CorDapps : blah-1.1.20, corda-core-2.0.0 Is there a programmatic way to get that list? (RPC?)

Corda - multi-state transactions with different participant sets

I have a scenario where I want to issue several states to the network, but the states have different participants Example val state1 = ExampleState(ALICE, BOB) val state2 = ExampleState(BOB, CHARLIE) val command = Command(ExampleCommand.Issue(), ...participants?) val transaction = TransactionBuilder(NOTARY) .addOutputState(state1, EXAMPLE_CONTRACT_ID) .addOutputState(state2, EXAMPLE_CONTRACT_ID) .addCommand(command) Observations The first state needs to be signed by ALICE and B

Is there a way to tell if a Corda node goes down?

I have an application connected to a Corda node using CordaRPC. If I stop the Corda node, I can't see a good way to detect that from my app. Eventually, if I try to call an RPC function, I get an error. Is there any low-level way to detect a lost connection?

How to solve 'Cannot find contract attachments' exception in Corda 4 upgrade

I upgraded to Corda 4 and now I'm getting the following exception when running my flow tests: net.corda.core.transactions.MissingContractAttachments: Cannot find contract attachments for my.package.Contractnull This is part of the code that I have in the mock network setup: fun setup() { network = MockNetwork(MockNetworkParameters(cordappsForAllNodes = listOf( cordappWithPackages("my.package"), enclosedCordapp() ))) ... } Any ideas on what I'

How to pass object in CLI in corda projects

I was trying to run car insurance project in corda but but i am not able to know how to pass the claimInfo data in object type can any one help me i am trying to pass the data like this start InsuranceClaimInitiator claimInfo: {claimNumber: "aa",claimDescription: "rrrr", claimAmount: 9}, policyNumber: "aaa" is this right or should we need to pass differently ???? its showing me this error Wed Feb 19 16:34:55 IS

Cannot run flow in corda node

I am running a corda network on kubernetes (corda version 4.4) and I am trying to install and run a cordapp . The cordapp am trying to run is the Heartbeat one (from the github corda sample folder) . But whenever I try to start the flow using the command start StartHeartbeatFlow I get the following error message : [INFO] 11:00:32+0200 [pool-2-thread-11] shell.StartShellCommand.main - Executing command "start StartHeartbeatFlow <no arguments>", start StartHeartbeatFlow: exception: com.

Corda LinearState with OneToMany mappings

I have a state which derives from LinearState and QueryableState. The state has a OneToMany mapping with one of the attributes in the sate. Adding a OneToMany marks the key with a Unique constraint. When i try to consume and create a new such state (keeping linearId same), this Unique key is violated as corda stores all consumed & unconsumed states in the same table. How can this be modelled in corda?

Add multiple notaries in CORDA

I am trying to create a DLT with 4 nodes and 2 notaries where each notary is responsible for communicating with 2 nodes. Sample Gradle config task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { directory "./build/nodes" networkMap "O=Controller,L=London,C=GB" node { name "O=Controller,L=London,C=GB" advertisedServices = ["corda.notary.validating"] p2pPort 10002 rpcPort 10003 cordapps = ["net.corda:corda-finance:$corda_release_version"] } node { name

Corda to get data from table without using reference of state

am trying to get the value from db without using serviceHub and vault.but i couldn't. what my logic is, when i pass the country name, it should return the id's(PK)of that country which is in one table.using those id's, it should return the values related to those id's from other could be possible in flow class.but am trying to do in api class where servicehub couldn't import. Please help me out.

How many transactions can Corda save in its h2 database?

We need to save about 10 millions transactions (each transaction will save one HASH of a electronic contract) per day and keep them for 3 years at least. Because Corda can only support h2 database currently, we want to know if Corda can not support saving so many tranactions due to the limit of the database or somethig else?

Some questions on implementation choices in Corda such as log4j2 and repositories MavenCentral Jcenter

Quick check on these two questions regarding some design choices in Corda: All 3 of these repositories are required in the build.gradle: 'jcenter()', 'mavenCentral()' and 'maven { url '' }'. a) Why is Corda dependent on a github snapshot (jitpack) b) why is everything not in both jcenter and mavenCentral? why is some parts in one and others in another? What is the criteria where the repositories are handle in jcenter vs/or mavenCentral? Lots of examples seem t

Corda Save multiply states into one flow

I have to execute transaction "or roll it back" with several states. For instance: 1. Create and save state A. 2. Update state B. 3. Create and save state C. At the moment I do it with subFlow execution for the each of the state. But theoretically, subFlow for step 2 can be crashed. In this case step 1 and step 3 will be stored but step 2 will be missed. Do you have the best practice pattern or example how to do it with Corda?

In Corda, how to start a flow from a service?

I have created a CordaService running on my node. I want this service to start flows based on various conditions. However, the ServiceHub provided to the service does not provide the ability to start flows. Is there any flow for a service to start a flow? How would I do thi?

Corda Performance gets slower during collect signature when volume is high

I tried to create ~100 LinearStates. Its in a flow that only contains a N for-each loop that subFlow another IssueFlow which issues one state per tx. This is on Corda 3.0, Azure Cloud with Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz 4GB RAM The linear state consists of Borrower Lender Regulator During CollectSignature, in the first 40~50 states, it takes around 3~4 seconds for EACH participant to respond. But as it goes on, it can take up to 14+ seconds for the initiator to receive the respo

Corda How to pass secure hash to transaction builder

I uploaded a file to Corda node and got the following hex value as string back: 854AAE9BE6607CE0B15A70EEBEF19C553557103FB051413F2AA35E70F5B44313 Now I need to pass this as a secureHash parameter to transaction builder: txBuilder.addAttachment(??). How to build secure hash from the hex string result obtained from file upload as input parameter to addAttachment..? SecureHash has toString() function that returns hash as hex string above. I need to create secure hash using the hex string ab

Corda Initiating flow session failed

when we try to submit a transaction, it always failed, and from the Corda log, below is the last error message we got, anyone can help what does this error mean? How should I further do the trouble shooting. Thanks. [INFO ] 2018-08-24T07:49:19,739Z [Node thread-1] flow.[c833dc79-501e-4484-9c43-a6924b472542].initiateSession - Initiating flow session with party O=CompanyC, L=Paris, C=FR. Session id for tracing purposes is SessionId(toLong=4256917187941908080). {} [WARN ] 2018-08-24T07:50:01,777Z

Null pointer exception while starting of corda node

I'm an newbie in corda and while starting the nodes using call command after the successful build, one of the nodes of corda throws us this null pointer exception shown below java.lang.NullPointerException at co.paralleluniverse.fibers.instrument.MethodDatabase$ClassEntry.equals( at co.paralleluniverse.fibers.instrument.MethodDatabase.recordSuspendableMethods( at co.paralleluniverse.fibers.instrument.MethodDatabas

Token issuance on Corda

Can an entity running a Corda node verify the issued amount of a certain token in the network, without knowing who owns how many of these tokens? (E.g. some party is issuing gold tokens, backed by physical gold. How can an investor verify the total supply of the gold tokens in the network? Currently you either lose privacy or have to trust a third party, like a regulator node.)

Serialization scheme error during interaction between Corda and Corda Enterprise nodes

I have a network with two nodes: NodeA running Corda Enterprise 3 NodeB running Corda (open-source) 3 When NodeA uses the Corda Finance CorDapp to transfer cash to NodeB, I get exceptions of the form Serialization scheme not supported.. If the Finance CorDapp was compiled against Corda Enterprise 3.2, I get the following stack trace: java.lang.UnsupportedOperationException: Serialization scheme ([636F7264610000], RPCClient) not supported. at net.corda.serialization.internal.Seriali

Corda Executing VaultQuery

total beginner here. I have a State with these values: private final Party issuer; private final Party owner; private final int patient; private final String hash; I want to run a vaultQuery where it will return the transactions where the patient is a specific ID. For example, if the patient ID is 16038382, and I have initiated several flows that contained that ID and several flows that have different patient IDs, I only want to run the vaultQuery to contain transactions where the patient I

Corda Finance database table migration failure upgrading from Corda 3 to Corda 4

When upgrading my database from Corda 3 to Corda 4 I ran into the following error with a table from the Corda Finance : net.corda.nodeapi.internal.persistence.CouldNotCreateDataSourceException: Could not create the DataSource: Migration failed for change set migration/cash-schema-v1.changelog-master.sql::initial_schema_for_CashSchemaV1::R3.Corda.Generated: Reason: liquibase.exception.DatabaseException: ERROR: relation "contract_cash_states" already exists [Failed SQL: create table contract_c

Verifying flows in Corda

How does a notary/node verify that a specific flow has been called when it receives the transaction? Does this mean Corda can guarantee that the flow has not been modified from what was stated in the corresponding Cordapp?

Is the verify() line needed in the cordapp-tutorial code?

Just wondering, I've noted that in the CollectSignaturesFlow there's this call: partiallySignedTx.tx.toLedgerTransaction(serviceHub).verify() And in the ExampleFlow there's this line: txBuilder.toWireTransaction().toLedgerTransaction(serviceHub).verify() Is it needed in both places? Don't they call the same routine?

Corda How to Create Party Object from a String?

Given mystring = "O=PartyB,L=New York,C=US", is there an easy method to convert the string into a real Party object? Have been looking at CordaRPCOps.wellKnownPartyFromX500Name() but cannot get it to work... Have tried variations of the following: val rpcOps = new CordaRPCOps() val otherParty: Party = rpcOps.wellKnownPartyFromX500Name(partyString) ?: throw Exception("Party not recognised.")

Legal Prose Usage Corda

It's a follow up question on previously answered legal prose question by Joel.(created separate question on request) @LegalProseReference(uri = "") public class MyContract implements Contract { @Override public void verify(LedgerTransaction tx) { // Contract logic. } } As the answer suggests, I got this legal doc my-legal-doc.html. so what happens in case the verify method doesn't throw an exception? and what happens in case verify does throw a

REST API and Corda Security issues

Does Corda have some best practice pattern how to organize security access with DAAPs. For example, REST API uses Corda node like a storage for accounts data, hashes of passwords etc. On the REST API side into the property file, we can hold settings for connection to the Corda node. Is it OK solution? Any best practice for it?

Unable to run corda tests from IntelliJ

When I select and run a test, the build fails with the message: "Kotlin: Usage of '@JvmDefault' is only allowed if the flag -Xenable-jvm-default is enabled" for the following files. corda/serialization/src/main/kotlin/net/corda/serialization/internal/OrdinalIO.kt corda/serialization/src/main/kotlin/net/corda/serialization/internal/SerializationFormat.kt corda/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/AMQPSerializer.kt I have cloned corda from my fork of

Corda When does a node checkpoint itself

I understand there's some annotation related to @Suspendable to mark a function as serialisable. How much does a flow checkpoint itself? Does a node checkpoint itself only when there's a send/sendAndReceive when it waits for a response? Or does it serialise checkpoints at an interval? Given a flow that does nothing but computation, how much does it serialise/write to disk, and does this affect performance if there's a peak load of read/write from other thread doing vault queries/writing. Ho

In Corda how can we get the Node database connection string in the API

I am trying to get the the JDBCsession connection url from the node into my API using a flow. I could get the flow to return the url using serviceHub.jdbcSession().metaData.url. However this returns url of the form "jdbc:h2:file:D:\Anshulee Projects\Corda\XXX-corda-network\build\nodes\Provider/persistence" and while a query using serviceHub.jdbcSession within the node works well, any attempt to connect to this url via the h2 Console or another created JDBCSession etc results in a Database in us

Corda Am I able to serialize the Transaction Builder to send it to another party?

Is there anyway to serialize a transaction builder? I’m trying to use the TwoPartyDealFlow to enable two parties to trade on-ledger tokens. I need to be able to add input states / outputs states / commands on both sides in order to use the .generateMove functionality from the token sdk. Let me know if this is possible or if I should be using a different method.

Corda 4 - How to add a new node to an existing corda network running in dev mode in local environment?

We are building a POC using Corda and Springboot web server. Following are the versions of Corda platform, Springboot server, and other essential dependencies used for building the POC- cordaReleaseGroup=net.corda cordaVersion=4.0 gradlePluginsVersion=4.0.45 kotlinVersion=1.2.71 junitVersion=4.12 quasarVersion=0.7.10 spring_version = '4.3.11.RELEASE' spring_boot_version = '2.0.2.RELEASE' spring_boot_gradle_plugin_version = '2.1.1.RELEASE' jvmTarget = "1.8" log4jVersion =2.11.2 platformVersio

Unable to do flow test in corda

When trying to perform to perform flow test using intellij IDE V2019.2 test fails and show the following error command line is too long. shorten command line Then tried to change other options in shorten command line and retested. Then it shows java.lang.IllegalArgumentException: There are no CorDapps containing the package com.kba.flows on the classpath. Make sure the package name is correct and that the CorDapp is added as a gradle dependency.

Problem in Running the example CorDapp Could not create the DataSource: Unknown data type: "İNT"


"Corda overlapexception in finality flow"

I have been upgrade my cordapps for a new version and after this, i have reached this error: "Multiple attachments define a file at br/com/seven/contracts/cte/cteproc.class., transaction: 2AC7EF8431AAF5C91AD7C6A8E363F862E65AD821E2455164F988C93AB8B04157"]

How to implement authorisation on a per-account on Corda

From corda blog about account lib Sadly, there’s no isolation at the node level but you can add application-level controls to provide authorisation on a per-account basis. This functionality would be baked into your CorDapp and the RPC client associated with it. Does anyone have ideas to implement this one?

How to share a corda account between two nodes?

I used the below flow to share the account from one Node to Other Node @InitiatingFlow @StartableByService @StartableByRPC class ShareAccountInfotoOtherParty(val accountName: String, val partyName: String) : FlowLogic<String>() { @Suspendable override fun call(): String { val TestAccount = subFlow(OurAccounts()).filter { == accountName }.last() val newParty = serviceHub.identityService.partiesFromName(partyName,exac

Corda: Creating contracts dynamically

In our use case, we need to define certain rules at run-time based on which a node will transact with other nodes in the network. For example, we want to define a rate at the front end and check that the transaction is happening with this rate only for that particular node. In other words, can we define the terms and conditions at run-time and would this still be called a smart contract or does a smart contract need to be always hard-coded. Is there any alternate way to look at this?

Starting the first node in R3 Corda demobench in CentOS 7 causes core dump

I'm running the latest public Corda demobench on linux(CentOS7) and when I attempt to start the first node, I get the following: terminate called after throwing an instance of 'std::bad_cast' what(): std::bad_cast I was not getting this before I ran a "yum upgrade". Any help is appreciated. Regards, Rob

Get State By Linearid corda version 3.1

I am trying to get a state by lineaId by getting a empty list: my code: val queryCriteria = QueryCriteria.LinearStateQueryCriteria(uuid = listOf( val customerAuditor = serviceHub.vaultService.queryBy<CustomerAuditor>(queryCriteria).states.single() Error: java.util.NoSuchElementException: List is empty. at kotlin.collections.CollectionsKt___CollectionsKt.single(_Collections.kt:472) ~[kotlin-stdlib-1.1.60.jar:1.1.60-release-55 (1.1.60)] at

Corda - Custom Vault Query for Null Column Not Working

Consider the following state: data class Example(val number: Int?, override val participants: List<AbstractParty>) : QueryableState { override fun generateMappedObject(schema: MappedSchema): PersistentState = when (schema) { is ExampleEntity.ExampleSchema.ExampleSchemaV1 -> ExampleEntity(number = number) else -> throw IllegalArgumentException("Unrecognised schema: $schema.") } override fun supportedSchemas(): Iterable<MappedSchema> {

  1    2   3   4   5  ... 下一页 共 5 页