Skip to content

Commit fa77aaa

Browse files
author
MarcoFalke
committed
doc: Add external interface consistency guarantees
1 parent 643b25d commit fa77aaa

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

doc/JSON-RPC-interface.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# JSON-RPC Interface
2+
3+
The headless daemon `bitcoind` has the JSON-RPC API enabled by default, the GUI
4+
`bitcoin-qt` has it disabled by default. This can be changed with the `-server`
5+
option. In the GUI it is possible to execute RPC methods in the Debug Console
6+
Dialog.
7+
8+
## RPC consistency guarantees
9+
10+
State that can be queried via RPCs is guaranteed to be at least up-to-date with
11+
the chain state immediately prior to the call's execution. However, the state
12+
returned by RPCs that reflect the mempool may not be up-to-date with the
13+
current mempool state.
14+
15+
### Transaction Pool
16+
17+
The mempool state returned via an RPC is consistent with itself and with the
18+
chain state at the time of the call. Thus, the mempool state only encompasses
19+
transactions that are considered mine-able by the node at the time of the RPC.
20+
21+
The mempool state returned via an RPC reflects all effects of mempool and chain
22+
state related RPCs that returned prior to this call.
23+
24+
### Wallet
25+
26+
The wallet state returned via an RPC is consistent with itself and with the
27+
chain state at the time of the call.
28+
29+
Wallet RPCs will return the latest chain state consistent with prior non-wallet
30+
RPCs. The effects of all blocks (and transactions in blocks) at the time of the
31+
call is reflected in the state of all wallet transactions. For example, if a
32+
block contains transactions that conflicted with mempool transactions, the
33+
wallet would reflect the removal of these mempool transactions in the state.
34+
35+
However, the wallet may not be up-to-date with the current state of the mempool
36+
or the state of the mempool by an RPC that returned before this RPC. For
37+
example, a wallet transaction that was BIP-125-replaced in the mempool prior to
38+
this RPC may not yet be reflected as such in this RPC response.

doc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ The Bitcoin repo's [root README](/README.md) contains relevant information on th
5656
- [Translation Process](translation_process.md)
5757
- [Translation Strings Policy](translation_strings_policy.md)
5858
- [Travis CI](travis-ci.md)
59+
- [JSON-RPC Interface](JSON-RPC-interface.md)
5960
- [Unauthenticated REST Interface](REST-interface.md)
6061
- [Shared Libraries](shared-libraries.md)
6162
- [BIPS](bips.md)

doc/REST-interface.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The REST API can be enabled with the `-rest` option.
66
The interface runs on the same port as the JSON-RPC interface, by default port 8332 for mainnet, port 18332 for testnet,
77
and port 18443 for regtest.
88

9+
REST Interface consistency guarantees
10+
-------------------------------------
11+
12+
The [same guarantees as for the RPC Interface](/doc/JSON-RPC-interface.md#rpc-consistency-guarantees)
13+
apply.
14+
915
Supported API
1016
-------------
1117

0 commit comments

Comments
 (0)