salma sultana

Logo

Former End User Consultant, Current Software Developer, and a Master's degree holder in Data Science and Engineering.

View My GitHub Profile

Getting information of a block, specified via it’s block height

Code

"use strict"

const { NodeClient } = require("bclient")
const { Network } = require("../bcoin")
const network = Network.get("main")

const blockHeight = "406267"

const clientOptions = {
  network: network.type,
  port: network.rpcPort,
  apiKey: "api-key",
}

const client = new NodeClient(clientOptions)
;(async () => {
  const blockByHeight = await client.getBlock(blockHeight)
  console.log("By height: \n", blockByHeight)
})()


Get information of unspent transaction outputs –>

back