Code Monkey home page Code Monkey logo

samples-java's Introduction

CorDapp Samples - Java

Corda

Introduction

This repository contains multiple sample apps, from CorDapps that help you get started, all the way to demonstrating specific features and advanced usage.

If you are new to Corda and/or would like to learn all of the fundamentals in a guided and incremental manner please visit the Corda documentation site.

To get started explore the Basic folder, or navigate to the Advanced and Features folders to see a description of whats available. You can find the exact same set of CorDapp demonstration in Kotlin language at link.

Directories

The samples are divided into 5 sections with the following desciption:

  • Accounts: These samples showcases how to utilize Corda Accounts Libray to build CorDapps which aim to have massive user volume
  • Advanced: In these samples, we demonstrate more complex and sophisticated features of Corda.
  • Basic: They demonstrate fundamental and useful techniques for CorDapp development.
  • BusinessNetworks: These include Business Network Extension related samples. Learn more at bn-extension.
  • Features: These samples demonstrate specific Corda functionalities.
  • Tokens: These include TokenSDK related samples. Learn more at TokenSDK.

samples-java's People

Contributors

adelel1 avatar anixon604 avatar ashutoshmeher-r3 avatar davidawad avatar divya-r3 avatar iryna-09 avatar ja9-look avatar mcgovc avatar mehulgoel1 avatar moraygrieve avatar peterli-r3 avatar quan-wenjiang avatar r3hj avatar snedamle avatar ssuriyayuvan avatar xavierlepretre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

samples-java's Issues

Trouble running cordapp example "Failure to start BridgeControlListener"

So I have managed to get to ./build/nodes/runnodes section of the tutorial but all three terminal windows close stating : " [main] bridging.BridgeControlListener. - Failure to start BridgeControlListener" and " [main] internal.NodeStartupLogging. - Exception during node startup: stop can't be called twice "

not really sure how to fix this any suggestions ?

I'm running


Gradle 5.6.4

Build time: 2019-11-01 20:42:00 UTC
Revision: dd870424f9bd8e195d614dc14bb140f43c22da98

Kotlin: 1.3.41
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM: 1.8.0_332 (Amazon.com Inc. 25.332-b08)
OS: Mac OS X 12.4 x86_64

Cannot resolve symbol 'r3'

Hello, I'm trying to build a corda account for my project. I've installed the libraries inside of my build.gradle file. But, it seems have problem when I import the com.r3.corda.lib.accounts.contracts and com.r3.corda.lib.accounts.workflows inside of the file. Can I know how to solve the issues? (The issue is Cannot resolve symbol 'r3' and so on"

Use of PUT method

Grateful if you could help me understand why in obligations example the issue-iou method uses PUT rather than GET?

Cannot find contract attachments for BoardConfigContractnull

The contracts:test of the snakes'n'ladders sample fails with this error:

Cannot find contract attachments for BoardConfigContractnull

It can be resolved by changing the ID in the contract from

public static String ID = "BoardConfigContract";

to

public static String ID = "net.corda.samples.snl.contracts.BoardConfigContract";

Actually you can even make it final.

I'm pretty sure that other samples are affected as well. The cordapp-template-java already uses the fully qualified ID, but many samples don't. I wonder why this issue hasn't been found earlier... has it been introduced with a minor JDK update? I'm using AdoptOpenJDK 1.8.0_292.

Add A Blob-Inspector Sample

The blob-inspector could be useful for support staff to investigate issues.
Add a sample demonstrating simple serialisation and also serialisation when using jars on the classpath.

Corda RPC: A hot observable returned from an RPC was never subscribed to

I'm getting the error

RPCClientProxyHandler.onRemoval - A hot observable returned from an RPC was never subscribed to. This wastes server-side resources because it was queueing observations for retrieval. It is being closed now, but please adjust your code to call .notUsed() on the observable to close it explicitly. (Java users: subscribe to it then unsubscribe). If you aren't sure where the leak is coming from, set -Dnet.corda.client.rpc.trackRpcCallSites=true on the JVM command line and you will get a stack trace with this warning.

Following this example template, and making calls with SignedTransaction result = proxy.startTrackedFlowDynamic(ExampleFlow.Initiator.class, amount,otherParty).getReturnValue().get();

This SO says that the Observable needs to be subscribed and unsubscribed to. How is that supposed to be done properly given the example?

Error _clock_gettime.

After starting example protect CorDapps (java) ./gradlew clean deployNodes the command line output to back error. Symbol not found: _clock_gettime
Corda can be run on mac OS 10.11.x or it is bag?

dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
Referenced from: /private/var/folders/5t/4rpy0xg14fs_jc6bzhrc0nhc0000gn/T/libnetty_transport_native_kqueue_x86_645958139591609157117.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _clock_gettime
Referenced from: /private/var/folders/5t/4rpy0xg14fs_jc6bzhrc0nhc0000gn/T/libnetty_transport_native_kqueue_x86_645958139591609157117.dylib
Expected in: /usr/lib/libSystem.B.dylib

oracle-primenumber/README.md

In oracle-primenumber/README.md:

"We can then see the state wrapping the 5th prime (11) in our vault by running:

run vaultQuery contractStateType: net.corda.examples.oracle.base.states.PrimeState"

code refactored to:

run vaultQuery contractStateType: net.corda.samples.oracle.states.PrimeState

Postgresql did not connected to corda 4.10 version

i am using corda 4.10 and trying to connect to postgresql driver verison 42.2.9 then it gives error like incompatible database schema version detected please run schema migration scripts reasion there are 112 outstanding database changes. i am also try with another version of postgresql 42.1.4 driver but still i am facing same issue.Please give any solution.

Add An Example Of Custom Queries Over RPC

In the original example repo there was an example of using custom queries:
https://github.com/corda/cordapp-example/blob/release-V4/java-source/src/main/java/com/example/api/ExampleApi.java#L132-L137

    QueryCriteria generalCriteria = new QueryCriteria.VaultQueryCriteria(Vault.StateStatus.ALL);
    FieldInfo lenderField = QueryCriteriaUtils.getField("lender", IOUSchemaV1.PersistentIOU.class);
    CriteriaExpression lenderIndex = Builder.equal(lenderField, myLegalName.toString());
    QueryCriteria lenderCriteria = new QueryCriteria.VaultCustomQueryCriteria(lenderIndex);
    QueryCriteria criteria = generalCriteria.and(lenderCriteria);
    List<StateAndRef<IOUState>> results = rpcOps.vaultQueryByCriteria(criteria,IOUState.class).getStates();

There doesn't appear to be a similar example in this repo.

H2 database access is broken via localhost

Hi,

H2 database access via localhost is broken even though using the database URL given.
Getting connection refused.
Anyone have any idea? Thanks

image

image

image

Attached with is the node configuration
image
image

No reaction after HouseSaleInitiatorFlow

I have finished both flows of issue.

But when I try HouseSaleInitiorFlow, I can only see nothing but "starting".

And I found that the transaction is not finished.

Does anyone know how to fix it?

FAILURE: Build failed with an exception.

I tried gradlew clean deployNodes in directory, 'cd samples-java\Accounts\supplychain' and got the error mentioned in snapshot. Please help me to resolve this issue. The irony is, I build the same repo few months back and now it is not building.

cordaissue

Unable to Run Java Basic CordApp

After executing "gradlew deployNodes" the operation fails and continues to emit log messages until the JVM runs out of memory. Then the system is left in an unstable state requiring a reboot.

image

Add A Basic Performance / Load Testing Sample

Questions about load testing and performance frequently come up on Slack.

Corda Enterprise has the jmeter test suite, however, most new people seem to want something simple to use with their samples and not a full fledged solution. They also don't have access to Corda Enterprise.

JMeter is a pain to setup from scratch so a basic example without it would be sufficient as a sample.

A simple sample could do the following:

  • Run a Cordapp with a Spring Boot REST API (e.g. obligation-cordapp)
  • Take a CSV file as an input, convert it and upload it row by row to the REST API
  • Output a report containing the total time taken and maybe a few other metrics

e.g. some memory/CPU metrics https://www.baeldung.com/java-metrics and an example of a Corda JMX metric

Figures such as 600 TPS per node have been published https://medium.com/corda/transactions-per-second-tps-de3fb55d60e3 for Corda Enterprise so running a CSV file with 6000 rows would be interesting.

With this many rows the memory/CPU data etc could help highlight issues like how running on a laptop is very different from a server.

Ideally, this sample should be relatively easy to re-use for peoples own projects and require very little setup.
They should just be able to run it after checkout without 100 manual steps!

If the sample is done well, the users should just be able to put their own Cordapp/REST API and do the CSV conversion but still get the metrics and report without much more effort.

CollectSignatureFlow not needed in worldcupticketbooking/DVPAccountsOnSameNode.java

Hi,

following up this question on StackOverflow. Since the signers are all accounts all in the same node, the CollectSignatureFlow should not be needed. The comment in the source code of this example is either in contrast with what the Account Library documentation says or the documentation needs to be clarified to avoid confusion to learners.

//Note: though buyer and seller are on the same node still we will have to call CollectSignaturesFlow as the signer is not a Party but an account.

net.corda.client.rpc.RPCException: Cannot connect to server(s)

Hi
When you create nodes using Cordform, after building the project (through ./gradlew deployNodes) and running nodes (through ./build/nodes/runnodes) you can test APIs by running each server, e,g, runPartyAServer by command ./gradlew runPartyAServer.
But if you use Dockerform to create nodes, after building the project (through ./gradlew prepareDockerNodes) and running nodes (through docker-compose up), execution of command ./gradlew runPartyAServer encounters an error like the following:

I 21:36:25 1 RPCClient.logElapsedTime - Failed Startup took 259 msec
W 21:36:25 1 AnnotationConfigServletWebServerApplicationContext.refresh - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'controller' defined in file [.../clients/build/classes/java/main/net/corda/samples/example/webserver/Controller.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nodeRPCConnection': Invocation of init method failed; nested exception is net.corda.client.rpc.RPCException: Cannot connect to server(s). Tried with all available servers.

Add A Docker Sample

Docker can be a bit daunting if you have never used it before.

Add a Docker sample that clearly shows a deployment process involved creating your own docker image.
e.g.

  • creating self-signed certificates and a note about how to do it outside of simple demos
  • connecting to a bootstrapped network
  • best practices of which directories should be mounted

https://docs.corda.net/docs/corda-os/4.8/docker-image.html

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.