Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
timothe
duniter
Commits
f6eb360c
Commit
f6eb360c
authored
Jan 15, 2020
by
Cédric Moreau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[enh] add `current` command: shows current block
parent
4975240e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
app/modules/dump.ts
app/modules/dump.ts
+16
-0
No files found.
app/modules/dump.ts
View file @
f6eb360c
...
...
@@ -61,6 +61,22 @@ module.exports = {
},
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]
'
,
desc
:
'
Dumps data of the blockchain.
'
,
logs
:
false
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment