node

This module allows you to get information about the node and blockchain. It can be accessed from the global variable node.

getBlock

node.getBlock(height)

Get a tendermint block at the given height.

Parameters

  1. height - String|Number: The target block height

Returns

Tendermint Block

Example

node.getBlock(101)

getHeight

node.getHeight()

Get the current height of the blockchain.

Returns

String - The height of the node.

Example

node.getHeight()

getBlockInfo

node.getBlockInfo(height)

Get a summary block at the given height. This block information is indexed by MakeOS (not Tendermint).

Parameters

  1. height - String|Number: The target block height

Returns

String - The height of the node.

Example

node.getBlockInfo(101)

getValidators

node.getValidators(height)

Get a list of validators that processed a given block.

Parameters

  1. height - String|Number: The target block height whose validators will be returned.

Returns

Object - The result object

Example

node.getValidators(101)

isSyncing

node.isSyncing()

Checks whether the node is currently synchronizing blocks and state with peers.

Returns

Boolean

Example

node.isSyncing()

Last updated