Bitcoin ABC 0.30.7
P2P Digital Currency
|
#include <rpc/request.h>
#include <common/args.h>
#include <logging.h>
#include <random.h>
#include <rpc/protocol.h>
#include <util/fs.h>
#include <util/fs_helpers.h>
#include <util/strencodings.h>
#include <fstream>
#include <stdexcept>
#include <string>
#include <vector>
Go to the source code of this file.
Functions | |
UniValue | JSONRPCRequestObj (const std::string &strMethod, const UniValue ¶ms, 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) |
static fs::path | GetAuthCookieFile (bool temp=false) |
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... | |
std::vector< UniValue > | JSONRPCProcessBatchReply (const UniValue &in) |
Parse JSON-RPC batch reply into a vector. More... | |
Variables | |
static const std::string | COOKIEAUTH_USER = "__cookie__" |
Username used when cookie authentication is in use (arbitrary, only for recognizability in debugging/logging purposes) More... | |
static const char *const | COOKIEAUTH_FILE = ".cookie" |
Default name for auth cookie file. More... | |
void DeleteAuthCookie | ( | ) |
Delete RPC authentication cookie from disk.
Definition at line 135 of file request.cpp.
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 82 of file request.cpp.
bool GetAuthCookie | ( | std::string * | cookie_out | ) |
Read the RPC authentication cookie from disk.
Definition at line 118 of file request.cpp.
|
static |
Get name of RPC authentication cookie file.
Definition at line 74 of file request.cpp.
UniValue JSONRPCError | ( | int | code, |
const std::string & | message | ||
) |
Parse JSON-RPC batch reply into a vector.
Definition at line 144 of file request.cpp.
Definition at line 52 of file request.cpp.
Definition at line 39 of file request.cpp.
UniValue JSONRPCRequestObj | ( | const std::string & | strMethod, |
const UniValue & | params, | ||
const UniValue & | id | ||
) |
JSON-RPC protocol.
Bitcoin 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
Definition at line 30 of file request.cpp.
|
static |
Default name for auth cookie file.
Definition at line 71 of file request.cpp.
|
static |
Username used when cookie authentication is in use (arbitrary, only for recognizability in debugging/logging purposes)
Definition at line 69 of file request.cpp.