GithubHelp home page GithubHelp logo

shiva953 / fabric-gateway Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyperledger/fabric-gateway

0.0 0.0 0.0 2.48 MB

Go, Node and Java client API for Hyperledger Fabric v2.4+

Home Page: https://hyperledger.github.io/fabric-gateway/

License: Apache License 2.0

Shell 0.30% JavaScript 0.52% Java 36.87% Go 29.33% TypeScript 29.12% Makefile 0.66% Gherkin 3.19%

fabric-gateway's Introduction

Hyperledger Fabric Gateway

For information on using the Fabric Gateway, including client API documentation, please visit the Fabric Gateway documentation.

For information on reporting issues, suggesting enhancements and contributing code, please review the contributing guide.

Overview

The original proposal is described in the Fabric Gateway RFC. Adding a gateway component to the Fabric peer provides a single entry point to a Fabric network, and removes much of the transaction submission logic from the client application.

The Gateway component in the Fabric Peer exposes a simple gRPC interface to client applications and manages the lifecycle of transaction invocation on behalf of the client. This minimises the network traffic passing between the client and the blockchain network, as well as minimising the number of network ports that need to be opened.

See the gateway.proto file for details of the gRPC interface.

Building and testing

Install pre-reqs

This repository comprises three functionally equivalent client APIs, written in Go, Typescript, and Java. In order to build these components, the following need to be installed and available in the PATH:

In order to run any of the Hardware Security Module (HSM) tests, SoftHSM v2 is required. This can either be:

  • installed using the package manager for your host system:
    • Ubuntu: sudo apt install softhsm2
    • macOS: brew install softhsm
    • Windows: unsupported
  • or compiled and installed from source, following the SoftHSM2 install instructions
    • It is recommended to use the --disable-gost option unless you need gost algorithm support for the Russian market, since it requires additional libraries.

Build using make

Note: When the repository is first cloned, some mock implementations used for testing will not be present and the Go code will show compile errors. These will be generated when the unit-test target is run, or can be generated explicitly by running make generate.

The following Makefile targets are available:

  • make generate - generate mock implementations used by unit tests
  • make lint - run linting checks for the Go code
  • make unit-test-go - run unit tests for the Go client API, excluding HSM tests
  • make unit-test-go-pkcs11 - run unit tests for the Go client API, including HSM tests
  • make unit-test-node - run unit tests for the Node client API
  • make unit-test-java - run unit tests for the Java client API
  • make unit-test - run unit tests for all client language implementations
  • make pull-latest-peer - fetch the latest peer docker image containing the gateway server
  • make scenario-test-go - run the scenario (end to end integration) tests for Go client API, including HSM tests
  • make scenario-test-go-no-hsm - run the scenario (end to end integration) tests for Go client API, excluding HSM tests
  • make scenario-test-node - run the scenario tests for Node client API, including HSM tests
  • make scenario-test-node-no-hsm - run the scenario tests for Node client API, excluding HSM tests
  • make scenario-test-java - run the scenario tests for Java client API
  • make scenario-test - run the scenario tests for all client language implementations
  • make scenario-test-no-hsm - run the scenario tests for all client language implementations, excluding HSM tests
  • make shellcheck - check for script errors
  • make test - run all tests

Scenario tests

The scenario tests create a Fabric network comprising two orgs (one peer in each org) and a single gateway within a set of docker containers. The clients connect to the gateway to submit transactions and query the ledger state.

The tests are defined as feature files using the Cucumber BDD framework. The same set of feature files is used across all three client language implementations to ensure consistency of behaviour.

fabric-gateway's People

Contributors

bestbeforetoday avatar andrew-coleman avatar jt-nti avatar sapthasurendran avatar denyeart avatar davidkel avatar lindluni avatar davidkhala avatar kemi04 avatar luigieai avatar ppoffice avatar ryjones avatar vishwas031 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.