hsqlu / demux-js-iost

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

demux-js-iost Build Status

Demux Action Reader implementations to read block and action data from IOST-based blockchains.

Installation

# Using yarn
yarn add demux-js-iost

# Using npm
npm install demux-js-iost --save

Example

Makes requests directly to a specified Node API endpoint to obtain block data.

const { IostActionReader } = require("demux-js-iost");
const { BaseActionWatcher } = require("demux-js-iost");
const IostActionHandler = require("./IostActionHandler");
const handlerVersion = require("./handlerVersions/v1");

const actionHandler = new IostActionHandler([handlerVersion]);

const actionReader = new IostActionReader({
  startAtBlock: 0,
  onlyIrreversible: false,
  iostEndpoint: "https://api.iost.io",
});

const actionWatcher = new BaseActionWatcher(actionReader, actionHandler, 250);

actionWatcher.watch();

About


Languages

Language:TypeScript 73.7%Language:JavaScript 26.3%