tomoscan-healthcheck
v1.0.3
Published
get healthcheck data of TomoScan
Downloads
5
Readme
TomoScan HealthCheck
- Install
npm i --save tomoscan-healthcheck
- Usage
const {
getHealthCheckData,
OK,
ERROR
} = require('tomoscan-healthcheck')
const main = async () => {
// call getHealthCheckData with parameter: tomoscanEndpoint,
// example: https://tomoscan.io
// default https://tomoscan.io
let data = await getHealthCheckData(process.env.TOMOSCAN_ENDPOINT)
}
Sample responses
[
{ module: 'api', status: 0 },
{ module: 'block', status: 0 },
{ module: 'transaction', status: 0 },
{ module: 'internalTx', status: 0 },
{ module: 'epoch', status: 0 },
{ module: 'tokenTransfer', status: 0 }
]
[
{ module: 'api', status: 0 },
{
module: 'block',
status: -1,
error: 'No new block since 11:15:54 AM'
},
{ module: 'transaction', status: 0 },
{ module: 'internalTx', status: 0 },
{ module: 'epoch', status: 0 },
{ module: 'tokenTransfer', status: 0 }
]