This package has been deprecated

Author message:

Please use @arcblock/forge-sdk instead

@arcblock/forge-node

0.4.0 • Public • Published

@arcblock/forge-node

build status code coverage styled with prettier license

Node.js SDK for Forge Framework by ArcBlock

Table of Contents

Install

npm install @arcblock/forge-node
// or
yarn add @arcblock/forge-node

Usage

0. Make sure you get forge installed

This step is required

1. Prepare Example App

Checkout our examples folder

2. Call Rpc

const { RpcClient, parseConfig } = require('@arcblock/forge-node');

const client = new RpcClient(parseConfig('./forge.toml'));
(async () => {
  // fetch forge change info
  const { info } = await client.getChainInfo();
  console.log('chainInfo', info);

  // get block info
  const stream = client.getBlock({ height: 11 });
  stream
    .on('data', function({ block }) {
      console.log('blockInfo:', block);
    })
    .on('error', err => {
      console.error('error', err);
    });
})();

Documentation

For complete API documentation please refer API.md

Contributors

Name Website
wangshijun https://ocap.arcblock.io

License

MIT © wangshijun

/@arcblock/forge-node/

    Package Sidebar

    Install

    npm i @arcblock/forge-node

    Weekly Downloads

    3

    Version

    0.4.0

    License

    MIT

    Unpacked Size

    30.9 kB

    Total Files

    10

    Last publish

    Collaborators

    • gxw
    • mave99a
    • polunzh
    • wangshijun