@energyweb/ddhub-client
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Green Proof DDHub client

Used to communicate with Energyweb DDHUB messaging server

Installation

yarn add @energyweb/greenproof-ddhub-client

Example

const client = new DDHubClient({
    config: [
      {
        channelName: 'receive_input',
        channelType: 'sub',
        conditions: { roles: ['provider.roles.247.apps.energyweb.iam.ewc'], dids: [] },
        encrypted: true,
        topicName: 'data_provider',
        topicVersion: '1.0.0',
      },
      {
        channelName: 'send_results',
        channelType: 'upload',
        conditions: { roles: ['cache.roles.247.apps.energyweb.iam.ewc'], dids: [] },
        encrypted: true,
        topicName: 'result_provider',
        topicVersion: '1.0.0',
      },
    ],
    ownerNamespace: '247.apps.energyweb.iam.ewc',
    privateKey: 'fd055324f73...2ea45bc8114839e0703e185d',
    ddhubUrl: 'https://client-gateway.energyweb.org/api/v2/',
  });

  await client.setup();

  const [message] = await client.getMessages({
    fqcn: 'receive_input',
    amount: 1
  })

  const result = await someLogic(message);

  await client.sendMessage({
    fqcn: 'send_results',
    payload: JSON.stringify(result),
    transactionId: '1'
  })

Questions and Support

For questions and support please use Energy Web's Discord channel

Or reach out to us via email: 247enquiries@energyweb.org

EW-DOS

The Energy Web Decentralized Operating System is a blockchain-based, multi-layer digital infrastructure.

The purpose of EW-DOS is to develop and deploy an open and decentralized digital operating system for the energy sector in support of a low-carbon, customer-centric energy future.

We develop blockchain technology, full-stack applications and middleware packages that facilitate participation of Distributed Energy Resources on the grid and create open market places for transparent and efficient renewable energy trading.

  • To learn about more about the EW-DOS tech stack, see our documentation.

  • For an overview of the energy-sector challenges our use cases address, go here.

For a deep-dive into the motivation and methodology behind our technical solutions, we encourage you to read our White Papers:

Connect with Energy Web

Readme

Keywords

none

Package Sidebar

Install

npm i @energyweb/ddhub-client

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

192 kB

Total Files

59

Last publish

Collaborators

  • energywebdev
  • aznagy
  • bagaric
  • pkosin
  • drgorb
  • kroy
  • manihagh