Raven Core  3.0.0
P2P Digital Currency
Classes | Functions | Variables
server.cpp File Reference
#include "rpc/server.h"
#include "base58.h"
#include "fs.h"
#include "init.h"
#include "random.h"
#include "sync.h"
#include "ui_interface.h"
#include "util.h"
#include "utilstrencodings.h"
#include "mining.h"
#include <univalue.h>
#include <boost/bind.hpp>
#include <boost/signals2/signal.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <memory>
#include <unordered_map>
#include "assets/assets.h"
Include dependency graph for server.cpp:

Go to the source code of this file.

Classes

struct  CRPCSignals
 

Functions

void RPCTypeCheck (const UniValue &params, const std::list< UniValue::VType > &typesExpected, bool fAllowNull)
 Type-check arguments; throws JSONRPCError if wrong type given. More...
 
void RPCTypeCheckArgument (const UniValue &value, UniValue::VType 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, bool fStrict)
 
CAmount AmountFromValue (const UniValue &value)
 
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)
 
UniValue help (const JSONRPCRequest &jsonRequest)
 
UniValue stop (const JSONRPCRequest &jsonRequest)
 
UniValue uptime (const JSONRPCRequest &jsonRequest)
 
bool StartRPC ()
 
void InterruptRPC ()
 
void StopRPC ()
 
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 *outStatus)
 
bool IsDeprecatedRPCEnabled (const std::string &method)
 
std::string JSONRPCExecBatch (const JSONRPCRequest &jreq, const UniValue &vReq)
 
std::string HelpExampleCli (const std::string &methodname, const std::string &args)
 
std::string HelpExampleRpc (const std::string &methodname, const std::string &args)
 
void RPCSetTimerInterfaceIfUnset (RPCTimerInterface *iface)
 Set the factory function for timer, but only, if unset. More...
 
void RPCSetTimerInterface (RPCTimerInterface *iface)
 Set the factory function for timers. 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...
 
int RPCSerializationFlags ()
 

Variables

CRPCTable tableRPC
 

Function Documentation

◆ AmountFromValue()

CAmount AmountFromValue ( const UniValue value)

Definition at line 113 of file server.cpp.

Here is the call graph for this function:

◆ help()

UniValue help ( const JSONRPCRequest jsonRequest)

Definition at line 216 of file server.cpp.

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

◆ HelpExampleCli()

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

Definition at line 522 of file server.cpp.

◆ HelpExampleRpc()

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

Definition at line 527 of file server.cpp.

◆ InterruptRPC()

void InterruptRPC ( )

Definition at line 321 of file server.cpp.

Here is the caller graph for this function:

◆ IsDeprecatedRPCEnabled()

bool IsDeprecatedRPCEnabled ( const std::string &  method)

Definition at line 391 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 336 of file server.cpp.

Here is the caller graph for this function:

◆ JSONRPCExecBatch()

std::string JSONRPCExecBatch ( const JSONRPCRequest jreq,
const UniValue vReq 
)

Definition at line 421 of file server.cpp.

Here is the call graph for this function:

◆ ParseHashO()

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

Definition at line 138 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 125 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 151 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 142 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)

Definition at line 354 of file server.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 550 of file server.cpp.

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

◆ RPCSerializationFlags()

int RPCSerializationFlags ( )

Definition at line 559 of file server.cpp.

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

◆ RPCSetTimerInterface()

void RPCSetTimerInterface ( RPCTimerInterface iface)

Set the factory function for timers.

Definition at line 539 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 533 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 58 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,
UniValue::VType  typeExpected 
)

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

Definition at line 76 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,
bool  fStrict 
)

Definition at line 83 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 544 of file server.cpp.

Here is the caller graph for this function:

◆ SetRPCWarmupFinished()

void SetRPCWarmupFinished ( )

Definition at line 347 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 341 of file server.cpp.

Here is the caller graph for this function:

◆ StartRPC()

bool StartRPC ( )

Definition at line 313 of file server.cpp.

Here is the caller graph for this function:

◆ stop()

UniValue stop ( const JSONRPCRequest jsonRequest)

Definition at line 236 of file server.cpp.

Here is the call graph for this function:

◆ StopRPC()

void StopRPC ( )

Definition at line 328 of file server.cpp.

Here is the caller graph for this function:

◆ uptime()

UniValue uptime ( const JSONRPCRequest jsonRequest)

Definition at line 249 of file server.cpp.

Here is the call graph for this function:

Variable Documentation

◆ tableRPC

CRPCTable tableRPC

Definition at line 567 of file server.cpp.