NodeCalls
In DEMOS, a NodeCall is a request that reads the blockchain state. NodeCall methods on the WebSDK are denoted by the “get” prefix. eg.getLastBlockNumber
In DEMOS, a NodeCall is a request that reads the blockchain state. NodeCall methods on the WebSDK are denoted by the “get” prefix. eg. `getLastBlockNu…
getLastBlockNumber
const blockNo = await demos.getLastBlockNumber()
console.log("Last block No: ", blockNo)
const latestBlockHash = await demos.getLastBlockHash();
console.log("Latest block hash:", latestBlockHash);
const blockNumber = 1000;
const blockData = await demos.getBlockByNumber(blockNumber);
console.log("Block data:", blockData);
const blockHash = "0x1234...";
const blockData = await demos.getBlockByHash(blockHash);
console.log("Block data:", blockData);
const txHash = "0xabcd...";
const txData = await demos.getTxByHash(txHash);
console.log("Transaction data:", txData);
const allTransactions = await demos.getAllTxs();
console.log("All transactions:", allTransactions);
const address = "0x1234...";
const addressInfo = await demos.getAddressInfo(address);
console.log("Address info:", addressInfo);
const peerIdentity = await demos.getPeerIdentity();
console.log("Peer identity:", peerIdentity);
const peerList = await demos.getPeerlist();
console.log("Peer list:", peerList);
const mempool = await demos.getMempool();
console.log("Mempool:", mempool);