How to create CorDapp jar file without redeploying nodes? - corda

We are using Corda Version 4 for our application.
We understand that the command gradlew.bat deployNodes creates following jars -
CorDapp (contracts, states, flows)
Corda platform
Dependencies
When any change is made in the contract/states/flows code, we had to run the command gradlew.bat deployNodes each time. Due to this the "Corda platform" and "Dependencies" jars always get recreated and consequently increases development time.
Does Corda platform provides alternative way to Only create "CorDapp" jar file and not the remaining ones?

You can use following cmd to generate only jar files
./gradlew build
this will generate jar files in you build/lib folder

Related

How to create the corda.jar?

When I build the corda project locally, I find a corda-4.1-corda.jar. Is that basically the same as the corda.jar file produced when node directories are generated by the cordformation plugin? Can I replace the latter by the former, after renaming it, in a deployment?
Once your dependencies are set correctly, you can build your CorDapp JAR(s) using the Gradle jar task
Unix/Mac OSX: ./gradlew jar
Windows: gradlew.bat jar
Run ./gradlew clean build -x test from the root directory. Once the process finishes, the jar is produced in the corda/node/capsule/build/libs/ directory as corda-<version>.jar.

My robot framework jar file with dependencies after maven install command is shown as corrupt file, Kindly assist

A snapshot.jar file of robot framework and its dependencies was created in eclipse after running maven install command. But the jar file is not able to execute my robot test cases as an error throws up: corrupt jar file.
I have searched about configuring pom.xml for robot framework as suggested in How to run test cases using robot framework jar file?, but could not build a proper jar file.
The primary purpose is that the jar file should be able to execute QA test cases in any remote or other system
Can someone please assist, its very important
Most likely, you are trying to add a tar.gz robot-selenium dependency instead of a jar robot-selenium dependency.
Follow the instructions here:
https://github.com/Hi-Fi/robotframework-seleniumlibrary-java
And here: http://robotframework.org/MavenPlugin/index.html

Issue in deployment of cord app

I checked https://docs.corda.net/deploying-a-node.html for deploying in windows server. I can see deploying nodes using NSSM Manager.
When I deploy nodes, how it will access my application which is placed as a jar under /opt/corda /CordaApp.jar
Also, When I run nssm.bat file under each nodes, my cmd is going on running with the first cmd and not stopping. Nothing proceed after that.
There is a typo in the docs. Where it says:
Create a directory called plugins in /opt/corda and save your CorDapp jar file to it. Alternatively, download one of our sample CorDapps to the plugins directory
It should read instead:
Create a directory called plugins in C:\Corda\ and save your CorDapp jar file to it. Alternatively, download one of our sample CorDapps to the plugins directory
This was fixed by the following PR: https://github.com/corda/corda/pull/2607.

Can we deploy multiple services in one Corda Node?

We have developed few apps in corda. Just wondering if we can deploy the different corda apps on a single node. Is it possible to do if yes then how we can proceed with this.
Currently when we deploy our application, it opens each node and run the service- state,flow for each nodes.
Yes, a node can have several CorDapps running at once. You build and install them as follows:
Run the following Gradle task from the root of your project to build the CorDapp JAR:
Unix/Mac OSX: ./gradlew jar
Windows: gradlew.bat jar
Copy the CorDapp JAR from the build/libs folder to the plugins/cordapps folder of your node
Repeat for each CorDapp
At runtime, your node will loads all the CorDapp JARs in its plugins/cordapps folder.

Check that a Clojurescript jar file is working

I have some Clojurescript source files that output messages to the browser console on a timer. Eventually I would like to make a Clojars library from these files. So far I have created an uberjar using lein. All the user of this library would need to do is :require a namespace from the library, and messages should be emitted to the browser console. Seeing these messages is the "all working fine" test I want to perform.
In other words how do I check that the jar file I have created works? Can I start off with a fresh lein project and just put the jar file in some special 'un-managed' directory and :require the namespace? Actually I don't think you can do such a thing with lein, hence the question.
Assuming you have a project.clj file already with the line
(defproject bigco/biglib "0.1.0-SNAPSHOT”
...
run
lein install
This will build the JAR and install it in your local Maven repo.
Then in your new project, add that dependency and run it.
If your jar (definition of jar includes uberjar of course) does not come neatly from a lein project then an alternative is to use Maven 2 directly:
mvn install:install-file -Dfile=./my-deps.jar -DgroupId=my-deps -DartifactId=my-deps -Dversion=1.0.0 -Dpackaging=jar
Here mvn will store the jar in your local .m2 maven repository. Once stored you can use this jar in any lein project on your machine by referring to it in the dependencies section:
[my-deps "1.0.0"]
Maven documentation for this.

Resources