Former End User Consultant, Current Software Developer, and a Master's degree holder in Data Science and Engineering.
"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)
})()