@@ -12,14 +12,16 @@ import {
12
12
import { Flags } from '@oclif/core'
13
13
import blessed from 'blessed'
14
14
import { IronfishCommand } from '../command'
15
- import { RemoteFlags } from '../flags'
15
+ import { JsonFlags , RemoteFlags } from '../flags'
16
16
import * as ui from '../ui'
17
17
18
18
export default class Status extends IronfishCommand {
19
19
static description = "show the node's status"
20
+ static enableJsonFlag = true
20
21
21
22
static flags = {
22
23
...RemoteFlags ,
24
+ ...JsonFlags ,
23
25
follow : Flags . boolean ( {
24
26
char : 'f' ,
25
27
default : false ,
@@ -31,14 +33,15 @@ export default class Status extends IronfishCommand {
31
33
} ) ,
32
34
}
33
35
34
- async start ( ) : Promise < void > {
36
+ async start ( ) : Promise < unknown > {
35
37
const { flags } = await this . parse ( Status )
36
38
37
39
if ( ! flags . follow ) {
38
40
const client = await this . connectRpc ( )
39
41
const response = await client . node . getStatus ( )
40
42
this . log ( renderStatus ( response . content , flags . all ) )
41
- this . exit ( 0 )
43
+
44
+ return response . content
42
45
}
43
46
44
47
// Console log will create display issues with Blessed
@@ -219,7 +222,7 @@ function renderStatus(content: GetNodeStatusResponse, debugOutput: boolean): str
219
222
Version : `${ content . node . version } @ ${ content . node . git } ` ,
220
223
Node : nodeStatus ,
221
224
'Node Name' : content . node . nodeName ,
222
- 'Peed ID' : content . peerNetwork . publicIdentity ,
225
+ 'Peer ID' : content . peerNetwork . publicIdentity ,
223
226
'Block Graffiti' : blockGraffiti ,
224
227
Network : network ,
225
228
Memory : memoryStatus ,
0 commit comments