Fabcoin Core  0.16.2
P2P Digital Currency
protocol.h
Go to the documentation of this file.
1 // Copyright (c) 2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2017 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef FABCOIN_RPCPROTOCOL_H
7 #define FABCOIN_RPCPROTOCOL_H
8 
9 #include <fs.h>
10 
11 #include <list>
12 #include <map>
13 #include <stdint.h>
14 #include <string>
15 
16 #include <univalue.h>
17 
20 {
21  HTTP_OK = 200,
29 };
30 
33 {
35  // RPC_INVALID_REQUEST is internally mapped to HTTP_BAD_REQUEST (400).
36  // It should not be used for application-layer errors.
38  // RPC_METHOD_NOT_FOUND is internally mapped to HTTP_NOT_FOUND (404).
39  // It should not be used for application-layer errors.
42  // RPC_INTERNAL_ERROR should only be used for genuine errors in fabcoind
43  // (for example datadir corruption).
45  RPC_PARSE_ERROR = -32700,
46 
59  RPC_IN_WARMUP = -28,
60 
65 
74 
87 };
88 
89 UniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id);
90 UniValue JSONRPCReplyObj(const UniValue& result, const UniValue& error, const UniValue& id);
91 std::string JSONRPCReply(const UniValue& result, const UniValue& error, const UniValue& id);
92 UniValue JSONRPCError(int code, const std::string& message);
93 
95 bool GenerateAuthCookie(std::string *cookie_out);
97 bool GetAuthCookie(std::string *cookie_out);
99 void DeleteAuthCookie();
100 
101 #endif // FABCOIN_RPCPROTOCOL_H
No wallet specified (error when there are multiple wallets loaded)
Definition: protocol.h:86
UniValue JSONRPCReplyObj(const UniValue &result, const UniValue &error, const UniValue &id)
Definition: protocol.cpp:36
Aliases for backward compatibility.
Definition: protocol.h:62
bool error(const char *fmt, const Args &...args)
Definition: util.h:178
std::string JSONRPCReply(const UniValue &result, const UniValue &error, const UniValue &id)
Definition: protocol.cpp:48
Node has not been added before.
Definition: protocol.h:70
Keypool ran out, call keypoolrefill first.
Definition: protocol.h:79
Ran out of memory during operation.
Definition: protocol.h:52
Enter the wallet passphrase with walletpassphrase first.
Definition: protocol.h:80
bool GenerateAuthCookie(std::string *cookie_out)
Generate a new RPC authentication cookie and write it to disk.
Definition: protocol.cpp:81
Wallet is already unlocked.
Definition: protocol.h:84
Transaction or block was rejected by network rules.
Definition: protocol.h:57
HTTPStatusCode
HTTP status codes.
Definition: protocol.h:19
bool GetAuthCookie(std::string *cookie_out)
Read the RPC authentication cookie from disk.
Definition: protocol.cpp:113
bytes code
Definition: SmartVM.cpp:45
Client still warming up.
Definition: protocol.h:59
Invalid, missing or duplicate parameter.
Definition: protocol.h:53
UniValue JSONRPCRequestObj(const std::string &strMethod, const UniValue &params, const UniValue &id)
JSON-RPC protocol.
Definition: protocol.cpp:27
General error during transaction or block submission.
Definition: protocol.h:56
The wallet passphrase entered was incorrect.
Definition: protocol.h:81
Transaction already in chain.
Definition: protocol.h:58
Unexpected type was passed as parameter.
Definition: protocol.h:50
Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.)
Definition: protocol.h:82
General application defined errors.
Definition: protocol.h:48
Invalid address or key.
Definition: protocol.h:51
Invalid IP/Subnet.
Definition: protocol.h:72
Invalid wallet specified.
Definition: protocol.h:85
Invalid account name.
Definition: protocol.h:78
void DeleteAuthCookie()
Delete RPC authentication cookie from disk.
Definition: protocol.cpp:129
Database error.
Definition: protocol.h:54
Failed to encrypt the wallet.
Definition: protocol.h:83
Not enough funds in wallet or account.
Definition: protocol.h:77
Node to disconnect not found in connected nodes.
Definition: protocol.h:71
Node is already added.
Definition: protocol.h:69
Server is in safe mode, and command is not allowed in safe mode.
Definition: protocol.h:49
UniValue JSONRPCError(int code, const std::string &message)
Definition: protocol.cpp:54
Standard JSON-RPC 2.0 errors.
Definition: protocol.h:37
Wallet errors.
Definition: protocol.h:76
No valid connection manager instance found.
Definition: protocol.h:73
RPCErrorCode
Fabcoin RPC error codes.
Definition: protocol.h:32
Still downloading initial blocks.
Definition: protocol.h:68
P2P client errors.
Definition: protocol.h:67
Error parsing or validating structure in raw format.
Definition: protocol.h:55