![]() |
PIVX Core
5.6.99
P2P Digital Currency
|
#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) |
| 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... | |
| 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 20 of file protocol.h.
| enum RPCErrorCode |
PIVX RPC error codes.
| Enumerator | |
|---|---|
| RPC_INVALID_REQUEST | Standard JSON-RPC 2.0 errors. |
| RPC_METHOD_NOT_FOUND | |
| RPC_INVALID_PARAMS | |
| RPC_INTERNAL_ERROR | |
| RPC_PARSE_ERROR | |
| RPC_MISC_ERROR | General application defined errors. |
| RPC_FORBIDDEN_BY_SAFE_MODE | std::exception thrown in command handling |
| RPC_TYPE_ERROR | Server is in safe mode, and command is not allowed in safe mode. |
| RPC_INVALID_ADDRESS_OR_KEY | Unexpected type was passed as parameter. |
| RPC_OUT_OF_MEMORY | Invalid address or key. |
| RPC_INVALID_PARAMETER | Ran out of memory during operation. |
| RPC_DATABASE_ERROR | Invalid, missing or duplicate parameter. |
| RPC_DESERIALIZATION_ERROR | Database error. |
| RPC_VERIFY_ERROR | Error parsing or validating structure in raw format. |
| RPC_VERIFY_REJECTED | General error during transaction or block submission. |
| RPC_VERIFY_ALREADY_IN_CHAIN | Transaction or block was rejected by network rules. |
| RPC_IN_WARMUP | Transaction already in chain. |
| RPC_METHOD_DEPRECATED | Client still warming up. |
| RPC_TRANSACTION_ERROR | RPC method is deprecated. Aliases for backward compatibility |
| RPC_TRANSACTION_REJECTED | |
| RPC_TRANSACTION_ALREADY_IN_CHAIN | |
| RPC_CLIENT_NOT_CONNECTED | P2P client errors. |
| RPC_CLIENT_IN_INITIAL_DOWNLOAD | PIVX is not connected. |
| RPC_CLIENT_NODE_ALREADY_ADDED | Still downloading initial blocks. |
| RPC_CLIENT_NODE_NOT_ADDED | Node is already added. |
| RPC_CLIENT_NODE_NOT_CONNECTED | Node has not been added before. |
| RPC_CLIENT_INVALID_IP_OR_SUBNET | Node to disconnect not found in connected nodes. |
| RPC_CLIENT_P2P_DISABLED | Invalid IP/Subnet. |
| RPC_WALLET_ERROR | No valid connection manager instance found. Wallet errors |
| RPC_WALLET_INSUFFICIENT_FUNDS | Unspecified problem with wallet (key not found etc.) |
| RPC_WALLET_INVALID_LABEL_NAME | Not enough funds in wallet. |
| RPC_WALLET_KEYPOOL_RAN_OUT | Invalid label name. |
| RPC_WALLET_UNLOCK_NEEDED | Keypool ran out, call keypoolrefill first. |
| RPC_WALLET_PASSPHRASE_INCORRECT | Enter the wallet passphrase with walletpassphrase first. |
| 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_WALLET_ALREADY_UNLOCKED | Failed to encrypt the wallet. |
| RPC_WALLET_NOT_FOUND | Wallet is already unlocked. Invalid wallet specified |
| RPC_WALLET_NOT_SPECIFIED | No wallet specified (error when there are multiple wallets loaded) |
Definition at line 32 of file protocol.h.
| void DeleteAuthCookie | ( | ) |
Delete RPC authentication cookie from disk.
Definition at line 116 of file protocol.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 74 of file protocol.cpp.
| bool GetAuthCookie | ( | std::string * | cookie_out | ) |
Read the RPC authentication cookie from disk.
Definition at line 100 of file protocol.cpp.
| fs::path GetAuthCookieFile | ( | ) |
Get name of RPC authentication cookie file.
Definition at line 68 of file protocol.cpp.
| UniValue JSONRPCError | ( | int | code, |
| const std::string & | message | ||
| ) |
Definition at line 35 of file protocol.cpp.
| 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.