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

getBlock

1
node.getBlock(height)
Copied!
Get a tendermint block at the given height.

Parameters

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

Returns

Example

1
node.getBlock(101)
Copied!

getHeight

1
node.getHeight()
Copied!
Get the current height of the blockchain.

Returns

String - The height of the node.

Example

JavaScript
Output
1
node.getHeight()
Copied!
1
"123"
Copied!

getBlockInfo

1
node.getBlockInfo(height)
Copied!
Get a summary block at the given height. This block information is indexed by MakeOS (not Tendermint).

Parameters

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

Returns

String - The height of the node.

Example

JavaScript
Output
1
node.getBlockInfo(101)
Copied!
1
{
2
"appHash": "taKg/qP1ER5I4kI6Kw9es1aWNZtYklVh1WhhMJm5LLw=",
3
"hash": "Id6OEYekHgLNiT7ZEGibbkVJZnMREgUUnRxWoLM1pPc=",
4
"height": "101",
5
"lastAppHash": "0dmLRT0oSfxQroggDk/2hnGDDGwU+CX4iH/nhPPX1i8=",
6
"proposerAddress": "3PSYFHDDgGUTdOrG+1DY5aX92B4=",
7
"time": "1597666979"
8
}
Copied!

getValidators

1
node.getValidators(height)
Copied!
Get a list of validators that processed a given block.

Parameters

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

Returns

Object - The result object

Example

JavaScript
Output
1
node.getValidators(101)
Copied!
1
[
2
{
3
"address": "os1858effdlfecl30hgq0dvpesygp2daf97malemz",
4
"publicKey": "48gS3kCMVTJjHvJBwuQXXAFwYgJiATE7xJY34UuAJVbuHDoEZ2V",
5
"ticketId": "0x",
6
"tmAddress": "DCF4981470C380651374EAC6FB50D8E5A5FDD81E"
7
}
8
]
Copied!

isSyncing

1
node.isSyncing()
Copied!
Checks whether the node is currently synchronizing blocks and state with peers.

Returns

Boolean

Example

JavaScript
Output
1
node.isSyncing()
Copied!
1
true
Copied!
Last modified 1yr ago