Bitcoin Core  0.18.99
P2P Digital Currency
Classes | Enumerations | Functions | Variables
rest.cpp File Reference
#include <attributes.h>
#include <chain.h>
#include <chainparams.h>
#include <core_io.h>
#include <httpserver.h>
#include <index/txindex.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <rpc/blockchain.h>
#include <rpc/protocol.h>
#include <rpc/server.h>
#include <streams.h>
#include <sync.h>
#include <txmempool.h>
#include <util/strencodings.h>
#include <validation.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 { RetFormat::UNDEF, RetFormat::BINARY, RetFormat::HEX, RetFormat::JSON }
 

Functions

static bool RESTERR (HTTPRequest *req, enum HTTPStatusCode status, std::string message)
 
static RetFormat ParseDataFormat (std::string &param, const std::string &strReq)
 
static std::string AvailableDataFormatsString ()
 
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)
 
static bool rest_blockhash_by_height (HTTPRequest *req, const std::string &str_uri_part)
 
void 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 {
   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

enum RetFormat
strong
Enumerator
UNDEF 
BINARY 
HEX 
JSON 

Definition at line 30 of file rest.cpp.

Function Documentation

◆ AvailableDataFormatsString()

static std::string AvailableDataFormatsString ( )
static

Definition at line 94 of file rest.cpp.

Here is the caller graph for this function:

◆ CheckWarmup()

static bool CheckWarmup ( HTTPRequest req)
static

Definition at line 110 of file rest.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getblockchaininfo()

UniValue getblockchaininfo ( const JSONRPCRequest request)

Definition at line 1257 of file blockchain.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InterruptREST()

void InterruptREST ( )

Interrupt RPC REST subsystem.

Definition at line 646 of file rest.cpp.

Here is the caller graph for this function:

◆ ParseDataFormat()

static RetFormat ParseDataFormat ( std::string &  param,
const std::string &  strReq 
)
static

Definition at line 73 of file rest.cpp.

Here is the caller graph for this function:

◆ rest_block()

static bool rest_block ( HTTPRequest req,
const std::string &  strURIPart,
bool  showTxDetails 
)
static

Definition at line 195 of file rest.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rest_block_extended()

static bool rest_block_extended ( HTTPRequest req,
const std::string &  strURIPart 
)
static

Definition at line 259 of file rest.cpp.

Here is the call graph for this function:

◆ rest_block_notxdetails()

static bool rest_block_notxdetails ( HTTPRequest req,
const std::string &  strURIPart 
)
static

Definition at line 264 of file rest.cpp.

Here is the call graph for this function:

◆ rest_blockhash_by_height()

static bool rest_blockhash_by_height ( HTTPRequest req,
const std::string &  str_uri_part 
)
static

Definition at line 579 of file rest.cpp.

Here is the call graph for this function:

◆ rest_chaininfo()

static bool rest_chaininfo ( HTTPRequest req,
const std::string &  strURIPart 
)
static

Definition at line 272 of file rest.cpp.

Here is the call graph for this function:

◆ rest_getutxos()

static bool rest_getutxos ( HTTPRequest req,
const std::string &  strURIPart 
)
static

Definition at line 395 of file rest.cpp.

Here is the call graph for this function:

◆ rest_headers()

static bool rest_headers ( HTTPRequest req,
const std::string &  strURIPart 
)
static

Definition at line 118 of file rest.cpp.

Here is the call graph for this function:

◆ rest_mempool_contents()

static bool rest_mempool_contents ( HTTPRequest req,
const std::string &  strURIPart 
)
static

Definition at line 317 of file rest.cpp.

Here is the call graph for this function:

◆ rest_mempool_info()

static bool rest_mempool_info ( HTTPRequest req,
const std::string &  strURIPart 
)
static

Definition at line 295 of file rest.cpp.

Here is the call graph for this function:

◆ rest_tx()

static bool rest_tx ( HTTPRequest req,
const std::string &  strURIPart 
)
static

Definition at line 339 of file rest.cpp.

Here is the call graph for this function:

◆ RESTERR()

static bool RESTERR ( HTTPRequest req,
enum HTTPStatusCode  status,
std::string  message 
)
static

Definition at line 66 of file rest.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartREST()

void StartREST ( )

Start HTTP REST subsystem.

Precondition; HTTP and RPC has been started.

Definition at line 640 of file rest.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StopREST()

void StopREST ( )

Stop HTTP REST subsystem.

Precondition; HTTP and RPC has been stopped.

Definition at line 650 of file rest.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ handler

bool(* handler) (HTTPRequest *req, const std::string &strReq)

Definition at line 627 of file rest.cpp.

◆ MAX_GETUTXOS_OUTPOINTS

const size_t MAX_GETUTXOS_OUTPOINTS = 15
static

Definition at line 28 of file rest.cpp.

◆ name

const char* name

Definition at line 39 of file rest.cpp.

◆ prefix

const char* prefix

Definition at line 626 of file rest.cpp.

◆ rf

Definition at line 38 of file rest.cpp.

◆ rf_names

const { ... } rf_names[]

◆ uri_prefixes

const { ... } uri_prefixes[]
Initial value:
= {
{"/rest/tx/", rest_tx},
{"/rest/block/notxdetails/", rest_block_notxdetails},
{"/rest/block/", rest_block_extended},
{"/rest/chaininfo", rest_chaininfo},
{"/rest/mempool/info", rest_mempool_info},
{"/rest/mempool/contents", rest_mempool_contents},
{"/rest/headers/", rest_headers},
{"/rest/getutxos", rest_getutxos},
{"/rest/blockhashbyheight/", rest_blockhash_by_height},
}
static bool rest_mempool_info(HTTPRequest *req, const std::string &strURIPart)
Definition: rest.cpp:295
static bool rest_chaininfo(HTTPRequest *req, const std::string &strURIPart)
Definition: rest.cpp:272
static bool rest_tx(HTTPRequest *req, const std::string &strURIPart)
Definition: rest.cpp:339
static bool rest_headers(HTTPRequest *req, const std::string &strURIPart)
Definition: rest.cpp:118
static bool rest_getutxos(HTTPRequest *req, const std::string &strURIPart)
Definition: rest.cpp:395
static bool rest_mempool_contents(HTTPRequest *req, const std::string &strURIPart)
Definition: rest.cpp:317
static bool rest_blockhash_by_height(HTTPRequest *req, const std::string &str_uri_part)
Definition: rest.cpp:579
static bool rest_block_notxdetails(HTTPRequest *req, const std::string &strURIPart)
Definition: rest.cpp:264
static bool rest_block_extended(HTTPRequest *req, const std::string &strURIPart)
Definition: rest.cpp:259