![]() |
Bitcoin Core 31.0.0
P2P Digital Currency
|
#include <rest.h>#include <blockfilter.h>#include <chain.h>#include <chainparams.h>#include <core_io.h>#include <flatfile.h>#include <httpserver.h>#include <index/blockfilterindex.h>#include <index/txindex.h>#include <node/blockstorage.h>#include <node/context.h>#include <primitives/block.h>#include <primitives/transaction.h>#include <rpc/blockchain.h>#include <rpc/mempool.h>#include <rpc/protocol.h>#include <rpc/server.h>#include <rpc/server_util.h>#include <streams.h>#include <sync.h>#include <txmempool.h>#include <undo.h>#include <util/any.h>#include <util/check.h>#include <util/strencodings.h>#include <validation.h>#include <any>#include <vector>#include <univalue.h>Go to the source code of this file.
Classes | |
| struct | CCoin |
Functions | |
| static bool | RESTERR (HTTPRequest *req, enum HTTPStatusCode status, std::string message) |
| static NodeContext * | GetNodeContext (const std::any &context, HTTPRequest *req) |
| Get the node context. | |
| static CTxMemPool * | GetMemPool (const std::any &context, HTTPRequest *req) |
| Get the node context mempool. | |
| static ChainstateManager * | GetChainman (const std::any &context, HTTPRequest *req) |
| Get the node context chainstatemanager. | |
| RESTResponseFormat | ParseDataFormat (std::string ¶m, const std::string &strReq) |
| Parse a URI to get the data format and URI without data format and query string. | |
| static std::string | AvailableDataFormatsString () |
| static bool | CheckWarmup (HTTPRequest *req) |
| static bool | rest_headers (const std::any &context, HTTPRequest *req, const std::string &uri_part) |
| static void | SerializeBlockUndo (DataStream &stream, const CBlockUndo &block_undo) |
| Serialize spent outputs as a list of per-transaction CTxOut lists using binary format. | |
| static void | BlockUndoToJSON (const CBlockUndo &block_undo, UniValue &result) |
| Serialize spent outputs as a list of per-transaction CTxOut lists using JSON format. | |
| static bool | rest_spent_txouts (const std::any &context, HTTPRequest *req, const std::string &uri_part) |
| static bool | rest_block (const std::any &context, HTTPRequest *req, const std::string &uri_part, std::optional< TxVerbosity > tx_verbosity, std::optional< std::pair< size_t, size_t > > block_part=std::nullopt) |
| This handler is used by multiple HTTP endpoints: | |
| static bool | rest_block_extended (const std::any &context, HTTPRequest *req, const std::string &uri_part) |
| static bool | rest_block_notxdetails (const std::any &context, HTTPRequest *req, const std::string &uri_part) |
| static bool | rest_block_part (const std::any &context, HTTPRequest *req, const std::string &uri_part) |
| static bool | rest_filter_header (const std::any &context, HTTPRequest *req, const std::string &uri_part) |
| static bool | rest_block_filter (const std::any &context, HTTPRequest *req, const std::string &uri_part) |
| RPCHelpMan | getblockchaininfo () |
| static bool | rest_chaininfo (const std::any &context, HTTPRequest *req, const std::string &uri_part) |
| RPCHelpMan | getdeploymentinfo () |
| static bool | rest_deploymentinfo (const std::any &context, HTTPRequest *req, const std::string &str_uri_part) |
| static bool | rest_mempool (const std::any &context, HTTPRequest *req, const std::string &str_uri_part) |
| static bool | rest_tx (const std::any &context, HTTPRequest *req, const std::string &uri_part) |
| static bool | rest_getutxos (const std::any &context, HTTPRequest *req, const std::string &uri_part) |
| static bool | rest_blockhash_by_height (const std::any &context, HTTPRequest *req, const std::string &str_uri_part) |
| void | StartREST (const std::any &context) |
| Start HTTP REST subsystem. | |
| void | InterruptREST () |
| Interrupt RPC REST subsystem. | |
| void | StopREST () |
| Stop HTTP REST subsystem. | |
| CTransactionRef | GetTransaction (const CBlockIndex *block_index, const CTxMemPool *mempool, const Txid &hash, const BlockManager &blockman, uint256 &hashBlock) |
| Return transaction with a given hash. | |
| std::vector< std::string > | SplitString (std::string_view str, char sep) |
Variables | |
| static const size_t | MAX_GETUTXOS_OUTPOINTS = 15 |
| static constexpr unsigned int | MAX_REST_HEADERS_RESULTS = 2000 |
| struct { | |
| RESTResponseFormat rf | |
| const char * name | |
| } | rf_names [] |
| struct { | |
| const char * prefix | |
| bool(* handler )(const std::any &context, HTTPRequest *req, const std::string &strReq) | |
| } | uri_prefixes [] |
|
static |
|
static |
|
static |
| RPCHelpMan getblockchaininfo | ( | ) |
Definition at line 1364 of file blockchain.cpp.
|
static |
Get the node context chainstatemanager.
| [in] | req | The HTTP request, whose status code will be set if node context chainstatemanager is not found. |
Definition at line 118 of file rest.cpp.
| RPCHelpMan getdeploymentinfo | ( | ) |
Definition at line 1489 of file blockchain.cpp.
|
static |
Get the node context mempool.
| [in] | req | The HTTP request, whose status code will be set if node context mempool is not found. |
Definition at line 101 of file rest.cpp.
|
static |
Get the node context.
| [in] | req | The HTTP request, whose status code will be set if node context is not found. |
Definition at line 84 of file rest.cpp.
| CTransactionRef node::GetTransaction | ( | const CBlockIndex *const | block_index, |
| const CTxMemPool *const | mempool, | ||
| const Txid & | hash, | ||
| const BlockManager & | blockman, | ||
| uint256 & | hashBlock ) |
Return transaction with a given hash.
If mempool is provided and block_index is not provided, check it first for the tx. If -txindex is available, check it next for the tx. Finally, if block_index is provided, check for tx by reading entire block from disk.
| [in] | block_index | The block to read from disk, or nullptr |
| [in] | mempool | If provided, check mempool for tx |
| [in] | hash | The txid |
| [in] | blockman | Used to access and read blocks from disk |
| [out] | hashBlock | The block hash, if the tx was found via -txindex or block_index |
Definition at line 143 of file transaction.cpp.
| void InterruptREST | ( | ) |
| RESTResponseFormat ParseDataFormat | ( | std::string & | param, |
| const std::string & | strReq ) |
Parse a URI to get the data format and URI without data format and query string.
| [out] | param | The strReq without the data format string and without the query string (if any). |
| [in] | strReq | The URI to be parsed. |
Definition at line 128 of file rest.cpp.
|
static |
This handler is used by multiple HTTP endpoints:
Definition at line 388 of file rest.cpp.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inlinenodiscard |
| void StartREST | ( | const std::any & | context | ) |
| void StopREST | ( | ) |
| bool(* handler) (const std::any &context, HTTPRequest *req, const std::string &strReq) | ( | const std::any & | context, |
| HTTPRequest * | req, | ||
| const std::string & | strReq ) |
|
staticconstexpr |
| const struct { ... } rf_names[] |
| const struct { ... } uri_prefixes[] |