Documentation
WebsiteMineGitHubFaucet
  • Welcome to MakeOS
  • Introduction
    • Install
    • Quick Start
    • Set Up a Private Network
    • Get Test Coins
    • Track a Repository
    • What is MakeOS
    • How it Works
    • Tokenomics ($MAKE)
    • Dilithium (Deprecated)
    • Roadmap
    • Team
  • Concepts
    • Repository
      • Register a Repository
      • Initialize a New Repository
      • Repository Governance
      • Access Control Config
    • Namespace
    • Key
    • Issue Management
    • Merge Request
    • Transactions
      • Register a Repository
      • Send Coins
    • Validator
    • Host
    • Remote
  • JavaScript Console API
    • repo
    • pushkey
    • namespace
    • node
    • user
    • transaction
    • ticket
  • KIT CLI Reference
    • Overview
    • init
    • start
    • console
    • attach
    • key
      • create
      • gen
      • get
      • import
      • list
      • update
    • tx
      • get
    • repo
      • config
      • create
      • hook
      • init
      • vote
    • user
      • send
    • pk
      • register
    • sign
      • commit
      • note
      • tag
    • contributor
      • add
    • issue
      • close
      • create
      • list
      • read
      • reopen
      • status
    • mr
      • checkout
      • close
      • create
      • fetch
      • list
      • read
      • reopen
      • status
Powered by GitBook
On this page
  • getBlock
  • Parameters
  • Returns
  • Example
  • getHeight
  • Returns
  • Example
  • getBlockInfo
  • Parameters
  • Returns
  • Example
  • getValidators
  • Parameters
  • Returns
  • Example
  • isSyncing
  • Returns
  • Example

Was this helpful?

  1. JavaScript Console API

node

PreviousnamespaceNextuser

Last updated 4 years ago

Was this helpful?

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

Example

node.getBlock(101)

getHeight

node.getHeight()

Get the current height of the blockchain.

Returns

String - The height of the node.

Example

node.getHeight()
"123"

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)
{
    "appHash": "taKg/qP1ER5I4kI6Kw9es1aWNZtYklVh1WhhMJm5LLw=",
    "hash": "Id6OEYekHgLNiT7ZEGibbkVJZnMREgUUnRxWoLM1pPc=",
    "height": "101",
    "lastAppHash": "0dmLRT0oSfxQroggDk/2hnGDDGwU+CX4iH/nhPPX1i8=",
    "proposerAddress": "3PSYFHDDgGUTdOrG+1DY5aX92B4=",
    "time": "1597666979"
}

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)
[
    {
        "address": "os1858effdlfecl30hgq0dvpesygp2daf97malemz",
        "publicKey": "48gS3kCMVTJjHvJBwuQXXAFwYgJiATE7xJY34UuAJVbuHDoEZ2V",
        "ticketId": "0x",
        "tmAddress": "DCF4981470C380651374EAC6FB50D8E5A5FDD81E"
    }
]

isSyncing

node.isSyncing()

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

Returns

Boolean

Example

node.isSyncing()
true
Tendermint Block