Fabcoin Core  0.16.2
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 <httpserver.h>
#include <mutex>
#include <condition_variable>
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  CUpdatedBlock
 
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
 Fabcoin 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)
 
void RPCServer::OnPostCommand (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 *outStatus)
 
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, 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=false, bool fStrict=false)
 
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(void)> func, int64_t nSeconds)
 Run func nSeconds from now. More...
 
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)
 
CAmount AmountFromValue (const UniValue &value)
 
UniValue ValueFromAmount (const CAmount &amount)
 
double GetDifficulty (const CBlockIndex *blockindex)
 Get the difficulty of the net wrt to the given block index, or the chain tip if not provided. More...
 
double GetPoWMHashPS ()
 
std::string HelpRequiringPassphrase ()
 
std::string HelpExampleCli (const std::string &methodname, const std::string &args)
 
std::string HelpExampleRpc (const std::string &methodname, const std::string &args)
 
void EnsureWalletIsUnlocked ()
 
bool StartRPC ()
 
void InterruptRPC ()
 
void StopRPC ()
 
std::string JSONRPCExecBatch (const UniValue &vReq)
 
void RPCNotifyBlockChange (bool ibd, const CBlockIndex *)
 Callback for when block tip changed. More...
 
int RPCSerializationFlags ()
 

Variables

CRPCTable tableRPC
 
int64_t nWalletUnlockTime
 

Typedef Documentation

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

Definition at line 185 of file server.h.

Function Documentation

CAmount AmountFromValue ( const UniValue value)

Definition at line 114 of file server.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void EnsureWalletIsUnlocked ( )

Here is the caller graph for this function:

double GetDifficulty ( const CBlockIndex blockindex)

Get the difficulty of the net wrt to the given block index, or the chain tip if not provided.

Returns
A floating point number that is a multiple of the main net minimum difficulty (4295032833 hashes).

Definition at line 105 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 554 of file server.cpp.

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

Definition at line 559 of file server.cpp.

std::string HelpRequiringPassphrase ( )

Here is the caller graph for this function:

void InterruptRPC ( )

Definition at line 320 of file server.cpp.

Here is the caller graph for this function:

bool IsRPCRunning ( )

Query whether RPC is running.

Definition at line 335 of file server.cpp.

Here is the caller graph for this function:

std::string JSONRPCExecBatch ( const UniValue vReq)

Definition at line 453 of file server.cpp.

Here is the call graph for this function:

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

Definition at line 139 of file server.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 126 of file server.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 152 of file server.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 143 of file server.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RPCIsInWarmup ( std::string *  outStatus)

Definition at line 353 of file server.cpp.

Here is the caller graph for this function:

void RPCNotifyBlockChange ( bool  ibd,
const CBlockIndex  
)

Callback for when block tip changed.

Definition at line 308 of file blockchain.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

int RPCSerializationFlags ( )

Definition at line 591 of file server.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RPCSetTimerInterface ( RPCTimerInterface iface)

Set the factory function for timers.

Definition at line 571 of file server.cpp.

Here is the caller graph for this function:

void RPCSetTimerInterfaceIfUnset ( RPCTimerInterface iface)

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

Definition at line 565 of file server.cpp.

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

void RPCTypeCheckArgument ( const UniValue value,
UniValue::VType  typeExpected 
)

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

Definition at line 77 of file server.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 84 of file server.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RPCUnsetTimerInterface ( RPCTimerInterface iface)

Unset factory function for timers.

Definition at line 576 of file server.cpp.

Here is the caller graph for this function:

void SetRPCWarmupFinished ( )

Definition at line 346 of file server.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the caller graph for this function:

bool StartRPC ( )

Definition at line 312 of file server.cpp.

Here is the caller graph for this function:

void StopRPC ( )

Definition at line 327 of file server.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

UniValue ValueFromAmount ( const CAmount amount)

Definition at line 19 of file core_write.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

int64_t nWalletUnlockTime
CRPCTable tableRPC

Definition at line 599 of file server.cpp.