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

@hyperledger/cactus-plugin-ledger-connector-cdl

v2.0.0-rc.2

Published

Allows Cacti nodes to connect to Fujitsu CDL.

Downloads

255

Readme

@hyperledger/cactus-plugin-ledger-connector-cdl

This plugin provides Cacti a way to interact with Fujitsu CDL networks. Using this you can:

  • Register new data trail.
  • Get events.
  • Search for events using header / global data fields as a query.

Summary

Getting Started

Clone the git repository on your local machine. Follow these instructions that will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

In the root of the project to install the dependencies execute the command:

npm run configure

Usage

To use this plugin, import public-api, create new PluginLedgerConnectorCDL and initialize it.

const connector = new PluginLedgerConnectorCDL({
  instanceId: uuidV4(),
  logLevel,
  cdlApiGateway: {
    url: cdlUrl,
  },
  cdlApiSubscriptionGateway: {
    url: cdlSubscriptionUrl,
  },
});

// Register endpoints
await connector.getOrCreateWebServices();
await connector.registerWebServices(expressApp);

Configuration

Connector Setup

  • logLevel - connector log level
  • cdlApiGateway - configuration of regular CDL endpoint (use it if you want to use access token to authenticate)
  • cdlApiSubscriptionGateway - configuration of CDL endpoint for applications (use it if you want to use subscriptionId to authenticate).

Gateway Setup

  • url: Gateway URL
  • userAgent: Value of User-Agent header sent to CDL (to identify this client).
  • skipCertCheck: Set to true to ignore self-signed and other rejected certificates.
  • caPath: CA of CDL API gateway server in PEM format to use.
  • serverName: Overwrite server name from cdlApiGateway.url to match one specified in CA.

Connector Methods

  • Connector can be used directly through it's public methods.

Methods

async registerHistoryData(args: RegisterHistoryDataRequestV1): Promise<RegisterHistoryDataV1Response>
async getLineage(args: GetLineageRequestV1): Promise<GetLineageResponseV1>
async searchLineageByHeader(args: SearchLineageRequestV1): Promise<SearchLineageResponseV1>
async searchLineageByGlobalData(args: SearchLineageRequestV1): Promise<SearchLineageResponseV1>

ApiClient

All connector API endpoints are defined in open-api specification. See DefaultApi for up-to-date listing of supported endpoints.

REST Functions

  • registerHistoryDataV1
  • getLineageV1
  • searchLineageByHeaderV1
  • searchLineageByGlobalDataV1

Running the tests

To check that all has been installed correctly and that the plugin has no errors run jest test suites.

  • Run this command at the project's root:
npx jest cactus-plugin-ledger-connector-cdl

Manual Tests

  • There are no automatic tests for this plugin because there's no private instance of CDL available at a time.
  • ./src/test/typescript/manual/cdl-connector-manual.test.ts contains a Jest test script that will check every implemented operation on a running CDL service.
  • You need access to a running instance of CDL in order to run this script.
    • You can check https://en-portal.research.global.fujitsu.com/ for free test access to a service.
    • Please note that rate limiting set on a service may cause some tests to fail.
  • Before running the script you must update the following variables in it:
    • authInfo - either accessToken or subscriptionKey based configuration.
    • cdlUrl / cdlSubscriptionUrl - URL to CDL service (only base path)
  • Script can be used as a quick reference for using this connector plugin.
  • Since script is not part of project jest suite, to run in execute the following commands from a package dir:
    • npx tsc
    • npx jest dist/lib/test/typescript/manual/cdl-connector-manual.test.js

Building/running the container image locally

In the Cactus project root say:

DOCKER_BUILDKIT=1 docker build -f ./packages/cactus-plugin-ledger-connector-cdl/Dockerfile . -t CDL_connector

Build with a specific version of the npm package:

DOCKER_BUILDKIT=1 docker build --build-arg NPM_PKG_VERSION=0.4.1 -f ./packages/cactus-plugin-ledger-connector-cdl/Dockerfile . -t CDL_connector

Contributing

We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do!

Please review CONTIRBUTING.md to get started.

License

This distribution is published under the Apache License Version 2.0 found in the LICENSE file.

Acknowledgments