this.devBoxes.cmd.on('cancel', (data) => { this.boxes.console.setFront() this.boxes.console.focus() this.screen.render() })
this.screen.key('f2', () => { const block = Block.getLast() this.blockBoxes.lastBlock.setContent('Last block info') this.blockBoxes.lastBlock.pushLine('ID {bold}' + block.id + '{/bold}') this.blockBoxes.lastBlock.pushLine('Hash {bold}' + block.hash.toString('hex') + '{/bold}') const blockUnpacked = Block.unpack(block.data) this.blockBoxes.lastBlock.pushLine('Time {bold}' + moment(blockUnpacked.time * 1000 - moment().utcOffset() * 60000).format('YYYY-MM-DD HH:mm:ss') + '{/bold}') this.blockBoxes.lastBlock.pushLine('Diff {bold}' + blockUnpacked.diff.toString('hex') + '{/bold}') this.blockBoxes.lastBlock.pushLine('Txs {bold}' + blockUnpacked.txCount + '{/bold}') this.blockBoxes.lastBlock.pushLine('') let txList = R.map(tx => Tx.unpack(tx), blockUnpacked.txList) for (let i in txList) { const txHash = blockUnpacked.txHashList[i] const tx = blockUnpacked.txList[i] this.blockBoxes.lastBlock.pushLine(txHash.toString('hex')) } this.boxes.blocks.setFront() this.boxes.blocks.focus() this.screen.render() })
this.screen.key('f3', () => { this.boxes.miner.setFront() this.boxes.miner.focus() this.screen.render() })
this.screen.key('f4', () => { this.boxes.wallet.setFront() this.boxes.wallet.focus() this.screen.render() })