Yo CorDapp does not run against 4.0-SNAPSHOT - corda

After some trivial tweaks in build.gradle:
corda_release_version to say, 4.0-SNAPSHOT-sean
corda_gradle_plugins_version to 4.0.23
quasar_version to '0.7.10'
And repositories:
maven { url 'https://jitpack.io' }
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases' }
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap/' }
And in deployNodes task:
adding rpcSettings to the notary
removing finance from cordapps
The Yo CorDapp can stand up with three nodes: Notary, PartyA and PartyB.
The issue is that after a single /api/yo/yos query, the whole thing becomes frozen. All apis come back with HTTP ERROR 500, the debugging ports not working, trace logs show some artemis errors.
My setup: java version "1.8.0_172" on macOS 10.31.1.
It would be helpful to get at least the simplest CorDapp to run against the SNAPSHOT.
\Sean

You're not doing anything wrong here. We run continuous integration on the master branch but (unlike the release-Vx branches) we can't make any guarantees about the master branch working at any point in time.
I replicated your steps, and in my case, I got the following error:
[WARN ] 2018-06-14T14:18:22,744Z [Thread-11 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$5#d15f031)] core.client.fail - AMQ212037: Connection failure has been detected: AMQ119014: Did not receive data from /127.0.0.1:55037 within the 60,000ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT] {}

Related

Mutation Listener Event Strategy with remote JanusGraph is throwing serialization exception

I'd like to listen to mutations on a remote JanusGraph and I'm unable to figure out the correct setup to make it work.
JanusGraph stack:
JanusGraph docker image **0.5.2 (which is using Apache TinkerPop Gremlin 3.4.6) with cql-es configuration
Cassandra docker image 3.11.6
ElasticSearch docker image 7.3.1
Serializers section of gremlin-server-cql-es.yaml is updated with the following line:
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry, org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
Java client stack:
Based on pluradj/janusgraph-java-example
Java8
janusgraph-core 0.5.2
gremlin-driver 3.4.6
remote-objects.yaml looks as follows:
hosts: [127.0.0.1]
port: 8182
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0,
config: {
ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry, org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0]
}
}
Complete code (without ConsoleMutationListener) looks like this:
public static void main(String[] args) {
MutationListener mutationListener = new ConsoleMutationListener("Test");
EventStrategy eventStrategy = EventStrategy.build().addListener(mutationListener).create();
try (GraphTraversalSource g = AnonymousTraversalSource.traversal()
.withRemote("conf/remote-graph.properties")
.withStrategies(eventStrategy)) {
g.addV("person").property("name", "Test").next();
} catch (Exception e) {
e.printStackTrace();
}
}
ConsoleMutationListener is a copy of TinkerPop's sample ConsoleMutationListener with modified constructor to accept graph name instead of a full graph, since toString() was the only method used anyways.
Stack trace:
io.netty.handler.codec.EncoderException: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: An error occurred during serialization of this request [RequestMessage{, requestId=9436b08c-7e31-4fc0-b480-40904055f491, op='bytecode', processor='traversal', args={gremlin=[[withStrategies(EventStrategy)], [addV(person), property(name, Test)]], aliases={g=g}}}] - it could not be sent to the server - Reason: org.apache.tinkerpop.gremlin.driver.ser.SerializationException: java.lang.IllegalArgumentException: Class is not registered: org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy
Note: To register this class use: kryo.register(org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy.class);
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:107)
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:716)
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:708)
at io.netty.channel.AbstractChannelHandlerContext.access$1700(AbstractChannelHandlerContext.java:56)
at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext.java:1102)
at io.netty.channel.AbstractChannelHandlerContext$WriteAndFlushTask.write(AbstractChannelHandlerContext.java:1149)
at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:1073)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518)
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: An error occurred during serialization of this request [RequestMessage{, requestId=9436b08c-7e31-4fc0-b480-40904055f491, op='bytecode', processor='traversal', args={gremlin=[[withStrategies(EventStrategy)], [addV(person), property(name, Test)]], aliases={g=g}}}] - it could not be sent to the server - Reason: org.apache.tinkerpop.gremlin.driver.ser.SerializationException: java.lang.IllegalArgumentException: Class is not registered: org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy
Note: To register this class use: kryo.register(org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy.class);
at org.apache.tinkerpop.gremlin.driver.handler.WebSocketGremlinRequestEncoder.encode(WebSocketGremlinRequestEncoder.java:60)
at org.apache.tinkerpop.gremlin.driver.handler.WebSocketGremlinRequestEncoder.encode(WebSocketGremlinRequestEncoder.java:38)
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:89)
... 12 more
If I remove the withStrategies(eventStrategy) the Vertex is added to the graph and I'm also able to query the graph normally. However I'm not able to configure the GraphTraversalSource with EventStrategy.
Q1: What I'm thinking is that message with defined Event Strategy cannot be serialized with GryoMessageSerializerV3d0 or Mutation Listener/Event Strategy should somehow be registered on the server side, but I can't find any references on how to do that. Are there any examples of such configuration?
Q2: What am I doing wrong? Is it even possible to use TinkerPop's EventStrategy with JanusGraph?
Q3: Is there any other approach to listen to remote JanusGraph mutations?
Changing serializer to GraphSONMessageSerializerV3d0 gives:
java.util.concurrent.CompletionException: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: EventStrategy does can only be constructed with instance() or create(Configuration)
at java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:375)
at java.util.concurrent.CompletableFuture.join(CompletableFuture.java:1947)
...
Caused by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: EventStrategy does can only be constructed with instance() or create(Configuration)
Changing serializer to GraphBinaryMessageSerializerV1 gives:
java.util.concurrent.CompletionException: io.netty.handler.codec.DecoderException: org.apache.tinkerpop.gremlin.driver.ser.SerializationException: The most significant bit should be set according to the format
at java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:375)
at java.util.concurrent.CompletableFuture.join(CompletableFuture.java:1947)
...
Caused by: io.netty.handler.codec.DecoderException: org.apache.tinkerpop.gremlin.driver.ser.SerializationException: The most significant bit should be set according to the format
Q1: What I'm thinking is that message with defined Event Strategy cannot be serialized with GryoMessageSerializerV3d0 or Mutation Listener/Event Strategy should somehow be registered on the server side, but I can't find any references on how to do that.
That is correct. EventStrategy does not work across remote connections.
Q2: What am I doing wrong? Is it even possible to use TinkerPop's EventStrategy with JanusGraph?
It is possible to use it with JanusGraph but only in embedded mode as the MutationListener implementations do not know how to send events back to the client. The driver would likely need some significant changes to introduce a mechanism to support that so it is a non-trivial change. If that were figured out then there still remain serialization issues to sort out for users who supply custom MutationListeners (though perhaps maybe that just wouldn't be allowed).
Q3: Is there any other approach to listen to remote JanusGraph mutations?
The key word there is "remote" and I don't think anything exists currently to allow that. You would need to build you're own of some sort. One way might be to configure "g" with EventStrategy on the server and then add a MutationListener that would send those events to a separate queue that you could consume remotely. You might also consider looking at the JanusGraph Bus and devise a similar scheme.

How to change Janusgraph Client read consistency?

I am new to Janusgraph and using Cassandra as the backend database. I have a query which uses find all incoming edges to a node. For that I need to make the read consistency to ONE in Janusgraph configuration. I have tried the following configuration but am not able to get the correct read consistency:
public static JanusGraph create() {
JanusGraphFactory.Builder config = JanusGraphFactory.build();
config.set("storage.backend", "cassandrathrift");
config.set("storage.cassandra.keyspace", "cs_graph");
config.set("storage.cassandra.read-consistency-level","ONE");
config.set("storage.cassandra.write-consistency-level","ONE");
config.set("storage.cassandra.frame-size-mb", "128");
config.set("storage.cassandra.thrift.cpool.max-wait", 360000);
config.set("storage.hostname", "10.XXX.1.XXX");
config.set("connectionPool.keepAliveInterval","360000");
config.set("storage.cql.only-use-local-consistency-for-system-operations","true");
graph = config.open();
System.out.println("Graph = "+graph);
traversalSource = graph.traversal();
System.out.println("traversalSource = "+traversalSource);
getAllEdges();
return graph;
}
However, the client is still showing the CassandraTransaction in QUORUM level of consistency.
Here are the logs:
16:40:54.799 [main] DEBUG o.j.d.cassandra.CassandraTransaction -
Created CassandraTransaction#25e2a451[read=QUORUM,write=QUORUM]
16:40:54.800 [main] DEBUG o.j.d.cassandra.CassandraTransaction -
Created CassandraTransaction#1698ee84[read=QUORUM,write=QUORUM] All
edges = 100000 16:40:55.754 [main] DEBUG
o.j.g.database.StandardJanusGraph - Shutting down graph
standardjanusgraph[cassandrathrift:[10.70.1.167]] using shutdown hook
Thread[Thread-5,5,main] 16:40:55.755 [main] DEBUG
o.j.d.cassandra.CassandraTransaction - Created
CassandraTransaction#3e5499cc[read=QUORUM,write=QUORUM] 16:40:55.755
[main] DEBUG o.j.d.cassandra.CassandraTransaction - Created
CassandraTransaction#67ab1c47[read=QUORUM,write=QUORUM] 16:40:56.113
[main] DEBUG o.j.d.cassandra.CassandraTransaction - Created
CassandraTransaction#6821ea29[read=QUORUM,write=QUORUM] 16:40:56.542
[main] DEBUG o.j.d.cassandra.CassandraTransaction - Created
CassandraTransaction#338494fa[read=QUORUM,write=QUORUM] 16:40:56.909
[main] INFO o.j.d.c.t.CassandraThriftStoreManager - Closed Thrift
connection pooler.
Any suggestions on how to change this to ONE or LOCAL consistency level??
For one, I would switch to connect over CQL instead of Thrift. Thrift has been deprecated, so it's not seeing the benefits of any improvements for bug fixes. In other words, if it's inherently broken, it won't be fixed. So you're much better off using CQL.
config.set("storage.backend", "cql");
config.set("storage.cql.keyspace", "cs_graph");
storage.cql.read-consistency-level=ONE
storage.cql.write-consistency-level=ONE
Secondly, you need to make sure that you're consistently using the config properties for your storage backend. Unfortunately with JanusGraph and Cassandra, these are easy to mix-up...
config.set("storage.cassandra.read-consistency-level","ONE");
config.set("storage.cassandra.write-consistency-level","ONE");
....
config.set("storage.cql.only-use-local-consistency-for-system-operations","true");
In the above example, you've set properties on storage.cassandra (Thrift) and the storage.cql (CQL) configs.
If that still doesn't work, try adding this setting as well:
log.tx.key-consistent=true
Setting the transaction log to be key-consistent overrides it's default QUORUM consistency access, if that's what is showing as QUORUM.

ByteSequence not on whitelist or annotated #CordaSerializable issue while adding new node using network bootstrapper 4.0 OS

I am trying to add new node to existing corda network
ByteSequence is not on the whitelist or annotated with #CordaSerializable issue while adding new node using corda network bootstrapper 4.0 open source
To add a new node to an existing network I followed below option which is recommended here at this link
How to add a new node to an existing corda network?
I Used the network bootstrapper https://docs.corda.net/network-bootstrapper.html (and followed docs correctly)
I am getting below error when running
java -jar corda-tools-network-bootstrapper-4.0.jar --dir <nodes-root-dir> command.
Error :-
Loading existing network parameters... [ERROR] 14:57:27+0530 [main] amqp.DeserializationInput.log - Serialization failed direction="Deserialize",
type="java.lang.Comparable<net.corda.core.utilities.ByteSequence>",
msg="Class "java.lang.Comparable<net.corda.core.utilities.ByteSequence>" is not on the whitelist or annotated with #CordaSerializable.",
ClassChain="java.lang.Comparable<net.corda.core.utilities.ByteSequence>"
Class "java.lang.Comparable<net.corda.core.utilities.ByteSequence>" is not on the whitelist or annotated with #CordaSerializable
Results after running this command :-
New node's folder got created and node-info file got copied at appropriate places to other nodes as well.
Got the above error on command line when executed the above java command.
New Node got up and running when tried java -jar corda.jar on new node.
But existing node-info files from "additional-node-infos" folder of other nodes got updated with some content related to this serialization in it.
Please help on below
To resolve this error regarding Corda Serialization when running bootstrapper command ?
Regarding Point no. 04 from above is this a correct behavior ?
It seems you cannot even successfully bootstrapped the network. I would suggest you give a try on our latest version of the boot-strapper:https://docs.corda.net/docs/corda-os/4.4/network-bootstrapper.html
The primary reason people use boot-strapter is to start a mock network remotely. Ideally, you would go through the following steps:
build your cordapp
use deployNodes to get the directories for each nodes.
copy the XXX_node.conf file to a different folder
make change to your node.conf to update any changes for ports or etc
copy the CorDapps jars to the new folder
run the bootstrapper
copy the newly generated directories to the remote vm.

Corda - enabling signing on contracts jar causes deployNodes task to fail

I have enabled the signing for contracts module with the following code snippet:
signing {
enabled true
options {
keystore signingKey.keystore
alias signingKey.alias
storepass signingKey.storepass
keypass signingKey.keypass
storetype signingKey.storetype
}
}
This works perfectly when I build my contracts with jar task, but when I run the deployNodes task I get the following wired exception:
Execution failed for task ':deployNodes'.
> Corda X.500 names must include an O attribute
> Corda X.500 names must include an O attribute
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':deployNodes'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.InvalidUserCodeException: Corda X.500 names must include an O attribute
at net.corda.plugins.Baseform.bootstrapNetwork(Baseform.kt:235)
at net.corda.plugins.Cordform.build(Cordform.kt:68)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:801)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:768)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
... 31 more
Caused by: java.lang.IllegalArgumentException: Corda X.500 names must include an O attribute
at net.corda.core.identity.CordaX500Name$Companion.build(CordaX500Name.kt:88)
at net.corda.core.identity.Party.<init>(Party.kt:33)
at net.corda.core.internal.JarSignatureCollector.toPartiesOrderedByName(JarSignatureCollector.kt:80)
at net.corda.core.internal.JarSignatureCollector.collectSigningParties(JarSignatureCollector.kt:35)
at net.corda.nodeapi.internal.network.NetworkBootstrapper.isSigned(NetworkBootstrapper.kt:461)
at net.corda.nodeapi.internal.network.NetworkBootstrapper.bootstrap(NetworkBootstrapper.kt:250)
at net.corda.nodeapi.internal.network.NetworkBootstrapper.bootstrap$default(NetworkBootstrapper.kt:218)
at net.corda.nodeapi.internal.network.NetworkBootstrapper.bootstrapCordform(NetworkBootstrapper.kt:198)
at net.corda.plugins.Baseform.bootstrapNetwork(Baseform.kt:233)
... 46 more
There is nothing interesting in my deployNodes task I guess, but in any case, here it is:
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
nodeDefaults {
projectCordapp {
deploy = false
}
cordapp project(':tcw-contracts-states')
cordapp project(':tcw-cordapp')
}
node {
name "O=Notary, L=London, C=GB"
notary = [validating: false]
p2pPort 10002
rpcSettings {
address("localhost:10003")
adminAddress("localhost:10043")
}
}
node {
name "O=PartyA, L=London, C=GB"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
cordapp (project(':tcw_corda_webserver')) {
config "braidPort=8080"
}
extraConfig = [
'h2Settings.address': 'localhost:10036',
'dataSourceProperties.dataSource.user': 'asd',
'dataSourceProperties.dataSource.password': '123'
]
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}
node {
name "O=PartyB, L=New York, C=US"
p2pPort 10008
rpcSettings {
address("localhost:10009")
adminAddress("localhost:10049")
}
cordapp (project(':tcw_corda_webserver')) {
config "braidPort=8081"
}
extraConfig = [
'h2Settings.address': 'localhost:10039',
'dataSourceProperties.dataSource.user': 'asd',
'dataSourceProperties.dataSource.password': '123'
]
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
}
}
For future references these error is related to the JDK is being used:
Installing with a tooling JDK 8.x works
You can do that by installing :
sdk install java 8.0.292-open
BEFORE
(base) ➜ cordapp-example git:(master) ./gradlew deployNodes
> Task :contracts:jar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':contracts:jar'.
> Exception while signing contracts-1.0.jar, ensure the 'cordapp.signing.options' entry contains correct keyStore configuration, or disable signing by 'cordapp.signing.enabled false'. Run with --info or --debug option and search for 'ant:signjar' in log output.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.6.4/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
4 actionable tasks: 2 executed, 2 up-to-date
(base) ➜ cordapp-example git:(master)
AFTER
(base) ➜ cordapp-example git:(master) sdk install java 8.0.292-open
Downloading: java 8.0.292-open
In progress...
################################################################################################################################################################################################################### 100.0%################################################################################################################################################################################################################### 100.0%
Repackaging Java 8.0.292-open...
Done repackaging...
Installing: java 8.0.292-open
Done installing!
Setting java 8.0.292-open as default.
(base) ➜ cordapp-example git:(master) ./gradlew deployNodes
Starting a Gradle Daemon, 1 busy and 2 stopped Daemons could not be reused, use --status for details
> Task :jar
Cordapp metadata not defined for this gradle build file. See https://docs.corda.net/head/cordapp-build-systems.html#separation-of-cordapp-contracts-flows-and-services
> Task :deployNodes
Running Cordform task
Deleting /home/shellcheff/Development/dust/DustR3/samples-kotlin/Basic/cordapp-example/build/nodes
Bootstrapping local test network in /home/shellcheff/Development/dust/DustR3/samples-kotlin/Basic/cordapp-example/build/nodes
Generating node directory for Notary
Generating node directory for PartyA
Generating node directory for PartyB
Waiting for all nodes to generate their node-info files...
Distributing all node-info files to all nodes
Loading existing network parameters... none found
Gathering notary identities
Generating contract implementations whitelist
New NetworkParameters {
minimumPlatformVersion=8
notaries=[NotaryInfo(identity=O=Notary, L=London, C=GB, validating=false)]
maxMessageSize=10485760
maxTransactionSize=524288000
whitelistedContractImplementations {
}
eventHorizon=PT720H
packageOwnership {
}
modifiedTime=2021-05-20T07:51:20.057Z
epoch=1
}
Bootstrapping complete!
Run database schema migration scripts
Run database schema migration scripts
Run database schema migration scripts
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.6.4/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 1m 8s
14 actionable tasks: 13 executed, 1 up-to-date
Strict rules and SDK might not be the path forward for this tool but .. in this case works
Enjoy.
Happy Coding.
similar to Sneha I tried enabling key signing on an example cordapp and was able to run it multiple times locally without any issues.
without being able to see your code here are my suggestions.
try clearing your gradle cache.
try recopying your project to a different directory and with intellij, open the project. (remember open and import project are NOT the same thing).
Make sure your deployNodes task works correctly for other projects on this machine or others.
thanks and best of luck.

Couldn't find network parameters file and compatibility zone wasn't configured/isn't reachable

I am trying to handcraft a Node folder with following contents - Corda.jar (1.4), Node.conf, cordapp (Folder).
Receiving following error on Node startup (java -jar ./Corda.jar)
Logs can be found in :
! ATTENTION: This node is running in development mode! This is not safe for production deployment.
[ERROR] 15:20:24-0400 [main] internal.NodeStartupLogging.invoke - Exception during node startup: Couldn't find network parameters file and compatibility zone wasn't configured/isn't reachable. [errorCode=1917kd6, moreInformationAt=https://errors.corda.net/OS/4.0/1917kd6]
Following are the contents of Node.conf file :
devMode=true
myLegalName="O=PartyA,L=London,C=GB"
p2pAddress="localhost:10014"
rpcSettings {
address="localhost:10015"
adminAddress="localhost:10016"
}
security {
authService {
dataSource {
type=INMEMORY
users=[
{
password=test1
permissions=[
ALL
]
user=user1
}
]
}
}
}
Expected : Node starts
Actual : Exception (above)
As Florian mentioned, you can use the corda network bootstrapper to create a local run-able Corda environment.
Feel free to flow the guide here: https://docs.corda.net/docs/corda-os/4.4/network-bootstrapper.html
The issue with handcraft the node folders yourself is that you will run into very complicated process of certificates, network parameters, and etc.

Resources