File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export class Status extends RootCommand implements LeafCommand {
1212 public readonly description = 'Check Bee status'
1313
1414 public async run ( ) : Promise < void > {
15- await super . init ( )
15+ super . init ( )
1616
1717 this . console . all ( chalk . bold ( 'Bee' ) )
1818 process . stdout . write ( createKeyValue ( 'API' , this . beeApiUrl ) )
@@ -44,6 +44,15 @@ export class Status extends RootCommand implements LeafCommand {
4444 const { bzzBalance, nativeTokenBalance } = await this . bee . getWalletBalance ( )
4545 this . console . all ( createKeyValue ( 'xBZZ' , Numbers . fromDecimals ( bzzBalance , 16 ) ) )
4646 this . console . all ( createKeyValue ( 'xDAI' , Numbers . fromDecimals ( nativeTokenBalance , 18 ) ) )
47+ this . console . all ( '' )
48+ this . console . all ( chalk . bold ( 'Chainsync' ) )
49+ const { block, chainTip } = await this . bee . getChainState ( )
50+ this . console . all (
51+ createKeyValue (
52+ 'Block' ,
53+ `${ block . toLocaleString ( ) } / ${ chainTip . toLocaleString ( ) } (Δ ${ ( chainTip - block ) . toLocaleString ( ) } )` ,
54+ ) ,
55+ )
4756 }
4857
4958 if ( nodeInfo . beeMode !== BeeModes . ULTRA_LIGHT && nodeInfo . beeMode !== BeeModes . DEV ) {
Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ export function createChequeMockHttpServer(port: number): Server {
3030 response . end ( JSON . stringify ( balance ) )
3131 }
3232
33+ if ( request . url === '/chainstate' ) {
34+ response . end ( JSON . stringify ( chainstate ) )
35+ }
36+
3337 if ( request . url === '/wallet' ) {
3438 response . end ( JSON . stringify ( wallet ) )
3539 }
@@ -92,6 +96,13 @@ const lastCashoutCheque1 = {
9296
9397const balance = { totalBalance : '100026853000000000' , availableBalance : '100018560000000000' }
9498
99+ const chainstate = {
100+ chainTip : 37439274 ,
101+ block : 37439270 ,
102+ totalAmount : '153434201871' ,
103+ currentPrice : '27356' ,
104+ }
105+
95106const wallet = {
96107 bzzBalance : '3904697022414848' ,
97108 nativeTokenBalance : '96106482372132023' ,
You can’t perform that action at this time.
0 commit comments