Hello everyone,
I am working on a tool that displays information about a bitcoin node using RPC. One of the parameters I would like to include is the uptime
of the bitcoin daemon. Currently, as far as I can tell, there is no way of obtaining such information.
After thinking a bit on how to perform this task, I concluded that the easiest way to do it is to check the modification time of the bitcoind.pid
file. This has the disadvantage that it does not work in Windows because bitcoind.pid
is not created.
I propose the following solution in this PR and submit it for your review and opinion concerning this new RPC command before I work further on this topic. Do you think this new command makes sense? Please consider it a WIP/PoC as it does not have any error checking or tests.
Here is a sample return from the RPC command:
0$ ./bitcoin-cli uptime
1{
2 "uptime": 696
3}
and the help function:
0$bitcoin-cli help uptime
1uptime
2
3Display the uptime of the Bitcoin server.
Best regards, Ricardo Velhote