Language

Choose a language

/build/rpc / btc

uptime

uptime Returns the total uptime of the server. Result: n (numeric) The number of seconds that the server has been running Examples: > bitcoin-cli uptime > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "uptime", "params": []}' -H 'content-type: application/json' http://127.0.0.1:8332/

Signature

uptime() → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"uptime","params":[]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

No parameters.

Result

Type:  any

n (numeric) The number of seconds that the server has been running

Source: services/core-node/bcore/src/rpc/server.cpp:181

C++ symbol: uptime