Bitcoin ABC  0.22.13
P2P Digital Currency
Classes | Namespaces | Typedefs | Functions | Variables
server.h File Reference
#include <amount.h>
#include <rpc/command.h>
#include <rpc/request.h>
#include <rwcollection.h>
#include <util/system.h>
#include <univalue.h>
#include <boost/noncopyable.hpp>
#include <cstdint>
#include <functional>
#include <map>
#include <string>
Include dependency graph for server.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  RPCServer
 Class for registering and managing all RPC calls. More...
 
class  RPCTimerBase
 Opaque base class for timers returned by NewTimerFunc. More...
 
class  RPCTimerInterface
 RPC timer "driver". More...
 
class  CRPCCommand
 
class  CRPCTable
 Bitcoin RPC command dispatcher. More...
 

Namespaces

 RPCServerSignals
 

Typedefs

typedef std::map< std::string, std::unique_ptr< RPCCommand > > RPCCommandMap
 
using rpcfn_type = UniValue(*)(Config &config, const JSONRPCRequest &jsonRequest)
 
using const_rpcfn_type = UniValue(*)(const Config &config, const JSONRPCRequest &jsonRequest)
 

Functions

void RPCServerSignals::OnStarted (std::function< void()> slot)
 
void RPCServerSignals::OnStopped (std::function< void()> slot)
 
bool IsRPCRunning ()
 Query whether RPC is running. More...
 
void RpcInterruptionPoint ()
 Throw JSONRPCError if RPC is not running. More...
 
void SetRPCWarmupStatus (const std::string &newStatus)
 Set the RPC warmup status. More...
 
void SetRPCWarmupFinished ()
 Mark warmup as done. More...
 
bool RPCIsInWarmup (std::string *outStatus)
 Returns the current warmup state. More...
 
void RPCSetTimerInterface (RPCTimerInterface *iface)
 Set the factory function for timers. More...
 
void RPCSetTimerInterfaceIfUnset (RPCTimerInterface *iface)
 Set the factory function for timer, but only, if unset. More...
 
void RPCUnsetTimerInterface (RPCTimerInterface *iface)
 Unset factory function for timers. More...
 
void RPCRunLater (const std::string &name, std::function< void()> func, int64_t nSeconds)
 Run func nSeconds from now. More...
 
bool IsDeprecatedRPCEnabled (const ArgsManager &args, const std::string &method)
 
void StartRPC ()
 
void InterruptRPC ()
 
void StopRPC ()
 
std::string JSONRPCExecBatch (Config &config, RPCServer &rpcServer, const JSONRPCRequest &req, const UniValue &vReq)
 
int RPCSerializationFlags ()
 Retrieves any serialization flags requested in command line argument. More...
 

Variables

static const unsigned int DEFAULT_RPC_SERIALIZE_VERSION = 1
 
CRPCTable tableRPC
 

Typedef Documentation

◆ const_rpcfn_type

using const_rpcfn_type = UniValue (*)(const Config &config, const JSONRPCRequest &jsonRequest)

Definition at line 146 of file server.h.

◆ RPCCommandMap

typedef std::map<std::string, std::unique_ptr<RPCCommand> > RPCCommandMap

Definition at line 34 of file server.h.

◆ rpcfn_type

using rpcfn_type = UniValue (*)(Config &config, const JSONRPCRequest &jsonRequest)

Definition at line 144 of file server.h.

Function Documentation

◆ InterruptRPC()

void InterruptRPC ( )

Definition at line 345 of file server.cpp.

Here is the caller graph for this function:

◆ IsDeprecatedRPCEnabled()

bool IsDeprecatedRPCEnabled ( const ArgsManager args,
const std::string &  method 
)

Definition at line 387 of file server.cpp.

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

◆ IsRPCRunning()

bool IsRPCRunning ( )

Query whether RPC is running.

Definition at line 358 of file server.cpp.

Here is the caller graph for this function:

◆ JSONRPCExecBatch()

std::string JSONRPCExecBatch ( Config config,
RPCServer rpcServer,
const JSONRPCRequest req,
const UniValue vReq 
)

Definition at line 415 of file server.cpp.

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

◆ RpcInterruptionPoint()

void RpcInterruptionPoint ( )

Throw JSONRPCError if RPC is not running.

Definition at line 362 of file server.cpp.

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

◆ RPCIsInWarmup()

bool RPCIsInWarmup ( std::string *  outStatus)

Returns the current warmup state.

Definition at line 379 of file server.cpp.

Here is the caller graph for this function:

◆ RPCRunLater()

void RPCRunLater ( const std::string &  name,
std::function< void()>  func,
int64_t  nSeconds 
)

Run func nSeconds from now.

Overrides previous timer <name> (if any).

Definition at line 544 of file server.cpp.

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

◆ RPCSerializationFlags()

int RPCSerializationFlags ( )

Retrieves any serialization flags requested in command line argument.

Definition at line 559 of file server.cpp.

Here is the caller graph for this function:

◆ RPCSetTimerInterface()

void RPCSetTimerInterface ( RPCTimerInterface iface)

Set the factory function for timers.

Definition at line 534 of file server.cpp.

Here is the caller graph for this function:

◆ RPCSetTimerInterfaceIfUnset()

void RPCSetTimerInterfaceIfUnset ( RPCTimerInterface iface)

Set the factory function for timer, but only, if unset.

Definition at line 528 of file server.cpp.

Here is the caller graph for this function:

◆ RPCUnsetTimerInterface()

void RPCUnsetTimerInterface ( RPCTimerInterface iface)

Unset factory function for timers.

Definition at line 538 of file server.cpp.

Here is the caller graph for this function:

◆ SetRPCWarmupFinished()

void SetRPCWarmupFinished ( )

Mark warmup as done.

RPC calls will be processed from now on.

Definition at line 373 of file server.cpp.

Here is the caller graph for this function:

◆ SetRPCWarmupStatus()

void SetRPCWarmupStatus ( const std::string &  newStatus)

Set the RPC warmup status.

When this is done, all RPC calls will error out immediately with RPC_IN_WARMUP.

Definition at line 368 of file server.cpp.

Here is the caller graph for this function:

◆ StartRPC()

void StartRPC ( )

Definition at line 339 of file server.cpp.

Here is the caller graph for this function:

◆ StopRPC()

void StopRPC ( )

Definition at line 351 of file server.cpp.

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

Variable Documentation

◆ DEFAULT_RPC_SERIALIZE_VERSION

const unsigned int DEFAULT_RPC_SERIALIZE_VERSION = 1
static

Definition at line 25 of file server.h.

◆ tableRPC

CRPCTable tableRPC

Definition at line 563 of file server.cpp.