Coder Social home page Coder Social logo

opensource-cdrone / fabric-sdk-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyperledger/fabric-sdk-java

0.0 2.0 0.0 104 KB

Read-only mirror of https://gerrit.hyperledger.org/r/#/admin/projects/fabric-sdk-java

Home Page: https://hyperledger.org

License: Apache License 2.0

Java 86.94% Protocol Buffer 13.06%

fabric-sdk-java's Introduction

Java SDK for Hyperledger Fabric

Welcome to Java SDK for Hyperledger project. This is a summary of steps required to get you started with building and using the Java SDK. Please note that this is not the API documentation or a tutorial for the SDK, this will only help you familiarize to get started with the SDK if you are new in this domain.

Compiling

To build this project, following dependencies must be met

  • JDK 1.8 or above
  • Apache Maven

Once your JAVA_HOME points to your installation of JDK 1.8 (or above) and JAVA_HOME/bin and Apache maven are in your PATH, issue the following command to build the jar file: mvn install or mvn install -DskipTests if you don't want to run the unit tests

Running the unit tests

To run the unit tests, please use mvn test or mvn install which will run the unit tests and build the jar file. You must be running a local instance of membersrvcs and a peer to be able to run the unit tests. Please follow the instructions here to setup the development environment.

Using the SDK

To use the SDK in your code, simply add the generated JAR file in your classpath. Once the JAR file is in your classpath, create a chain instance to interact with the network.
Chain testChain = new Chain("chain1");

Add the membership service:
testChain.setMemberServicesUrl("grpc://localhost:7054", null);

Set a keyValueStore:
testChain.setKeyValStore(new FileKeyValStore(System.getProperty("user.home")+"/test.properties"));

Add a peer to the chain:
testChain.addPeer("grpc://localhost:7051", null);

Get a member:
Member registrar = testChain.getMember("admin");

Enroll a member:
Member member = testChain.enroll("user", "secret");

SDK dependencies

SDK depends on few third party libraries that must be included in your classpath when using the JAR file. To get a list of dependencies, refer to pom.xml file or run mvn dependency:tree or mvn dependency:list.

Alternatively, mvn dependency:analyze-report will produce a report in HTML format in target directory listing all the dependencies in a more readable format.

fabric-sdk-java's People

Contributors

malik-altaf avatar ryjones avatar psaradhi avatar

Watchers

James Cloos avatar rajpal avatar

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.