PIVX Core  5.6.99
P2P Digital Currency
Functions
protocol.cpp File Reference
#include "rpc/protocol.h"
#include "random.h"
#include "tinyformat.h"
#include "util/system.h"
#include "utilstrencodings.h"
#include "utiltime.h"
Include dependency graph for protocol.cpp:

Go to the source code of this file.

Functions

UniValue JSONRPCRequestObj (const std::string &strMethod, const UniValue &params, const UniValue &id)
 JSON-RPC protocol. More...
 
UniValue JSONRPCReplyObj (const UniValue &result, const UniValue &error, const UniValue &id)
 
std::string JSONRPCReply (const UniValue &result, const UniValue &error, const UniValue &id)
 
UniValue JSONRPCError (int code, const std::string &message)
 
fs::path GetAuthCookieFile ()
 Get name of RPC authentication cookie file. More...
 
bool GenerateAuthCookie (std::string *cookie_out)
 Generate a new RPC authentication cookie and write it to disk. More...
 
bool GetAuthCookie (std::string *cookie_out)
 Read the RPC authentication cookie from disk. More...
 
void DeleteAuthCookie ()
 Delete RPC authentication cookie from disk. More...
 

Function Documentation

◆ DeleteAuthCookie()

void DeleteAuthCookie ( )

Delete RPC authentication cookie from disk.

Definition at line 116 of file protocol.cpp.

Here is the call graph for this function:

◆ GenerateAuthCookie()

bool GenerateAuthCookie ( std::string *  cookie_out)

Generate a new RPC authentication cookie and write it to disk.

the umask determines what permissions are used to create this file - these are set to 077 in init.cpp unless overridden with -sysperms.

Definition at line 74 of file protocol.cpp.

Here is the call graph for this function:

◆ GetAuthCookie()

bool GetAuthCookie ( std::string *  cookie_out)

Read the RPC authentication cookie from disk.

Definition at line 100 of file protocol.cpp.

Here is the call graph for this function:

◆ GetAuthCookieFile()

fs::path GetAuthCookieFile ( )

Get name of RPC authentication cookie file.

Definition at line 68 of file protocol.cpp.

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

◆ JSONRPCError()

UniValue JSONRPCError ( int  code,
const std::string &  message 
)

Definition at line 53 of file protocol.cpp.

Here is the call graph for this function:

◆ JSONRPCReply()

std::string JSONRPCReply ( const UniValue result,
const UniValue error,
const UniValue id 
)

Definition at line 47 of file protocol.cpp.

Here is the call graph for this function:

◆ JSONRPCReplyObj()

UniValue JSONRPCReplyObj ( const UniValue result,
const UniValue error,
const UniValue id 
)

Definition at line 35 of file protocol.cpp.

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

◆ JSONRPCRequestObj()

UniValue JSONRPCRequestObj ( const std::string &  strMethod,
const UniValue params,
const UniValue id 
)

JSON-RPC protocol.

PIVX speaks version 1.0 for maximum compatibility, but uses JSON-RPC 1.1/2.0 standards for parts of the 1.0 standard that were unspecified (HTTP errors and contents of 'error').

1.0 spec: http://json-rpc.org/wiki/specification 1.2 spec: http://jsonrpc.org/historical/json-rpc-over-http.html http://www.codeproject.com/KB/recipes/JSON_Spirit.aspx

Definition at line 26 of file protocol.cpp.

Here is the call graph for this function: