Java SDK HyperLedger Fabric - java

I am new using the HyperLedger Fabric Java SDK. I have been using the fabcar example as a starting point. I would like to hook up the application to a rest API, where users can submit a transaction to the blockchain but I am having a hard time finding a good resource for this. the example I am following is here: https://github.com/IBM/blockchain-application-using-fabric-java-sdk. From this example, I am simply building the application and then copying the jar file into various classes to invoke the chain and query the chain ,etc. I am a little confused by this approach. Is this the standard for using HyperLedger fabric, all done from the command line like this, and are the logs that are outputted the actual blockchain? Are there any other resources out there that can help me with this concept?

I also experience like you. Before you start to learn how to code Fabric Java SDK, you need to understand all of the components and processes of Hyperledger Fabric. Then, you download the Fabric Java SDK from here. Please read the read.me carefully. After you created the Maven project and imported the latest Fabric Java SDK, then you import the sample project files from this folder. I recommend you to test the project file name End2endIT.java first.
For your info, you need to run the script to create the container in Docker before you run End2endIT.java. The script files are in this folder. When you enter that folder you need to run the script in the command line with .\fabric.sh start to create the container in Docker. There have various commands using in different situations. Please read fabric.sh file carefully.

Related

How to run Scuba project from Eclipse

I try to use Scuba project.I downloaded source with SVN checkout and imported it into Eclipse .Also i imported scuba_smartcards project. Everything is perfect but i have one problem.When i try to run scuba project like java application,have this error message:
Selection does not contains main type
I don't know is a correct to run this source like java application or not.By the way i created my own java class and i want to use scuba's source in main method
Ho i can solve my problem?
thanks everyone
P.s i also found source in github
https://github.com/credentials/scuba
I'm using scuba_sc_j2se
SCUBA is a framework, basically it is a library with active components. Libraries are not standalone applications so they will not contain a main method of their own. You cannot just run it, you need to write or copy an application that uses the framework through the API presented by SCUBA.
One of these applications is the jMRTD application from which SCUBA originated.

How to query Jenkins using java

I am programming using java to fetch few information from Jenkins url. I am trying to get information on nodes, projects created etc. All these are get commands. On browsing about it, I reached following link:
http://javadoc.jenkins.io/
I tried using import statement "import hudson.cli.GetNodeCommand;". But it is throwing me error : The import hudson.cli.GetNodeCommand cannot be resolved.
I have imported jars from my JEnkins url ( https://jenkins.example.com/jnlpJars/jenkins-cli.jar). How do I resolve this? I downloaded this jar from github also and that also has same structure as in the screen shot below. There is no GetNodeCommand class inside 'hudson.cli' package. How do I fetch information about nodes?
The class hudson.cli.GetNodeCommand is part of Jenkins core, and not part of the CLI client JAR. See the developer documentation for pointers to building Jenkins itself, if you want to do something with these classes.
If you want to execute GetNodeCommand, you can do so by running the CLI client with the get-node command, e.g.: java -jar jenkins-cli.jar get-node node-name.
A list of all CLI commands available in a given Jenkins installation can be found at https://<jenkins-host>/cli/.
If you want to fetch information not available via the provided CLI commands, the standard way to do so is the Script Console, which enables you to write Groovy to access the Jenkins APIs. This functionality is also exposed through the CLI via the groovy command.

Deploy the app on Google App Engine

I am following this tutorial to see how Google App Engine (Java) works. I was able to successfully build the app:
cd appengine-try-java-master
mvn clean install
The issues happens at the last (deployment) stage on Windows. The tutorial says that it's necessary to run this command (the number 1111 is not the original one due to security reasons):
appcfg.cmd -A master-scanner-1111 update target\appengine-try-java-1.0
I opened cmd and pasted this command. The following message appears:
appcfg.cmd is not recognized...
Then I executed just update target\appengine-try-java-1.0, however this did not deploy the app.
The problem is that in the previous steps they give you instructions to download the Google App Engine SDK, but this is just a package of directories and not an installer (much like how java is packaged). The appcfg.cmd exists within that set of directories, so the user will need to add the "bin" folder in that package to their path (or, as suggested, use the full path in the command). The Google documentation is not specific enough for a person just starting out IMHO. I had the same problem.

Running Jspresso Human Resources sample application

I have downloaded Jspresso Human Resource sample appplication from here:
http://www.jspresso.org/page/jspresso-download-area
I don't know about Jspresso framework. I just want to run this downloaded Human Resource Sample application and see how it works. But from the downloaded content I don't know how to make it run. It would be nice if I can run it from command prompt because later I want to profile the application with Java profiler (the profiler I use is command line tool). I already have JDK and Tomcat installed.
Does somebody know how to run this Human Resource sample application from Jspresso?
I found how to install and make it run here:
http://www.jspresso.org/page/jspresso-10-minutes

appengine-mapper library and 1.6.6 appengine-api-labs.jar conflicting

I'm trying to use the java appengine mapreduce library (here: http://code.google.com/p/appengine-mapreduce/) but it seems to be conflicting with a half implementation of mapreduce in the labs jar of the 1.6.6 appengine SDK.
I simply created a new web application project in eclipse, followed the directions at the link above to add mapper.jar to my project and tested whether I could goto localhost:8888/mapreduce/status. It throws an exception because its trying to use the mapreduce functionality from the labs jar which isn't fully implemented.
How do I force eclipse to use the mapper.jar? I've already listed it first in the the build path.
You should be able to safely remove the api-labs.jar. You're seeing a conflict with, for want of a better phrase, something that escaped into the wild prematurely.
Sorry about that.

Categories

Resources