Skip to content
Snippets Groups Projects
Commit f6eb360c authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[enh] add `current` command: shows current block

parent 4975240e
No related tags found
No related merge requests found
...@@ -61,6 +61,22 @@ module.exports = { ...@@ -61,6 +61,22 @@ module.exports = {
}, },
cli: [{ cli: [{
name: 'current',
desc: 'Shows current block\'s blockstamp',
logs: false,
preventIfRunning: true,
onDatabaseExecute: async (server:Server) => {
const current = await server.dal.getCurrentBlockOrNull()
if (!current) {
return console.log('None')
}
const blockstamp = `${current.number}-${current.hash}`
console.log(blockstamp)
// Save DB
await server.disconnect();
}
}, {
name: 'dump [what] [name] [cond]', name: 'dump [what] [name] [cond]',
desc: 'Dumps data of the blockchain.', desc: 'Dumps data of the blockchain.',
logs: false, logs: false,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment