Commit Graph

53 Commits

Author SHA1 Message Date
Andrew Chow
ebb15ea75a
Merge bitcoin/bitcoin#26207: rest: add verbose and mempool_sequence query params for mempool/contents
1ff5d61dfd doc: add mempool/contents rest verbose and mempool_sequence args (Andrew Toth)
52a31dccc9 tests: mempool/contents verbose and mempool_sequence query params tests (Andrew Toth)
a518fff0f2 rest: add verbose and mempool_sequence query params for mempool/contents (Andrew Toth)

Pull request description:

  The verbose mempool json response can get very large. This adds an option to return the non-verbose response of just the txids. It is identical to the rpc response so the diff here is minimal. This also adds the mempool_sequence parameter for rpc consistency. Verbose defaults to true to remain backwards compatible.

  It uses query parameters to be compatible with the efforts in https://github.com/bitcoin/bitcoin/issues/25752.

ACKs for top commit:
  achow101:
    ACK 1ff5d61dfd
  stickies-v:
    re-ACK [1ff5d61](1ff5d61dfd)
  pablomartin4btc:
    tested ACK 1ff5d61dfd.

Tree-SHA512: 1bf08a7ffde2e7db14dc746e421feedf17d84c4b3f1141e79e36feb6014811dfde80e1d8dbc476c15ff705de2d3c967b3081dcd80536d76b7edf888f1a92e9d1
2023-03-15 19:39:30 -04:00
Andrew Chow
92be831847
Merge bitcoin/bitcoin#25412: rest: add /deploymentinfo endpoint
a8250e30f1 doc: add release note about `/rest/deploymentinfo` (brunoerg)
5c96020024 doc: add `/deploymentinfo` in REST-interface (brunoerg)
3e44bee08e test: add coverage for `/rest/deploymentinfo` (brunoerg)
91497031cb rest: add `/deploymentinfo` (brunoerg)

Pull request description:

  #23508 added a new RPC named `getdeploymentinfo`, it moved the softfork section from `getblockchaininfo` into this new one. In the REST interface, we have an endpoint named`/rest/chaininfo.json` (which refers to `getblockchaininfo`), so, this PR adds a new REST endpoint named `/deploymentinfo` which refers to `getdeploymentinfo`.

  You can use it by passing a block hash, e.g: '/rest/deploymentinfo/<BLOCKHASH>.json' or you can use it without passing a block hash to get the 'deploymentinfo' for the last block.

ACKs for top commit:
  jonatack:
    re-ACK a8250e30f1 rebase-only since my last review at c65f82bb
  achow101:
    ACK a8250e30f1
  stickies-v:
    re-ACK a8250e30f1

Tree-SHA512: 0735183b6828d51a72ed0e2be5a09b314ac4693f548982c6e9adaa0ef07a55aa428d3b2d1b1de70b83169811a663a8624b686166e5797f624dcc00178b9796e6
2022-10-13 13:30:55 -04:00
fanquake
7e5fe03461
Merge bitcoin/bitcoin#24467: doc: minor improvements in getutxos REST endpoint synopsis
c456302d42 doc: minor improvements in getutxos REST endpoint synopsis (Sebastian Falbesoner)

Pull request description:

  Describing an optional sub-path as `<checkmempool>` in the synopsis could be misleading as the angle brackets normally indicate that the field has to be replaced a custom value. Clarify that by showing two variants instead, similar to the `block` endpoint with the `notxdetails` option:
  ```
  #### Blocks
  `GET /rest/block/<BLOCK-HASH>.<bin|hex|json>`
  `GET /rest/block/notxdetails/<BLOCK-HASH>.<bin|hex|json>`
  ```

  Further improvements:
  - uppercase `<TXID>` and `<N>`, to match the description of the other endpoints
  - s/getutxo command/getutxos endpoint/
  - describe what the `checkmempool` option does
  - s/serialisation/serialization/ (the US spelling is more dominant than the UK spelling in the project, and there is indeed no other instance of the string "serialis*" in the source tree, except once in a release note)
  - link to BIP64 within the text instead of only showing bare URL
  - mention that BIP64 is only relevant for `bin` and `hex` output formats
  - show two endpoint formats of the block section as list

ACKs for top commit:
  stickies-v:
    ACK c456302d42 - also checked that current master (cc12b8947) doesn't have any other lines changes that would require updates as per the outlined improvement points.

Tree-SHA512: b025aac0812397f5fbf78c805c13aeb5afa6862a049d13c0b101178799cdaff1ccd3abc368a5c103ea6ebf17cdff76584c54638d0f8d303d81ade2d71443d305
2022-10-13 11:54:52 +08:00
Andrew Toth
1ff5d61dfd
doc: add mempool/contents rest verbose and mempool_sequence args 2022-10-05 09:25:07 -04:00
fanquake
13ec2c1913
Merge bitcoin/bitcoin#24084: doc: add information about status code 404 for some endpoints (rest)
0811cbfc28 doc: add info about status code 404 for some rest endpoints (brunoerg)

Pull request description:

  This PR adds an explanation about status code 404 for 2 endpoints (`/rest/tx/ `and `/rest/blockhashbyheight/`) in`REST-interface.md`. There are other endpoints that already cover it.

ACKs for top commit:
  [deleted]:
    reACK 0811cbfc28
  shaavan:
    ACK 0811cbfc28

Tree-SHA512: a01ac6653f706b7a7e4a4679a2b81e448381f31460ac4bcfc179af6186401cffae7b49a82f3a52c89e556acd5c16c159ce752c7a678177900ddf2e4e5c72fe6b
2022-10-02 16:29:31 +01:00
brunoerg
5c96020024 doc: add /deploymentinfo in REST-interface 2022-08-16 19:21:51 -03:00
brunoerg
5bc5cbaf31 doc: add reference to getrawmempool RPC in /mempool/contents REST doc 2022-04-20 18:12:39 -03:00
MarcoFalke
ff78833d3c
Merge bitcoin/bitcoin#24776: docs: update /rest/chaininfo doc referring to RPC help
1d95b5c783 doc: cleanups to mempool rest endpoints (brunoerg)
b941dec0a9 docs: update `/rest/chaininfo` doc referring to RPC help (brunoerg)

Pull request description:

  Internally, `/rest/chaininfo` gets the infos from `getblockchaininfo` and I just realized the documentation of it in `REST-interface.md` is outdated compared to the `getblockchaininfo` RPC one. This PR removes the documentation of the fields and adds a reference to the RPC help.

ACKs for top commit:
  jonatack:
    ACK 1d95b5c783

Tree-SHA512: 643db202e13e8372105460b0871facb11586dc0ff5e86ec9e105a178bcfeefa3555bb047cd28cfaeb3e747f5a2055e27961813c9e299ba7b2d36151e81049507
2022-04-19 12:11:07 +02:00
brunoerg
1d95b5c783 doc: cleanups to mempool rest endpoints 2022-04-18 21:17:11 -03:00
brunoerg
b941dec0a9 docs: update /rest/chaininfo doc referring to RPC help 2022-04-18 21:17:06 -03:00
stickies-v
f959fc0397
Update /<count>/ endpoints to use a '?count=' query parameter instead
In most RESTful APIs, path parameters are used to represent resources, and
query parameters are used to control how these resources are being filtered/sorted/...

The old /<count>/ functionality is kept alive to maintain backwards compatibility,
but new paths with query parameters are introduced and documented as the default
interface so future API methods don't break consistency by using query parameters.
2022-04-05 13:19:37 -04:00
Sebastian Falbesoner
c456302d42 doc: minor improvements in getutxos REST endpoint synopsis
Describing an optional sub-path as <checkmempool> in the synopsis could
be misleading as the angle brackets normally indicate that the field has
to be replaced a custom value. Clarify that by showing two variants
instead, similar to the block endpoint with the notxdetails option.

Further improvements:

- uppercase <TXID> and <N>, to match the description of the other endpoints
- s/getutxo command/getutxos endpoint/
- describe what the checkmempool option does
- s/serialisation/serialization/ (the US spelling is more dominant than
  the UK spelling in the project, and there is indeed no other instance
  of the string "serialis*" in the source tree, except once in a release
  note)
- link to BIP64 within the text instead of only showing bare URL
- mention that BIP64 is only relevant for bin and hex output formats
- show two endpoint formats of the block section as list
2022-03-30 17:27:03 +02:00
Gregory Sanders
6498ba151b transaction decoding infer output descriptors 2022-01-26 09:56:51 +08:00
brunoerg
0811cbfc28 doc: add info about status code 404 for some rest endpoints 2022-01-24 08:39:42 -03:00
Matt Corallo
2b64fa3251 Update REST docs with new accessors 2021-10-17 02:56:56 +00:00
Michael Dietz
085b3a7299
rpc: deprecate addresses and reqSigs from rpc outputs
1) add a new sane "address" field (for outputs that have an
   identifiable address, which doesn't include bare multisig)
2) with -deprecatedrpc: leave "reqSigs" and "addresses" intact
   (with all weird/wrong behavior they have now)
3) without -deprecatedrpc: drop "reqSigs" and "addresses" entirely,
   always.
2021-03-23 10:51:43 -04:00
MarcoFalke
fa362064e3
rpc: Return total fee in mempool
Also, add missing lock annotations
2021-01-28 10:43:22 +01:00
Sebastian Falbesoner
fc726e0138 doc, rpc: add missing signet mentions in network name lists 2021-01-12 18:43:31 +01:00
MarcoFalke
8452f922d2
Merge #19050: doc: Add warning for rest interface limitation
5c3eaf9983 doc: Add warnings for http interfaces limitations (Fabian Jahr)

Pull request description:

  `libevent`, which is used for our rest interface, can use up all of the available file descriptors in a system if too many connections are opened at once. If a new block is connected at the same time and can not be written to disk because there are no file descriptors available, the node crashes. Based on my investigation so far the issue is best solved upstream which means we have to wait for the next release (2.2). In the meantime it would be good if we would warn users of this limitation.

  See #11368 for more background.

ACKs for top commit:
  MarcoFalke:
    ACK 5c3eaf9983

Tree-SHA512: 73914538588477ead19068f5832fdcc8e0eb736e51f73b3aca501c93165e5ad634c2511a3fcffff251adcd3efda23a742b48211ad9d3b2a29cdeac17201d06a1
2020-12-17 10:00:38 +01:00
fanquake
2f54c76050
Merge #19390: doc/REST-interface: Remove stale info
fd9c213c6e doc/REST-interface: Remove stale info (Luke Dashjr)

Pull request description:

  Clean merge to 0.19+

ACKs for top commit:
  fanquake:
    ACK fd9c213c6e
  MarcoFalke:
    ACK fd9c213c6e

Tree-SHA512: ac3ffaa72226380ed8b8ab505518d0dc4350bfcc4625dfd27a2350fbb972a8d2bb4255307926eb331c49232023bcb283a659f0d87e4ecbf654982341242f7d36
2020-06-29 13:32:01 +08:00
Luke Dashjr
fd9c213c6e doc/REST-interface: Remove stale info 2020-06-26 21:19:15 +00:00
Fabian Jahr
5c3eaf9983
doc: Add warnings for http interfaces limitations 2020-06-01 00:54:18 +02:00
Chris Abrams
ff6549c3c8 fix: update rest info on block size and json 2020-04-28 20:17:03 -05:00
Fabian Jahr
3ed8e3d079 doc: Remove explicit network name references 2019-11-01 12:06:35 +01:00
Jon Layton
6aab7649d3 doc: Fix whitespace errs in .md files, bitcoin.conf, Info.plist.in, and find_bdb48.m4 2019-09-17 03:21:22 -04:00
Ben Woosley
bb8ae2c419
rpc: Expose g_is_mempool_loaded via getmempoolinfo and /rest/mempool/info.json
And use it to fix a race condition in mempool_persist.py:
https://travis-ci.org/Empact/bitcoin/jobs/487577243

Since e.g. getrawmempool returns errors based on this status, this
enables users to test it for readiness.
2019-03-22 02:31:20 -07:00
Amiti Uttarwar
8e4b4f683a Address test todos by removing -txindex to nodes.
Originally added when updating getrawtransaction to stop searching unspent utxos.
2019-02-17 21:42:08 -08:00
Jonas Schnelli
82cf6813a4
Merge #14353: REST: add blockhash call, fetch blockhash by height
42ff30ec6 [Docs] add short documentation for /rest/blockhashbyheight (Jonas Schnelli)
579d418f7 [QA] add rest tests for /rest/blockhashbyheight/<HEIGHT>.<FORMAT> (Jonas Schnelli)
eb9ef04c4 REST: add "blockhashbyheight" call, fetch blockhash by height (Jonas Schnelli)

Pull request description:

  Completes the REST interface for trivial block exploring by adding a call that allows to fetch the blockhash in the main chain by a given height.

Tree-SHA512: 94be9e56718f857279b11cc16dfa8d04f3b5a762e87ae54281b4d87247c71c844895f4944d5a47f09056bf851f4c4761ac4fbdbaaee957265d14de5c1c73e8d2
2019-01-22 19:59:02 -10:00
Jonas Schnelli
42ff30ec60
[Docs] add short documentation for /rest/blockhashbyheight 2019-01-21 11:54:54 -10:00
João Barbosa
0825b86b28 doc: /rest/block responds with 404 if block does not exist 2019-01-16 14:42:22 +00:00
João Barbosa
be625f7c55 doc: Explain empty result of /rest/headers 2019-01-16 11:44:03 +00:00
MarcoFalke
fa77aaa5ad
doc: Add external interface consistency guarantees 2018-10-30 16:40:36 -04:00
Dimitris Apostolou
a9761cae1c
Fix typos and cleanup
[ci-skip]
2018-03-02 23:00:25 +02:00
Wladimir J. van der Laan
28485c783d
Merge #10825: net: set regtest JSON-RPC port to 18443 to avoid conflict with testnet 18332
ce3baa193 changed regtest RPCport to 18443 to avoid conflict with testnet 18332 (Ferdinando M. Ametrano)

Pull request description:

  using the same JSON-RPC default port for both testnet and regtest prevents running both at the same time on the same machine. Since RPCport=P2Pport-1 for both mainnet and testnet, and regtest P2Pport being 18444, 18443 is proposed for regtest RPCport

  Documentation has been updated (or created where missing); manpages doc/man/bitcoin*.1 could include information for regtest too

Tree-SHA512: d42185f7ef54dc918ece19b543c8681d08bb9c5a971394e21f2d9a1091734b091b08df69fab622c207b46f402cf9323ded5b7a33fbd0af722388930169124e7f
2017-09-06 01:18:35 +02:00
MarcoFalke
6366941275
Merge #10680: Fix inconsistencies and grammar in various files
1d8df0141 Fix MD formatting in REST-interface.md and spelling mistake in test_runner.py (MeshCollider)
41f3e84aa Fix inconsistencies and grammar in various files (MeshCollider)

Pull request description:

  Just a simple fix of some inconsistent capitalization, formatting and grammar in a few files (no code changes)

Tree-SHA512: 60b12a5a5c69a1af4a25b7db0b32ed806ed62ad2966cee08b3792a7cfa7f51848fd485349b4c09e60a7eedfdf55ee730c51daa066d6e226ae404c93342bf3e13
2017-08-16 00:46:40 +02:00
Ferdinando M. Ametrano
ce3baa193f changed regtest RPCport to 18443 to avoid conflict with testnet 18332 2017-08-04 10:27:41 +02:00
MeshCollider
1d8df01412 Fix MD formatting in REST-interface.md and spelling mistake in
test_runner.py
2017-07-01 20:29:00 +12:00
Michael Rotarius
b8bb4257fe REST/RPC example update 2017-06-30 13:21:08 +02:00
djpnewton
c91103573b Add default port numbers to REST doc 2016-08-24 08:41:42 +12:00
Pavel Janík
70180b2e57 Implement REST mempool API, add test and documentation. 2015-08-14 07:01:03 +02:00
Simon Males
0ef9858707 Documenting pruned, pruneheight and softforks in getblockchaininfo 2015-07-19 14:07:35 +02:00
Simon Males
0c895799c8 Include pruned state in chaininfo.json 2015-07-18 10:32:09 +02:00
tailsjoin
9fbca205d4 doc: Remove recommendation to add old repos for libd4.8*
It is unreasonable to ask to change the global package configuration
just to build a package. Not only that, this is potentially harmful to the system.

Also do a few punctuation fixes in REST-interface.md.
2015-07-15 09:20:51 +02:00
Jonas Schnelli
c45c7ea0fa [REST] add JSON support for /rest/headers/ 2015-07-05 15:48:33 +02:00
Jonas Schnelli
6e71efa9f0 [REST] remove json input for getutxos, limit to query max. 15 outpoints
Remove possibility to send json encoded parameters to `/rest/getutxos/` to avoid possible DoS scenarios.

The JSON output option is untouched.
2015-05-27 20:10:02 +02:00
Jonas Schnelli
b448002772 [Docs] fix and improve REST documentation
- fix bad formatting of getutxos
- added getztxos example
- fix different command syntax
2015-05-18 16:52:01 +02:00
Wladimir J. van der Laan
1fd2d39529
Merge pull request #5420
6b4feb8 [QA] rest.py RPC test: change setgenerate() to generate() (Jonas Schnelli)
97ee866 [REST] getutxos REST command (based on Bip64) (Jonas Schnelli)
2015-05-06 16:50:05 +02:00
Jonas Schnelli
2ccfc6360d [REST] update documentation
- add documentation for /rest/headers
- reformat sections
2015-04-23 14:49:40 +02:00
Jonas Schnelli
6b4feb89a8 [QA] rest.py RPC test: change setgenerate() to generate() 2015-04-21 20:33:02 +02:00
paveljanik
abcec3082e Update REST URL to match reality 2015-04-20 13:29:21 +02:00