Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <fs.h>
#include <list>
#include <map>
#include <stdint.h>
#include <string>
#include <univalue.h>
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) |
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, size_t num) |
Parse JSON-RPC batch reply into a vector. More... | |
Enumeration Type Documentation
◆ HTTPStatusCode
enum HTTPStatusCode |
HTTP status codes.
Enumerator | |
---|---|
HTTP_OK | |
HTTP_BAD_REQUEST | |
HTTP_UNAUTHORIZED | |
HTTP_FORBIDDEN | |
HTTP_NOT_FOUND | |
HTTP_BAD_METHOD | |
HTTP_INTERNAL_SERVER_ERROR | |
HTTP_SERVICE_UNAVAILABLE |
Definition at line 19 of file protocol.h.
◆ RPCErrorCode
enum RPCErrorCode |
Dash Core RPC error codes.
Definition at line 32 of file protocol.h.
Function Documentation
◆ DeleteAuthCookie()
void DeleteAuthCookie | ( | ) |
Delete RPC authentication cookie from disk.
Definition at line 128 of file protocol.cpp.
References GetAuthCookieFile(), and LogPrintf.
Referenced by StopRPC().
◆ 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 79 of file protocol.cpp.
References COOKIEAUTH_USER, GetAuthCookieFile(), GetRandBytes(), HexStr(), LogPrintf, and RenameOver().
Referenced by InitRPCAuthentication().
◆ GetAuthCookie()
bool GetAuthCookie | ( | std::string * | cookie_out | ) |
Read the RPC authentication cookie from disk.
Definition at line 112 of file protocol.cpp.
References GetAuthCookieFile().
Referenced by CallRPC().
◆ JSONRPCError()
UniValue JSONRPCError | ( | int | code, |
const std::string & | message | ||
) |
Definition at line 54 of file protocol.cpp.
References error(), Pair(), and UniValue::VOBJ.
Referenced by abandontransaction(), AccountFromValue(), addnode(), AddrToPubKey(), AmountFromValue(), backupwallet(), BIP22ValidationResult(), bls_fromsecret(), clearbanned(), combinerawtransaction(), createmultisig(), CreateMultisigRedeemscript(), createrawtransaction(), decoderawtransaction(), disconnectnode(), dumphdinfo(), dumpprivkey(), dumpwallet(), encryptwallet(), EnsureWalletIsAvailable(), EnsureWalletIsUnlocked(), estimatefee(), estimaterawfee(), estimatesmartfee(), CRPCTable::execute(), fundrawtransaction(), getaccount(), GetAccountDestination(), getaddednodeinfo(), getaddressbalance(), getaddressdeltas(), getAddressesFromParams(), getaddressmempool(), getaddresstxids(), getaddressutxos(), getbalance(), getbestchainlock(), getblock(), GetBlockChecked(), getblockhash(), getblockhashes(), getblockheader(), getblockheaders(), getblockstats(), getblocktemplate(), getCategoryMask(), getchaintxstats(), getconnectioncount(), GetImportTimestamp(), getinfo_deprecated(), getmemoryinfo(), getmempoolancestors(), getmempooldescendants(), getmempoolentry(), getmerkleblocks(), getnettotals(), getnewaddress(), getpeerinfo(), getrawchangeaddress(), getrawtransaction(), getreceivedbyaddress(), getspecialtxes(), getspentinfo(), getsuperblockbudget(), gettransaction(), gettxoutproof(), gettxoutsetinfo(), GetWalletForJSONRPCRequest(), gobject_check(), gobject_get(), gobject_getcurrentvotes(), gobject_submit(), gobject_vote_conf(), HexToPubKey(), HTTPReq_JSONRPC(), importaddress(), importelectrumwallet(), importmulti(), importprivkey(), importprunedfunds(), importpubkey(), ImportScript(), importwallet(), invalidateblock(), JSONRPCExecOne(), keypoolrefill(), listaddressbalances(), listbanned(), listsinceblock(), listtransactions(), listunspent(), loadwallet(), lockunspent(), logging(), masternode_connect(), masternode_count(), masternode_status(), movecmd(), ObserveSafeMode(), JSONRPCRequest::parse(), ParseBLSPubKey(), ParseBLSSecretKey(), ParseBoolV(), ParseConfirmTarget(), ParseDoubleV(), ParseHashV(), ParseHexV(), ParseInt32V(), ParseInt64V(), ParsePubKeyIDFromAddress(), ping(), preciousblock(), ProcessImport(), protx_info(), protx_list(), pruneblockchain(), quorum_dkgsimerror(), quorum_dkgstatus(), quorum_info(), quorum_list(), quorum_memberof(), quorum_selectquorum(), quorum_sigs_cmd(), reconsiderblock(), removeprunedfunds(), rescanblockchain(), resendwallettransactions(), RPCRunLater(), RPCTypeCheckArgument(), RPCTypeCheckObj(), savemempool(), sendfrom(), sendmany(), SendMoney(), sendrawtransaction(), sendtoaddress(), setaccount(), setban(), setnetworkactive(), setprivatesendamount(), setprivatesendrounds(), signmessage(), signmessagewithprivkey(), signrawtransaction(), spork(), submitblock(), transformNamedArguments(), verifymessage(), verifytxoutproof(), voteraw(), VoteWithMasternodes(), walletlock(), walletpassphrase(), and walletpassphrasechange().
◆ JSONRPCProcessBatchReply()
Parse JSON-RPC batch reply into a vector.
Definition at line 137 of file protocol.cpp.
References UniValue::get_int(), UniValue::isArray(), UniValue::isObject(), and UniValue::size().
Referenced by GetinfoRequestHandler::ProcessReply().
◆ JSONRPCReply()
Definition at line 48 of file protocol.cpp.
References error(), JSONRPCReplyObj(), and UniValue::write().
Referenced by HTTPReq_JSONRPC(), and JSONErrorReply().
◆ JSONRPCReplyObj()
Definition at line 36 of file protocol.cpp.
References error(), NullUniValue, Pair(), UniValue::push_back(), and UniValue::VOBJ.
Referenced by JSONRPCExecOne(), JSONRPCReply(), and GetinfoRequestHandler::ProcessReply().
◆ JSONRPCRequestObj()
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 27 of file protocol.cpp.
References Pair(), UniValue::push_back(), and UniValue::VOBJ.
Referenced by GetinfoRequestHandler::PrepareRequest(), and DefaultRequestHandler::PrepareRequest().