Giter Club home page Giter Club logo

corda-training-template's Issues

Unable to resolve net.corda:corda-core:4.0-SNAPSHOT

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

IOUSettleTests.kt

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'

Cannot Issue an IOU on Corda-Training-Template Java-Src

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?

Unable to run test case#1 with JDK11.0.1

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 FAILED

FAILURE: Build failed with an exception.

PS:Meanwhile , I am trying to configure JDK8 and will provide my observations.

Part of IOUApi should be left unimplemented in sync with training materials

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.

Reg build issue

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

If the downloaded code is used as it is for build, then following error is coming

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 the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

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?

Invalid check of IOUState on full settlement flow

val signedTransactionFlow = object : SignTransactionFlow(flowSession) {
override fun checkTransaction(stx: SignedTransaction) = requireThat {
val outputStates = stx.tx.outputs.map { it.data::class.java.name }.toList()
"There must be an IOU transaction." using (outputStates.contains(IOUState::class.java.name))

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.

DummyState shall be imported from net.corda.testing.contracts package

// tx.input(IOUContract.IOU_CONTRACT_ID, new DummyState());

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

Postman collection does not match configuration and code

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, runnodes requires special OS permissions

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".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.