corda / corda-training-template Goto Github PK
View Code? Open in Web Editor NEWA template for the corda two day training course.
License: Other
A template for the corda two day training course.
License: Other
distributionUrl=https://services.gradle.org/distributions/gradle-4.4.1-all.zip
should be
distributionUrl=https://services.gradle.org/distributions/gradle-5.4.1-all.zip
If you clone the repo and follow the instructions, there are some error like this after opening in Intelli J:
Warning:<i><b>root project 'corda-supply-chain-poc': Unable to resolve additional project configuration.</b>
Details: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':kotlin-source:compile'.
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve net.corda:corda-core:4.0-SNAPSHOT.
Required by:
project :kotlin-source
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve net.corda:corda-core:4.0-SNAPSHOT.
Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases/net/corda/corda-core/4.0-SNAPSHOT/corda-core-4.0-SNAPSHOT.pom'.
Caused by: org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not GET 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases/net/corda/corda-core/4.0-SNAPSHOT/corda-core-4.0-SNAPSHOT.pom'. Received status code 409 from server: Conflict</i>
Looking into the maven repository, 4.0-SNAPSHOT is not longer there
At the time of writing this, the most recent was: 4.0-RC02
I'm also sending a PR fixing this
It looks like there is a bug with the solution as I am trying to run the first test of IOUSettleTests.kt it gives me error.
I got it working by changing the string message in IOUSettleTests.kt
in line 61 this.failsWith("Contact Verification Failed");
by this.failsWith("Contract verification failed")
Noticed it was different in the Corda-training-solution repo.
java.lang.AssertionError: Expected exception containing 'Contact Verification Failed' but raised exception was 'net.corda.core.contracts.TransactionVerificationException$ContractRejection: Contract verification failed: Required net.corda.training.contract.IOUContract.Commands command, contract: net.corda.training.contract.IOUContract, transaction: 44A4FD321412407AB9F7C2F6B1AAD494284F0CF140A7FEC8F58AF7FB09FAF65D'
Just cloned the repo and noticed that the run config has missing units tests especially for the Java source. Recommend putting it back.
The IOUIssueFlow takes a parameter of IOUState state
. As described in creating-an-instance-of-a-class, we can provide the state object to the flow via the crash shell as (also tried without the dollar sign):
flow start IOUIssueFlow$InitiatorFlow state: { amount: $10, lender: "O=ParticipantB, L=New York, C=GB", borrower: "O=ParticipantC, L=Paris, C=FR" }
This statement works with the Kotlin version of the corda-training-template but throws the following error in the Java version:
No matching constructor found:
- [net.corda.training.state.IOUState]: Could not parse as a command: Cannot construct instance of `net.corda.training.state.IOUState` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
at [Source: UNKNOWN; line: -1, column: -1]
Although I am not using the default constructor, the default constructor should still be called by this()
:
@ConstructorForDeserialization
public IOUState(Amount<Currency> amount, Party lender, Party borrower, UniqueIdentifier linearId){
this.amount = amount;
this.lender = lender;
this.borrower = borrower;
this.linearId = linearId;
}
public IOUState(Amount<Currency> amount, Party lender, Party borrower) {
this(amount, lender, borrower, new UniqueIdentifier());
}
What is the proper syntax to issue an IOU state in the corda-training-template?
These hints are still talking about Cash.generateSpend()
, which appears to have been changed to CashUtils.generateSpend()
.
Hi Team,
I am now trying to run first IOUState Test from IntelliJ IDEA.
I've configured jdk11.0.1 for this in project structure.
When i am trying to execute first assignment . Its not able to identify the JDK version on my system.
Could you please look at it.
Could not determine Java version using executable C:\Program Files\Java\jdk-11.0.1\bin\java.exe.
The problem is... Its unable to implement the interface "ContractState" .
So, when i am trying to run the test again after declaring amount variable "val amount : Amount" ..
Its unable to identify the Amount and currency keywords and throwing below error,
e: E:\BlockChain\Corda\corda-training-template\kotlin-source\src\main\kotlin\net\corda\training\state\IOUState.kt: (12, 34): Unresolved reference: Amount
e: E:\BlockChain\Corda\corda-training-template\kotlin-source\src\main\kotlin\net\corda\training\state\IOUState.kt: (12, 41): Unresolved reference: currency
:kotlin-source:compileKotlin FAILEDFAILURE: Build failed with an exception.
PS:Meanwhile , I am trying to configure JDK8 and will provide my observations.
In Module 10 of https://github.com/corda/corda-training-materials ,
the trainee or the reader is requested to implement getIOUs()
and issueIOU()
for practice,
however they are already implemented or the whole solutions are just commented out in corda-training-template
.
For the training materials to be effective, we need modifications either to the code or to the document, such that the trainee can implement by his/her own.
I am trying to set up corda-training-template on my PC. It is a Ubuntu 18.04 system with 16GB RAM.
JDK is set to JAVA 1.8.0.242
ERROR: Unable to load class 'com.intellij.util.ThrowableConsumer'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In case following change is done:
distributionUrl=https://services.gradle.org/distributions/gradle-5.4.1-all.zip,
then after the download of corda-webserver-4.0 jar, Build hangs and I need to restart the PC.
Can you please confirm what could I be missing?
In the case of full settlement, the transaction must not contain an IOUState in output, therefore the code above produces an error.
The check should be removed as in corda-training-solutions
, or modified such that the check is made only when in a partial settlement.
BTW I don't have much expertise on Corda so not sure but, I doubt that that check is really required here, because we have already similar checks in IOUContract
.
The test case expects to create a DummyState, but it's not imported into the test file. It can be imported to the file to let beginners focus on solving and understanding corda instead of solving dependency/import issues.
Solution "import net.corda.testing.contracts.DummyState;" shall be added to IOUIssueTests.java
The port numbers I get when running runnodes
on macOS are different from those stored in the Postman collection. When running the script, I seem to get the ParticipantA webserver on 10009, ParticipantB on 10012 and ParticipantC on 10015. On the other hand, in Postman I see that it expects Node A to be on 10007, Node B on 10010 and Node C on 10013.
Also, the ParticipantC name is different in the Postman collection (O=ParticipantC,L=New York,C=US) versus the node configuration (O=ParticipantC,L=Paris,C=FR).
On macOS 10.14.4, executing the runnodes
triggers a permission prompt to allow the executing program (Terminal or another terminal emulator such as iTerm2) to "control your computer" and then to "control Terminal".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.