UNPKG

secret-polar

Version:

Polar is a development environment to compile, deploy, test, run scrt contracts on different networks.

21 lines (20 loc) 923 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const config_env_1 = require("../internal/core/config/config-env"); const client_1 = require("../lib/client"); const task_names_1 = require("./task-names"); function default_1() { (0, config_env_1.task)(task_names_1.TASK_NODE_INFO, "Prints node info and status") .setAction(nodeInfo); } exports.default = default_1; async function nodeInfo(_taskArgs, env) { const client = (0, client_1.getClient)(env.network); console.log("Network:", env.network.name); console.log("ChainId:", env.network.config.chainId); console.log("Block height:", await client.query.tendermint.getLatestBlock({})); const nodeInfo = await client.query.tendermint.getNodeInfo({}) // eslint-disable-next-line .catch((err) => { throw new Error(`Could not fetch node info: ${err}`); }); console.log('Node Info: ', nodeInfo); }