UNPKG

@titan-suite/cli

Version:

The complete smart contract development tool

31 lines (30 loc) 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const command_1 = require("@oclif/command"); const utils_1 = require("../utils"); class Networks extends command_1.Command { run() { return tslib_1.__awaiter(this, void 0, void 0, function* () { const { flags } = this.parse(Networks); const config = utils_1.getConfig(); const selectedBlockchain = flags.blockchain ? flags.blockchain : config.defaultBlockchain; const { networks } = config.blockchains[`${selectedBlockchain}`]; Object.keys(networks).forEach((network) => { this.log(`[${network}] ${networks[network].host}`); }); }); } } Networks.description = 'List all networks specified in the Titan config file'; Networks.examples = ['$ titan networks']; Networks.flags = { help: command_1.flags.help({ char: 'h' }), blockchain: command_1.flags.string({ char: 'b', description: 'the specified networks for a particular blockchain' }) }; exports.default = Networks;