PIVX Core  5.6.99
P2P Digital Currency
Classes | Namespaces | Typedefs | Functions | Variables
server.h File Reference
#include "amount.h"
#include "rpc/protocol.h"
#include "uint256.h"
#include <list>
#include <map>
#include <stdint.h>
#include <string>
#include <univalue.h>
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

struct  UniValueType
 Wrapper for UniValue::VType, which includes typeAny: Used to denote don't care type. More...
 
class  JSONRPCRequest
 
class  RPCTimerBase
 Opaque base class for timers returned by NewTimerFunc. More...
 
class  RPCTimerInterface
 RPC timer "driver". More...
 
class  CRPCCommand
 
class  CRPCTable
 PIVX RPC command dispatcher. More...
 

Namespaces

 RPCServer
 

Typedefs

typedef UniValue(* rpcfn_type) (const JSONRPCRequest &jsonRequest)
 

Functions

void RPCServer::OnStarted (std::function< void()> slot)
 
void RPCServer::OnStopped (std::function< void()> slot)
 
void RPCServer::OnPreCommand (std::function< void(const CRPCCommand &)> slot)
 
bool IsRPCRunning ()
 Query whether RPC is running. More...
 
void SetRPCWarmupStatus (const std::string &newStatus)
 Set the RPC warmup status. More...
 
void SetRPCWarmupFinished ()
 
bool RPCIsInWarmup (std::string *statusOut)
 
void RPCTypeCheck (const UniValue &params, const std::list< UniValue::VType > &typesExpected, bool fAllowNull=false)
 Type-check arguments; throws JSONRPCError if wrong type given. More...
 
void RPCTypeCheckArgument (const UniValue &value, const UniValueType &typeExpected)
 Type-check one argument; throws JSONRPCError if wrong type given. More...
 
void RPCTypeCheckObj (const UniValue &o, const std::map< std::string, UniValueType > &typesExpected, bool fAllowNull=false, bool fStrict=false)
 Check for expected keys/value types in an Object. More...
 
void RPCSetTimerInterface (RPCTimerInterface *iface)
 Set factory function for timers. More...
 
void RPCSetTimerInterfaceIfUnset (RPCTimerInterface *iface)
 Set factory function for timers, but only if unset. More...
 
void RPCUnsetTimerInterface (RPCTimerInterface *iface)
 Unset factory function for timers. More...
 
void RPCRunLater (const std::string &name, std::function< void(void)> func, int64_t nSeconds)
 Run func nSeconds from now. More...
 
bool IsDeprecatedRPCEnabled (const std::string &method)
 
uint256 ParseHashV (const UniValue &v, std::string strName)
 Utilities: convert hex-encoded Values (throws error if not hex). More...
 
uint256 ParseHashO (const UniValue &o, std::string strKey)
 
std::vector< unsigned char > ParseHexV (const UniValue &v, std::string strName)
 
std::vector< unsigned char > ParseHexO (const UniValue &o, std::string strKey)
 
int ParseInt (const UniValue &o, std::string strKey)
 
bool ParseBool (const UniValue &o, std::string strKey)
 
double ParseDoubleV (const UniValue &v, const std::string &strName)
 
CAmount AmountFromValue (const UniValue &value)
 
UniValue ValueFromAmount (const CAmount &amount)
 
double GetDifficulty (const CBlockIndex *blockindex=nullptr)
 
std::string HelpExampleCli (std::string methodname, std::string args)
 
std::string HelpExampleRpc (std::string methodname, std::string args)
 
bool StartRPC ()
 
void InterruptRPC ()
 
void StopRPC ()
 
std::string JSONRPCExecBatch (const UniValue &vReq)
 
void RPCNotifyBlockChange (bool fInitialDownload, const CBlockIndex *pindex)
 

Variables

CRPCTable tableRPC
 

Typedef Documentation

◆ rpcfn_type

typedef UniValue(* rpcfn_type) (const JSONRPCRequest &jsonRequest)

Definition at line 131 of file server.h.

Function Documentation

◆ AmountFromValue()

CAmount AmountFromValue ( const UniValue value)

Definition at line 116 of file server.cpp.

Here is the call graph for this function:

◆ GetDifficulty()

double GetDifficulty ( const CBlockIndex blockindex = nullptr)

Definition at line 67 of file blockchain.cpp.

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

◆ HelpExampleCli()

std::string HelpExampleCli ( std::string  methodname,
std::string  args 
)

Definition at line 527 of file server.cpp.

◆ HelpExampleRpc()

std::string HelpExampleRpc ( std::string  methodname,
std::string  args 
)

Definition at line 532 of file server.cpp.

◆ InterruptRPC()

void InterruptRPC ( )

Definition at line 336 of file server.cpp.

Here is the caller graph for this function:

◆ IsDeprecatedRPCEnabled()

bool IsDeprecatedRPCEnabled ( const std::string &  method)

Definition at line 407 of file server.cpp.

Here is the call graph for this function:

◆ IsRPCRunning()

bool IsRPCRunning ( )

Query whether RPC is running.

Definition at line 351 of file server.cpp.

Here is the caller graph for this function:

◆ JSONRPCExecBatch()

std::string JSONRPCExecBatch ( const UniValue vReq)

Definition at line 434 of file server.cpp.

Here is the call graph for this function:

◆ ParseBool()

bool ParseBool ( const UniValue o,
std::string  strKey 
)

Definition at line 183 of file server.cpp.

Here is the call graph for this function:

◆ ParseDoubleV()

double ParseDoubleV ( const UniValue v,
const std::string &  strName 
)

Definition at line 174 of file server.cpp.

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

◆ ParseHashO()

uint256 ParseHashO ( const UniValue o,
std::string  strKey 
)

Definition at line 147 of file server.cpp.

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

◆ ParseHashV()

uint256 ParseHashV ( const UniValue v,
std::string  strName 
)

Utilities: convert hex-encoded Values (throws error if not hex).

Definition at line 138 of file server.cpp.

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

◆ ParseHexO()

std::vector<unsigned char> ParseHexO ( const UniValue o,
std::string  strKey 
)

Definition at line 160 of file server.cpp.

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

◆ ParseHexV()

std::vector<unsigned char> ParseHexV ( const UniValue v,
std::string  strName 
)

Definition at line 151 of file server.cpp.

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

◆ ParseInt()

int ParseInt ( const UniValue o,
std::string  strKey 
)

Definition at line 165 of file server.cpp.

Here is the call graph for this function:

◆ RPCIsInWarmup()

bool RPCIsInWarmup ( std::string *  statusOut)

Definition at line 369 of file server.cpp.

Here is the caller graph for this function:

◆ RPCNotifyBlockChange()

void RPCNotifyBlockChange ( bool  fInitialDownload,
const CBlockIndex pindex 
)

Definition at line 274 of file blockchain.cpp.

Here is the caller graph for this function:

◆ RPCRunLater()

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

Run func nSeconds from now.

Overrides previous timer <name> (if any).

Definition at line 556 of file server.cpp.

Here is the caller graph for this function:

◆ RPCSetTimerInterface()

void RPCSetTimerInterface ( RPCTimerInterface iface)

Set factory function for timers.

Definition at line 545 of file server.cpp.

◆ RPCSetTimerInterfaceIfUnset()

void RPCSetTimerInterfaceIfUnset ( RPCTimerInterface iface)

Set factory function for timers, but only if unset.

Definition at line 539 of file server.cpp.

Here is the caller graph for this function:

◆ RPCTypeCheck()

void RPCTypeCheck ( const UniValue params,
const std::list< UniValue::VType > &  typesExpected,
bool  fAllowNull = false 
)

Type-check arguments; throws JSONRPCError if wrong type given.

Does not check that the right number of arguments are passed, just that any passed are the correct type.

Definition at line 63 of file server.cpp.

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

◆ RPCTypeCheckArgument()

void RPCTypeCheckArgument ( const UniValue value,
const UniValueType typeExpected 
)

Type-check one argument; throws JSONRPCError if wrong type given.

Definition at line 82 of file server.cpp.

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

◆ RPCTypeCheckObj()

void RPCTypeCheckObj ( const UniValue o,
const std::map< std::string, UniValueType > &  typesExpected,
bool  fAllowNull = false,
bool  fStrict = false 
)

Check for expected keys/value types in an Object.

Definition at line 89 of file server.cpp.

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

◆ RPCUnsetTimerInterface()

void RPCUnsetTimerInterface ( RPCTimerInterface iface)

Unset factory function for timers.

Definition at line 550 of file server.cpp.

Here is the caller graph for this function:

◆ SetRPCWarmupFinished()

void SetRPCWarmupFinished ( )

Definition at line 362 of file server.cpp.

◆ 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 356 of file server.cpp.

◆ StartRPC()

bool StartRPC ( )

Definition at line 328 of file server.cpp.

Here is the caller graph for this function:

◆ StopRPC()

void StopRPC ( )

Definition at line 343 of file server.cpp.

◆ ValueFromAmount()

UniValue ValueFromAmount ( const CAmount amount)

Definition at line 128 of file server.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ tableRPC

CRPCTable tableRPC
extern

Definition at line 565 of file server.cpp.