Socket
Book a DemoInstallSign in
Socket

lisk-plugin-health

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lisk-plugin-health

Lightweight plugin for Lisk health check

latest
npmnpm
Version
1.0.6
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Lisk Plugin Health

npm

Installation

npm install lisk-plugin-health
# or
yarn add lisk-plugin-health

Getting started

// src/application/index.js

import { HealthPlugin } from 'lisk-plugin-health';

app.registerPlugin(HealthPlugin);

Usage

To check the health of the app, just run.

// Use the params as configured, see below
const isHealthy = await this._client.invoke('health:isHealthy');
// or set a custom delay (default is 12000)
const isHealthy = await this._client.invoke('health:isHealthy', {
  delayUntilUnhealthy: 15000,
});

It will return 0 if the app is healthy, 1 if there is an issue

Configuration

The app is considered healthy if it registered a block recently. You can configure the delay before the app is considered unhealthy. The unit is milliseconds.

// src/application/index.js

const appConfig = utils.objects.mergeDeep({}, configDevnet, {
  plugins:  {
    health: {
      delayUntilUnhealthy: 15000 // default 12000
    }
  },
});

const app = Application.defaultApplication(genesisBlockDevnet, appConfig); 

Keywords

lisk

FAQs

Package last updated on 24 Apr 2021

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