Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (22 sloc) 707 Bytes
import { cli } from 'cli-ux'
import { BaseCommand } from '../../base'
export default class ValidatorGroupList extends BaseCommand {
static description = 'List existing Validator Groups'
static flags = {
...BaseCommand.flags,
}
static examples = ['list']
async run() {
this.parse(ValidatorGroupList)
cli.action.start('Fetching Validator Groups')
const validators = await this.kit.contracts.getValidators()
const vgroups = await validators.getRegisteredValidatorGroups()
cli.action.stop()
cli.table(vgroups, {
address: {},
name: {},
commission: { get: (r) => r.commission.toFixed() },
members: { get: (r) => r.members.length },
})
}
}
You can’t perform that action at this time.