百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

fabric-gateway

> 编程语言
开源

适用于 Hyperledger Fabric v2.4+ 的 Go、Node 和 Java 客户端 API

193 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

适用于 Hyperledger Fabric v2.4+ 的 Go、Node 和 Java 客户端 API

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 proto definitions 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:

  • Go 1.26+
  • Node 18+
  • Java 11+
  • Docker
  • Make
  • Maven
  • ShellCheck (for linting shell scripts)
  • Python 3 (for building documentation site content)

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
  • or compiled and installed from source.

Dev Container

This project includes a Dev Container configuration that includes all of the pre-requisite software described above in a Docker container, avoiding the need to install them locally. The only requirement is that Docker (or compliant alternative) is installed and available.

Opening the project folder in an IDE such as VS Code (with the Dev Containers extension) should offer the option of opening in the Dev Container. Alternatively, VS Code allows the remote repository to be opened directly in an isolated Dev Container.

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 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
  • make format - fix all code formatting
  • make generate-docs - generate documentation site content
  • make serve-docs - serve the documentation site content on a local development server
  • make generate-docs-node - generate Node API documentation
  • make generate-docs-java - generate Java API documentation
  • make clean - remove all generated content

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.

Documentation

The documentation site is built using Material for MkDocs. Documentation build configuration is in mkdocs.yml, and the site content is in the docs folder.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javablockchaingogolanghacktoberfest

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言