New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@concordium/node-sdk

Package Overview
Dependencies
Maintainers
6
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@concordium/node-sdk

Helpers for interacting with the Concordium node

  • 7.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
242
increased by36.72%
Maintainers
6
Weekly downloads
 
Created
Source

Concordium Nodejs SDK

Contributor Covenant

Wrappers for interacting with the Concordium node, using nodejs.

Note that this package contains and exports the functions from the common-sdk, check the readme of that package for an overview of those.

Table of Contents

ConcordiumNodeClient

The SDK provides a gRPC client, which can interact with the Concordium Node

For an overview of the endpoints, check here.

To create a client, the function createConcordiumClient can be used. It requires the address and port of the node. It also requires credentials to be specified. These can be used for create either an insecure connection or a TLS connection. In the following example the credentials are created for a TLS connection:

import { credentials } from '@grpc/grpc-js/';
import { createConcordiumClient } from '@concordium/node-sdk';
...
return createConcordiumClient(
    address,
    port,
    credentials.createSsl(),
    { timeout: 15000 }
);

The fourth argument is additional options. In the example above we sat the timeout for a call to the node to 15 seconds. The options allowed here are those allowed by the grpc-transport.

The connection to a node can be either an insecure connection or a TLS connection. Note that the node that you are trying to connect to must support TLS, for a TLS connection to work. Otherwise an insecure connection can be created by using credentials.createInsecure() instead.

To see the documentation for the deprecated v1 client, check here. For an overview of how to migrate from the v1 client to the v2 client, check here.

Build

Building for a release

To build the package run

yarn build

Note that the dependent packages must already have been built. To easily do this, build from the package root instead.

Publishing a release

Before publishing a new release it is essential that it has been built first. So make sure that you have just built the up-to-date code you want to publish. To publish the release run

yarn npm publish

and step through the steps presented to you.

Test

An automatic test suite is part of this project, and it is run by executing:

yarn test

Note that the tests require a locally running concordium-node on the testnet. Otherwise the tests will fail.

FAQs

Package last updated on 16 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc