Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <chain.h>#include <chainparams.h>#include <core_io.h>#include <primitives/block.h>#include <primitives/transaction.h>#include <validation.h>#include <httpserver.h>#include <rpc/blockchain.h>#include <rpc/server.h>#include <streams.h>#include <sync.h>#include <txmempool.h>#include <utilstrencodings.h>#include <version.h>#include <boost/algorithm/string.hpp>#include <univalue.h>
Include dependency graph for rest.cpp:Go to the source code of this file.
Classes | |
| struct | CCoin |
Enumerations | |
| enum | RetFormat { RF_UNDEF, RF_BINARY, RF_HEX, RF_JSON } |
Functions | |
| static bool | RESTERR (HTTPRequest *req, enum HTTPStatusCode status, std::string message) |
| static enum RetFormat | ParseDataFormat (std::string ¶m, const std::string &strReq) |
| static std::string | AvailableDataFormatsString () |
| static bool | ParseHashStr (const std::string &strReq, uint256 &v) |
| static bool | CheckWarmup (HTTPRequest *req) |
| static bool | rest_headers (HTTPRequest *req, const std::string &strURIPart) |
| static bool | rest_block (HTTPRequest *req, const std::string &strURIPart, bool showTxDetails) |
| static bool | rest_block_extended (HTTPRequest *req, const std::string &strURIPart) |
| static bool | rest_block_notxdetails (HTTPRequest *req, const std::string &strURIPart) |
| UniValue | getblockchaininfo (const JSONRPCRequest &request) |
| static bool | rest_chaininfo (HTTPRequest *req, const std::string &strURIPart) |
| static bool | rest_mempool_info (HTTPRequest *req, const std::string &strURIPart) |
| static bool | rest_mempool_contents (HTTPRequest *req, const std::string &strURIPart) |
| static bool | rest_tx (HTTPRequest *req, const std::string &strURIPart) |
| static bool | rest_getutxos (HTTPRequest *req, const std::string &strURIPart) |
| bool | StartREST () |
| Start HTTP REST subsystem. More... | |
| void | InterruptREST () |
| Interrupt RPC REST subsystem. More... | |
| void | StopREST () |
| Stop HTTP REST subsystem. More... | |
Variables | |
| static const size_t | MAX_GETUTXOS_OUTPOINTS = 15 |
| struct { | |
| enum RetFormat rf | |
| const char * name | |
| } | rf_names [] |
| struct { | |
| const char * prefix | |
| bool(* handler )(HTTPRequest *req, const std::string &strReq) | |
| } | uri_prefixes [] |
Enumeration Type Documentation
◆ RetFormat
Function Documentation
◆ AvailableDataFormatsString()
|
static |
Definition at line 91 of file rest.cpp.
References ARRAYLEN, name, and rf_names.
Referenced by rest_block(), rest_getutxos(), and rest_tx().
◆ CheckWarmup()
|
static |
Definition at line 116 of file rest.cpp.
References HTTP_SERVICE_UNAVAILABLE, RESTERR(), and RPCIsInWarmup().
Referenced by rest_block(), rest_chaininfo(), rest_getutxos(), rest_headers(), rest_mempool_contents(), rest_mempool_info(), and rest_tx().
◆ getblockchaininfo()
| UniValue getblockchaininfo | ( | const JSONRPCRequest & | request | ) |
Definition at line 1404 of file blockchain.cpp.
References BIP9SoftForkDescPushBack(), BLOCK_HAVE_DATA, CalculateCurrentUsage(), chainActive, cs_main, Consensus::DEPLOYMENT_CSV, JSONRPCRequest::fHelp, fPruneMode, gArgs, ArgsManager::GetArg(), CBlockIndex::GetBlockHash(), CChainParams::GetConsensus(), GetDifficulty(), base_blob< BITS >::GetHex(), base_uint< BITS >::GetHex(), CBlockIndex::GetMedianTimePast(), GetWarnings(), GuessVerificationProgress(), CChain::Height(), HelpExampleCli(), HelpExampleRpc(), IsInitialBlockDownload(), LOCK, Consensus::MAX_VERSION_BITS_DEPLOYMENTS, CBlockIndex::nChainWork, CBlockIndex::nHeight, nPruneTarget, CBlockIndex::nStatus, Pair(), JSONRPCRequest::params, Params(), pindexBestHeader, CBlockIndex::pprev, UniValue::push_back(), UniValue::size(), SoftForkDesc(), CChain::Tip(), UniValue::VARR, and UniValue::VOBJ.
Referenced by rest_chaininfo().
◆ InterruptREST()
| void InterruptREST | ( | ) |
◆ ParseDataFormat()
|
static |
Definition at line 70 of file rest.cpp.
References ARRAYLEN, name, and rf_names.
Referenced by rest_block(), rest_chaininfo(), rest_getutxos(), rest_headers(), rest_mempool_contents(), rest_mempool_info(), and rest_tx().
◆ ParseHashStr()
|
static |
Definition at line 107 of file rest.cpp.
References IsHex(), and base_blob< BITS >::SetHex().
Referenced by rest_block(), rest_headers(), and rest_tx().
◆ rest_block()
|
static |
Definition at line 198 of file rest.cpp.
References AvailableDataFormatsString(), CDataStream::begin(), BLOCK_HAVE_DATA, blockToJSON(), CheckWarmup(), cs_main, CDataStream::end(), fHavePruned, HexStr(), HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_OK, LOCK, mapBlockIndex, CBlockIndex::nStatus, CBlockIndex::nTx, Params(), ParseDataFormat(), ParseHashStr(), PROTOCOL_VERSION, ReadBlockFromDisk(), RESTERR(), rf, RF_BINARY, RF_HEX, RF_JSON, SER_NETWORK, CDataStream::str(), UniValue::write(), HTTPRequest::WriteHeader(), and HTTPRequest::WriteReply().
Referenced by rest_block_extended(), and rest_block_notxdetails().
◆ rest_block_extended()
|
static |
Definition at line 262 of file rest.cpp.
References rest_block().
◆ rest_block_notxdetails()
|
static |
Definition at line 267 of file rest.cpp.
References rest_block().
◆ rest_chaininfo()
|
static |
Definition at line 275 of file rest.cpp.
References CheckWarmup(), getblockchaininfo(), HTTP_NOT_FOUND, HTTP_OK, JSONRPCRequest::params, ParseDataFormat(), RESTERR(), rf, RF_JSON, UniValue::VARR, UniValue::write(), HTTPRequest::WriteHeader(), and HTTPRequest::WriteReply().
◆ rest_getutxos()
|
static |
Definition at line 391 of file rest.cpp.
References AvailableDataFormatsString(), CDataStream::begin(), chainActive, CheckWarmup(), CTxMemPool::cs, cs_main, CDataStream::end(), CBlockIndex::GetBlockHash(), CCoinsViewCache::GetCoin(), base_blob< BITS >::GetHex(), CChain::Height(), HexStr(), HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_OK, IsHex(), CTxMemPool::isSpent(), LOCK2, MAX_GETUTXOS_OUTPOINTS, mempool, Pair(), ParseDataFormat(), ParseHex(), ParseInt32(), pcoinsTip, PROTOCOL_VERSION, UniValue::push_back(), HTTPRequest::ReadBody(), RESTERR(), rf, RF_BINARY, RF_HEX, RF_JSON, ScriptPubKeyToUniv(), SER_NETWORK, CCoinsViewBacked::SetBackend(), base_blob< BITS >::SetHex(), CDataStream::str(), strprintf, CChain::Tip(), ValueFromAmount(), UniValue::VARR, UniValue::VOBJ, UniValue::write(), HTTPRequest::WriteHeader(), and HTTPRequest::WriteReply().
◆ rest_headers()
|
static |
Definition at line 124 of file rest.cpp.
References CDataStream::begin(), blockheaderToJSON(), chainActive, CheckWarmup(), CChain::Contains(), count, cs_main, CDataStream::end(), HexStr(), HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_OK, LOCK, mapBlockIndex, CChain::Next(), ParseDataFormat(), ParseHashStr(), PROTOCOL_VERSION, UniValue::push_back(), RESTERR(), rf, RF_BINARY, RF_HEX, RF_JSON, SER_NETWORK, CDataStream::str(), UniValue::VARR, while(), UniValue::write(), HTTPRequest::WriteHeader(), and HTTPRequest::WriteReply().
◆ rest_mempool_contents()
|
static |
Definition at line 320 of file rest.cpp.
References CheckWarmup(), HTTP_NOT_FOUND, HTTP_OK, mempoolToJSON(), ParseDataFormat(), RESTERR(), rf, RF_JSON, UniValue::write(), HTTPRequest::WriteHeader(), and HTTPRequest::WriteReply().
◆ rest_mempool_info()
|
static |
Definition at line 298 of file rest.cpp.
References CheckWarmup(), HTTP_NOT_FOUND, HTTP_OK, mempoolInfoToJSON(), ParseDataFormat(), RESTERR(), rf, RF_JSON, UniValue::write(), HTTPRequest::WriteHeader(), and HTTPRequest::WriteReply().
◆ rest_tx()
|
static |
Definition at line 342 of file rest.cpp.
References AvailableDataFormatsString(), CDataStream::begin(), CheckWarmup(), CDataStream::end(), GetTransaction(), HexStr(), HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_OK, Params(), ParseDataFormat(), ParseHashStr(), PROTOCOL_VERSION, RESTERR(), rf, RF_BINARY, RF_HEX, RF_JSON, SER_NETWORK, CDataStream::str(), TxToUniv(), UniValue::VOBJ, UniValue::write(), HTTPRequest::WriteHeader(), and HTTPRequest::WriteReply().
◆ RESTERR()
|
static |
Definition at line 63 of file rest.cpp.
References HTTPRequest::WriteHeader(), and HTTPRequest::WriteReply().
Referenced by CheckWarmup(), rest_block(), rest_chaininfo(), rest_getutxos(), rest_headers(), rest_mempool_contents(), rest_mempool_info(), and rest_tx().
◆ StartREST()
| bool StartREST | ( | ) |
Start HTTP REST subsystem.
Precondition; HTTP and RPC has been started.
Definition at line 587 of file rest.cpp.
References ARRAYLEN, handler, prefix, RegisterHTTPHandler(), and uri_prefixes.
Referenced by AppInitServers().
◆ StopREST()
| void StopREST | ( | ) |
Stop HTTP REST subsystem.
Precondition; HTTP and RPC has been stopped.
Definition at line 598 of file rest.cpp.
References ARRAYLEN, prefix, UnregisterHTTPHandler(), and uri_prefixes.
Referenced by PrepareShutdown().
Variable Documentation
◆ handler
| bool(* handler) (HTTPRequest *req, const std::string &strReq) |
Definition at line 575 of file rest.cpp.
Referenced by RegisterHTTPHandler(), registerSignalHandler(), and StartREST().
◆ MAX_GETUTXOS_OUTPOINTS
|
static |
Definition at line 25 of file rest.cpp.
Referenced by rest_getutxos().
◆ name
| const char* name |
Definition at line 36 of file rest.cpp.
Referenced by WalletFrame::addWallet(), CRPCTable::appendCommand(), AppInitParameterInteraction(), AvailableDataFormatsString(), benchmark::BenchRunner::BenchRunner(), BIP9SoftForkDescPushBack(), CRPCConvertTable::convert(), CWallet::CreateWalletFromFile(), DemangleSymbol(), find_value(), FormatSubVersion(), GetOSRand(), GetProxySetting(), GetThreadName(), GetWallet(), HandlePosixSignal(), ipcServerName(), benchmark::State::KeepRunning(), CRPCTable::operator[](), ParseDataFormat(), ParseScript(), PaymentServer::PaymentServer(), CBlockTreeDB::ReadFlag(), RegisterEvoRPCCommands(), WalletFrame::removeWallet(), RenameThread(), RPCConvertNamedValues(), RPCRunLater(), run_benchmark(), WalletFrame::setCurrentWallet(), CNetAddr::SetInternal(), SetProxySetting(), SoftForkDesc(), llmq::CDKGDebugSessionStatus::ToJson(), CNetAddr::ToStringIP(), TraceThread(), and CBlockTreeDB::WriteFlag().
◆ prefix
| const char* prefix |
Definition at line 574 of file rest.cpp.
Referenced by GetBlockPosFilename(), CWallet::GetDestValues(), OpenDiskFile(), RegisterHTTPHandler(), runtest(), StartREST(), StopREST(), and UnregisterHTTPHandler().
◆ rf
| enum RetFormat rf |
Definition at line 35 of file rest.cpp.
Referenced by rest_block(), rest_chaininfo(), rest_getutxos(), rest_headers(), rest_mempool_contents(), rest_mempool_info(), and rest_tx().
◆ rf_names
| const { ... } rf_names[] |
Referenced by AvailableDataFormatsString(), and ParseDataFormat().
◆ uri_prefixes
| const { ... } uri_prefixes[] |
Referenced by StartREST(), and StopREST().

