This PR implements a new feature requested in #17952
A new call getgeneralinfo is now available for sending general daemon information back to clients. Currently, this data is only available via GUI (debug window / information tab).
The RPC execution looks like this:
bitcoin-cli -regtest getgeneralinfo
{
"clientversion": "v0.19.99.0-a654626f0-dirty",
"useragent": "/Satoshi:0.19.99/",
"datadir": "/Users/brakmic/Library/Application Support/Bitcoin/regtest",
"blocksdir": "/Users/brakmic/Library/Application Support/Bitcoin/regtest/blocks",
"startuptime": "2020-01-18T17:49:50Z"
}
bitcoin-cli -regtest help getgeneralinfo
getgeneralnfo
Returns data about the bitcoin daemon.
Result:
{
"clientversion": "v0.19.99.0-a654626f0", (string) Client version
"useragent":"/Satoshi:0.19.99/", (string) Client name
"datadir":"/home/user/.bitcoin", (string) Data directory path
"blocksdir":"/home/user/.bitcoin/blocks", (string) Blocks directory path
"startuptime":"2020-01-18T17:49:50Z", (string) Startup time
}
Examples:
> bitcoin-cli getgeneralinfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getgeneralinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
However, I am not sure if the current format in "startuptime" field is acceptable. Maybe there is a better function that should be used? Currently I am using the FormatISO8601DateTime function.
Test A new functional test rpc_getgeneralinfo.py is available.
Regards,