npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@siglesiasg/node-red-hyperledger-fabric-gateway

v1.0.4

Published

Hyperledger Fabric 2.x nodes for node-red with latest fabric-gateway library

Downloads

30

Readme

Hyperledger Fabric Gateway for Node Red

A Hyperledger Fabric Gateway for Node Red 3.x implementation nodes to work with recent HLF networks v2.4 (or later)

Donate

Overview

Built in Typescript, this package aims to provide an easy to use and up-to-date set of Node Red nodes that enable seamless integration with Hyperledger Fabric blockchain networks.

Developers can leverage the power of the Hyperledger Fabric programming model to rapidly build blockchain-connected applications using Node Red.

Key features

  • Simple, intuitive Nodes for working with Hyperledger Fabric
  • Actively maintained and updated for latest Fabric releases
  • Built on top of Node.js Fabric Gateway library for enhanced compatibility
  • Designed for smooth integration into your Node Red workflows

Compatibility

This Nodes are based on fabric gateway and requires Fabric v2.4 (or later) with a Gateway enabled Peer. Additional compatibility information is available in the documentation:

  • https://hyperledger.github.io/fabric-gateway/

  • https://github.com/hyperledger/fabric-gateway/

Getting Started

To use this Node-RED package, you first need to configure a connection to your Hyperledger Fabric network.

Create a new connection

A connection requires specifying:

  • Gateway - The gateway URL and options to connect to your Fabric network
  • Identity - The credentials to authenticate with the network
  • Channel - The channel name to interact with

This connection information can then be leveraged in a modular way across nodes that need to interact with the Fabric network.

Basic Connection

Gateway

Gateway needs a peer definition. This peer will be used to execute all requests to HLF.

TODO: Enable selection multiple peers to get complex transaction request.

GW

Peer

To connect to a Hyperledger Fabric peer, you will need to specify the following configuration:

  • Peer URL - The URL of the peer is required to connect to it.
  • TLS Cert in Base64 - The TLS certificate is required if the peer connection is using TLS. Provide the PEM encoded certificate as a base 64 string.
  • gRPC Options - Additional gRPC options can be provided as an object:
{
    "grpc.default_authority": "testpeer.com:9999",
    "grpc.ssl_target_name_override": "testpeer.com"
}

Refer to the gRPC documentation for full options.

Peer

Identity

An identity can be configured in three different ways using the Cert Type parameter:

  • Embedded - Identity credentials are provided in base64 and stored as credentials in Node-RED. Private Key and Cert fields must be provided.

  • Filesystem - Identity credentials are read from a local file:

    • Legacy Key/Cert Identity - Certificate and Key file paths must be provided in PEM format.

    • Fabric Operations Console Identity - The identity is loaded from a single JSON file containing the certificate and private key embedded as base64 strings. This matches the format used by Hyperledger Fabric Operations Console:

    {
      "name": "admin",  
      "cert": "LS0tL......",
      "private_key": "LS0tl...."
    }
  • Microfab - The identity is loaded remotely using the Microfab management REST API. This requires configuring the Microfab host and specifying the ID of the identity.

Channel

Node to configure the channel name

Channel

Once the connection nodes are configured properly, you can operate with HLF using Hyperledger Gateway nodes.

Transaction Nodes

Transaction Nodes

These nodes work in the same way as HLF's own operations. Configuration can be added to the node or passed as parameters in payload object.

Event Nodes

Event Nodes

Block listener node reads all block events and publishes a message for each block and transaction processed. To prevent saturation of the JavaScript event loop, each message must be acknowledged. If the node restarts, it will resume reading from the last checkpoint.

Block Listener Nodes

Block listener commit node will mark the message as done so next message event will be published. No Configuration needed

Channel Nodes

Channel Nodes

Provide information about the selected channel.

  • Channel Info query the ledger and return the channel info: Last block and it's hash

  • Get Blockquery the ledger and return the block based on:

    • By Number will recover a block by it's number. Must be a number

    • By Hash will recover a block by it's hash

    • By TxId will recover a block by any of it's transaction id

Donate

Do you like my work? Buy me a coffee - or pizza 😜🍕

Donate

License

Source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the [LICENSE] file.