Skip to content

Commit 2c07b3d

Browse files
committed
New 0.9.2 RPCs: getblockchaininfo, getnetworkinfo, getwalletinfo
Added the three new RPCs to the RPC docs and also added a warning that getinfo will be removed in a future version.
1 parent eaf0b22 commit 2c07b3d

File tree

3 files changed

+193
-0
lines changed

3 files changed

+193
-0
lines changed

_autocrossref.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ BIP72:
240240
'`getbalance`': rpc getbalance
241241
'`getbestblockhash`': rpc getbestblockhash
242242
'`getblock`': rpc getblock
243+
'`getblockchaininfo`': rpc getblockchaininfo
243244
'`getblockcount`': rpc getblockcount
244245
'`getblockhash`': rpc getblockhash
245246
'`getblocktemplate`': rpc getblocktemplate
@@ -251,6 +252,7 @@ BIP72:
251252
'`getmininginfo`': rpc getmininginfo
252253
'`getnettotals`': rpc getnettotals
253254
'`getnetworkhashps`': rpc getnetworkhashps
255+
'`getnetworkinfo`': rpc getnetworkinfo
254256
'`getnewaddress`': rpc getnewaddress
255257
'`getpeerinfo`': rpc getpeerinfo
256258
'`getrawchangeaddress`': rpc getrawchangeaddress
@@ -262,6 +264,7 @@ BIP72:
262264
'`gettxout`': rpc gettxout
263265
'`gettxoutsetinfo`': rpc gettxoutsetinfo
264266
'`getunconfirmedbalance`': rpc getunconfirmedbalance
267+
'`getwalletinfo`': rpc getwalletinfo
265268
'`getwork`': rpc getwork
266269
'`help`': rpc help
267270
'`importprivkey`': rpc importprivkey

_includes/ref_core_rpcs-abcdefg.md

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,66 @@ Result:
13301330

13311331

13321332

1333+
#### getblockchaininfo
1334+
1335+
~~~
1336+
getblockchaininfo
1337+
~~~
1338+
1339+
{% autocrossref %}
1340+
1341+
Provides information about the current state of the block chain. *This
1342+
RPC was added in Bitcoin Core 0.9.2.*
1343+
1344+
**Result**
1345+
1346+
A JSON object containing several key/value pairs: *chain* telling you
1347+
whether you're working on the main block chain or a testnet or regtest
1348+
block chain, the number of *blocks* processed by the node, the *best
1349+
block hash* (tip of the chain), the current network *difficulty*, an
1350+
estimate of the *verification progress* (1 for 100% verified), and the
1351+
total amount of *chain work* seen in the current chain (displayed in
1352+
hexadecimal). *Note: verificationprogress may exceed 1 (100%) because it's
1353+
just an estimate.*
1354+
1355+
{% endautocrossref %}
1356+
1357+
~~~
1358+
{
1359+
"chain": "<name>",
1360+
"blocks": <integer>,
1361+
"bestblockhash": "<SHA256 hash>",
1362+
"difficulty": <decimal difficulty>,
1363+
"verificationprogress": <decimal>,
1364+
"chainwork": "<hexadecimal>"
1365+
}
1366+
~~~
1367+
1368+
**Example**
1369+
1370+
~~~
1371+
bitcoin-cli -testnet getblockchaininfo
1372+
~~~
1373+
1374+
Result:
1375+
1376+
~~~
1377+
{
1378+
"chain" : "testnet3",
1379+
"blocks" : 272899,
1380+
"bestblockhash" : "00000000000047021429fb03107900637205c38b6\
1381+
4ebd2400bfe5be18f78da5e",
1382+
"difficulty" : 110221.77693374,
1383+
"verificationprogress" : 0.99999913,
1384+
"chainwork" : "000000000000000000000000000000000000000000000\
1385+
0001dc6696de16ca6c8"
1386+
}
1387+
~~~
1388+
1389+
1390+
1391+
1392+
13331393
#### getblockcount
13341394

13351395
~~~
@@ -1866,6 +1926,11 @@ getinfo
18661926

18671927
Prints various information about the node and the network.
18681928

1929+
![Warning icon](/img/icon_warning.svg)
1930+
**Warning:** `getinfo` will be removed in a later version of Bitcoin
1931+
Core. Use `getblockchaininfo`, `getnetworkinfo`, or `getwalletinfo`
1932+
instead.
1933+
18691934
{% endautocrossref %}
18701935

18711936
**Result**
@@ -2106,6 +2171,74 @@ Result:
21062171
~~~
21072172

21082173

2174+
#### getnetworkinfo
2175+
2176+
~~~
2177+
getnetworkinfo
2178+
~~~
2179+
2180+
{% autocrossref %}
2181+
2182+
Provides information about the node's connection to the network. *This
2183+
RPC was added in Bitcoin Core 0.9.2.*
2184+
2185+
**Result**
2186+
2187+
A JSON object containing several key/value pairs: the server *version*,
2188+
the *protocol version*, the server's *time offset* from the averaged network time,
2189+
how many *connections* it has to other nodes, information about any
2190+
*proxy* being used, the smallest *relay fee* per kilobyte this node will accept
2191+
in order to relay transactions, and a JSON array of IP *addresses* and
2192+
*port* numbers which the node is listening to along with a *score* for
2193+
each (with the array with the highest score being the one returned to
2194+
peers).
2195+
2196+
{% endautocrossref %}
2197+
2198+
~~~
2199+
{
2200+
"version": <integer>,
2201+
"protocolversion": <integer>,
2202+
"timeoffset": <integer seconds>,
2203+
"connections": <integer>,
2204+
"proxy": "<host>:<port>",
2205+
"relayfee": <decimal bitcoins>,
2206+
"localaddresses": [
2207+
"address": "<address>",
2208+
"port": <port>,
2209+
"score": <integer>
2210+
]
2211+
}
2212+
~~~
2213+
2214+
**Example**
2215+
2216+
2217+
~~~
2218+
bitcoin-cli -testnet getnetworkinfo
2219+
~~~
2220+
2221+
Result:
2222+
2223+
~~~
2224+
{
2225+
"version" : 90200,
2226+
"protocolversion" : 70002,
2227+
"timeoffset" : 0,
2228+
"connections" : 12,
2229+
"proxy" : "",
2230+
"relayfee" : 0.00001000,
2231+
"localaddresses" : [
2232+
{
2233+
"address" : "68.39.150.9",
2234+
"port" : 18333,
2235+
"score" : 65
2236+
}
2237+
]
2238+
}
2239+
~~~
2240+
2241+
21092242

21102243
#### getnewaddress
21112244

@@ -3024,6 +3157,60 @@ Result (no satoshis unconfirmed):
30243157
~~~
30253158

30263159

3160+
#### getwalletinfo
3161+
3162+
~~~
3163+
getwalletinfo
3164+
~~~
3165+
3166+
{% autocrossref %}
3167+
3168+
Provides information about the wallet. *This RPC was added in Bitcoin
3169+
Core 0.9.2.*
3170+
3171+
**Result**
3172+
3173+
A JSON object containing several key/value pairs: the *walletversion*
3174+
number, the current wallet's *balance* (the same as `getbalance`), the
3175+
number of transactions made by this wallet (*txcount*), the oldest
3176+
pre-generated key in the keypool (*keypoololdest*), the number of keys
3177+
in the keypool which have not received a transaction (*keypoolsize*),
3178+
the time in seconds since 1 January 1970 (epoch time) when an encrypted wallet
3179+
will become locked or 0 if the wallet is currently locked
3180+
(*unlocked_until*)---see `walletpassphrase`.
3181+
3182+
{% endautocrossref %}
3183+
3184+
~~~
3185+
{
3186+
"walletversion" : <integer>,
3187+
"balance" : <decimal bitcoins>,
3188+
"txcount" : <integer>,
3189+
"keypoololdest" : <epoch date>,
3190+
"keypoolsize" : <integer>,
3191+
"unlocked_until" : <epoch date>
3192+
}
3193+
~~~
3194+
3195+
**Example**
3196+
3197+
~~~
3198+
bitcoin-cli -testnet getwalletinfo
3199+
~~~
3200+
3201+
Result:
3202+
3203+
~~~
3204+
{
3205+
"walletversion" : 60000,
3206+
"balance" : 1.45060000,
3207+
"txcount" : 17,
3208+
"keypoololdest" : 1398809500,
3209+
"keypoolsize" : 196,
3210+
"unlocked_until" : 0
3211+
}
3212+
~~~
3213+
30273214

30283215
#### getwork
30293216

_includes/references.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@
218218
[rpc getbalance]: /en/developer-reference#getbalance
219219
[rpc getbestblockhash]: /en/developer-reference#getbestblockhash
220220
[rpc getblock]: /en/developer-reference#getblock
221+
[rpc getblockchaininfo]: /en/developer-reference#getblockchaininfo
221222
[rpc getblockcount]: /en/developer-reference#getblockcount
222223
[rpc getblockhash]: /en/developer-reference#getblockhash
223224
[rpc getblocktemplate]: /en/developer-reference#getblocktemplate
@@ -229,6 +230,7 @@
229230
[rpc getmininginfo]: /en/developer-reference#getmininginfo
230231
[rpc getnettotals]: /en/developer-reference#getnettotals
231232
[rpc getnetworkhashps]: /en/developer-reference#getnetworkhashps
233+
[rpc getnetworkinfo]: /en/developer-reference#getnetworkinfo
232234
[rpc getnewaddress]: /en/developer-reference#getnewaddress
233235
[rpc getpeerinfo]: /en/developer-reference#getpeerinfo
234236
[rpc getrawchangeaddress]: /en/developer-reference#getrawchangeaddress
@@ -240,6 +242,7 @@
240242
[rpc gettxout]: /en/developer-reference#gettxout
241243
[rpc gettxoutsetinfo]: /en/developer-reference#gettxoutsetinfo
242244
[rpc getunconfirmedbalance]: /en/developer-reference#getunconfirmedbalance
245+
[rpc getwalletinfo]: /en/developer-reference#getwalletinfo
243246
[rpc getwork]: /en/developer-reference#getwork
244247
[rpc help]: /en/developer-reference#help
245248
[rpc importprivkey]: /en/developer-reference#importprivkey

0 commit comments

Comments
 (0)