7 #ifndef PIVX_RPC_PROTOCOL_H
8 #define PIVX_RPC_PROTOCOL_H
bool GetAuthCookie(std::string *cookie_out)
Read the RPC authentication cookie from disk.
fs::path GetAuthCookieFile()
Get name of RPC authentication cookie file.
std::string JSONRPCReply(const UniValue &result, const UniValue &error, const UniValue &id)
UniValue JSONRPCRequestObj(const std::string &strMethod, const UniValue ¶ms, const UniValue &id)
JSON-RPC protocol.
UniValue JSONRPCError(int code, const std::string &message)
void DeleteAuthCookie()
Delete RPC authentication cookie from disk.
HTTPStatusCode
HTTP status codes.
@ HTTP_SERVICE_UNAVAILABLE
@ HTTP_INTERNAL_SERVER_ERROR
bool GenerateAuthCookie(std::string *cookie_out)
Generate a new RPC authentication cookie and write it to disk.
UniValue JSONRPCReplyObj(const UniValue &result, const UniValue &error, const UniValue &id)
RPCErrorCode
PIVX RPC error codes.
@ RPC_CLIENT_NODE_NOT_CONNECTED
Node has not been added before.
@ RPC_WALLET_NOT_SPECIFIED
No wallet specified (error when there are multiple wallets loaded)
@ RPC_VERIFY_ALREADY_IN_CHAIN
Transaction or block was rejected by network rules.
@ RPC_WALLET_INVALID_LABEL_NAME
Not enough funds in wallet.
@ RPC_WALLET_UNLOCK_NEEDED
Keypool ran out, call keypoolrefill first.
@ RPC_WALLET_ALREADY_UNLOCKED
Failed to encrypt the wallet.
@ RPC_OUT_OF_MEMORY
Invalid address or key.
@ RPC_FORBIDDEN_BY_SAFE_MODE
std::exception thrown in command handling
@ RPC_CLIENT_INVALID_IP_OR_SUBNET
Node to disconnect not found in connected nodes.
@ RPC_MISC_ERROR
General application defined errors.
@ RPC_WALLET_INSUFFICIENT_FUNDS
Unspecified problem with wallet (key not found etc.)
@ RPC_CLIENT_NODE_ALREADY_ADDED
Still downloading initial blocks.
@ RPC_WALLET_WRONG_ENC_STATE
The wallet passphrase entered was incorrect.
@ RPC_WALLET_ENCRYPTION_FAILED
Command given in wrong wallet encryption state (encrypting an encrypted wallet etc....
@ RPC_TRANSACTION_ALREADY_IN_CHAIN
@ RPC_TYPE_ERROR
Server is in safe mode, and command is not allowed in safe mode.
@ RPC_TRANSACTION_REJECTED
@ RPC_TRANSACTION_ERROR
RPC method is deprecated.
@ RPC_METHOD_DEPRECATED
Client still warming up.
@ RPC_CLIENT_NOT_CONNECTED
P2P client errors.
@ RPC_INVALID_PARAMETER
Ran out of memory during operation.
@ RPC_IN_WARMUP
Transaction already in chain.
@ RPC_WALLET_ERROR
No valid connection manager instance found.
@ RPC_VERIFY_ERROR
Error parsing or validating structure in raw format.
@ RPC_WALLET_NOT_FOUND
Wallet is already unlocked.
@ RPC_WALLET_KEYPOOL_RAN_OUT
Invalid label name.
@ RPC_DATABASE_ERROR
Invalid, missing or duplicate parameter.
@ RPC_CLIENT_IN_INITIAL_DOWNLOAD
PIVX is not connected.
@ RPC_CLIENT_NODE_NOT_ADDED
Node is already added.
@ RPC_DESERIALIZATION_ERROR
Database error.
@ RPC_WALLET_PASSPHRASE_INCORRECT
Enter the wallet passphrase with walletpassphrase first.
@ RPC_INVALID_REQUEST
Standard JSON-RPC 2.0 errors.
@ RPC_VERIFY_REJECTED
General error during transaction or block submission.
@ RPC_INVALID_ADDRESS_OR_KEY
Unexpected type was passed as parameter.
@ RPC_CLIENT_P2P_DISABLED
Invalid IP/Subnet.
bool error(const char *fmt, const Args &... args)