File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
ironfish-cli/src/commands/chain Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 4
4
import { FileUtils } from '@ironfish/sdk'
5
5
import { Args , Flags } from '@oclif/core'
6
6
import { IronfishCommand } from '../../command'
7
+ import { ColorFlag , ColorFlagKey } from '../../flags'
7
8
8
9
export default class Power extends IronfishCommand {
9
10
static description = "show the network's mining power"
11
+ static enableJsonFlag = true
10
12
11
13
static flags = {
14
+ [ ColorFlagKey ] : ColorFlag ,
12
15
history : Flags . integer ( {
13
16
required : false ,
14
17
description :
@@ -23,14 +26,13 @@ export default class Power extends IronfishCommand {
23
26
} ) ,
24
27
}
25
28
26
- async start ( ) : Promise < void > {
29
+ async start ( ) : Promise < unknown > {
27
30
const { flags, args } = await this . parse ( Power )
28
- const { block } = args
29
31
30
32
const client = await this . connectRpc ( )
31
33
32
34
const data = await client . chain . getNetworkHashPower ( {
33
- sequence : block ,
35
+ sequence : args . block ,
34
36
blocks : flags . history ,
35
37
} )
36
38
@@ -39,5 +41,7 @@ export default class Power extends IronfishCommand {
39
41
this . log (
40
42
`The network power for block ${ data . content . sequence } was ${ formattedHashesPerSecond } averaged over ${ data . content . blocks } previous blocks.` ,
41
43
)
44
+
45
+ return data . content
42
46
}
43
47
}
You can’t perform that action at this time.
0 commit comments