17 #include <boost/algorithm/string.hpp>
18 #include <boost/asio.hpp>
19 #include <boost/asio/ssl.hpp>
20 #include <boost/bind.hpp>
21 #include <boost/filesystem.hpp>
22 #include <boost/foreach.hpp>
23 #include <boost/iostreams/concepts.hpp>
24 #include <boost/iostreams/stream.hpp>
25 #include <boost/shared_ptr.hpp>
26 #include "json/json_spirit_writer_template.h"
29 using namespace boost;
41 static std::vector< boost::shared_ptr<ip::tcp::acceptor> >
rpc_acceptors;
44 const list<Value_type>& typesExpected,
48 BOOST_FOREACH(Value_type t, typesExpected)
50 if (params.size() <= i)
53 const Value& v = params[i];
54 if (!((v.type() == t) || (fAllowNull && (v.type() == null_type))))
56 string err =
strprintf(
"Expected type %s, got %s",
57 Value_type_name[t], Value_type_name[v.type()]);
65 const map<string, Value_type>& typesExpected,
68 BOOST_FOREACH(
const PAIRTYPE(
string, Value_type)& t, typesExpected)
70 const Value& v = find_value(o, t.first);
71 if (!fAllowNull && v.type() == null_type)
74 if (!((v.type() == t.second) || (fAllowNull && (v.type() == null_type))))
76 string err =
strprintf(
"Expected type %s for %s, got %s",
77 Value_type_name[t.second], t.first, Value_type_name[v.type()]);
85 double dAmount = value.get_real();
86 if (dAmount <= 0.0 || dAmount > 21000000.0)
96 return (
double)amount / (double)
COIN;
105 uBits.nBits = htonl((int32_t)nBits);
112 if (v.type() == str_type)
113 strHex = v.get_str();
122 return ParseHashV(find_value(o, strKey), strKey);
124 vector<unsigned char>
ParseHexV(
const Value& v,
string strName)
127 if (v.type() == str_type)
128 strHex = v.get_str();
133 vector<unsigned char>
ParseHexO(
const Object& o,
string strKey)
135 return ParseHexV(find_value(o, strKey), strKey);
146 set<rpcfn_type> setDone;
147 for (map<string, const CRPCCommand*>::const_iterator mi = mapCommands.begin(); mi != mapCommands.end(); ++mi)
150 string strMethod = mi->first;
152 if (strMethod.find(
"label") != string::npos)
154 if (strCommand !=
"" && strMethod != strCommand)
165 if (setDone.insert(pfn).second)
166 (*pfn)(params,
true);
168 catch (std::exception& e)
171 string strHelp = string(e.what());
172 if (strCommand ==
"")
173 if (strHelp.find(
'\n') != string::npos)
174 strHelp = strHelp.substr(0, strHelp.find(
'\n'));
175 strRet += strHelp +
"\n";
179 strRet =
strprintf(
"help: unknown command: %s\n", strCommand);
180 strRet = strRet.substr(0,strRet.size()-1);
184 Value
help(
const Array& params,
bool fHelp)
186 if (fHelp || params.size() > 1)
188 "help ( \"command\" )\n"
189 "\nList all commands, or get help for a specified command.\n"
191 "1. \"command\" (string, optional) The command to get help on\n"
193 "\"text\" (string) The help text\n"
197 if (params.size() > 0)
198 strCommand = params[0].get_str();
204 Value
stop(
const Array& params,
bool fHelp)
207 if (fHelp || params.size() > 1)
210 "\nStop MasterCore server.");
213 return "MasterCore server stopping";
227 {
"getinfo", &
getinfo,
true,
false,
false },
228 {
"help", &
help,
true,
true,
false },
229 {
"stop", &
stop,
true,
true,
false },
233 {
"addnode", &
addnode,
true,
true,
false },
237 {
"getpeerinfo", &
getpeerinfo,
true,
false,
false },
238 {
"ping", &
ping,
true,
false,
false },
244 {
"getblock", &
getblock,
false,
false,
false },
248 {
"gettxout", &
gettxout,
true,
false,
false },
250 {
"verifychain", &
verifychain,
true,
false,
false },
256 {
"submitblock", &
submitblock,
false,
false,
false },
275 {
"dumpprivkey", &
dumpprivkey,
true,
false,
true },
276 {
"dumpwallet", &
dumpwallet,
true,
false,
true },
279 {
"getaccount", &
getaccount,
false,
false,
true },
281 {
"getbalance", &
getbalance,
false,
false,
true },
299 {
"listunspent", &
listunspent,
false,
false,
true },
300 {
"lockunspent", &
lockunspent,
false,
false,
true },
301 {
"move", &
movecmd,
false,
false,
true },
302 {
"sendfrom", &
sendfrom,
false,
false,
true },
303 {
"sendmany", &
sendmany,
false,
false,
true },
305 {
"setaccount", &
setaccount,
true,
false,
true },
306 {
"settxfee", &
settxfee,
false,
false,
true },
307 {
"signmessage", &
signmessage,
false,
false,
true },
308 {
"walletlock", &
walletlock,
true,
false,
true },
313 {
"getgenerate", &
getgenerate,
true,
false,
false },
315 {
"getwork", &
getwork,
true,
false,
true },
316 {
"setgenerate", &
setgenerate,
true,
true,
false },
319 {
"mscrpc", &
mscrpc,
true,
false,
false },
322 {
"send_MP", &
send_MP,
false,
false,
true },
332 {
"trade_MP", &
trade_MP,
false,
false,
true },
337 {
"gettrade_MP", &
gettrade_MP,
false,
false,
true },
341 {
"getsto_MP", &
getsto_MP,
false,
false,
true },
342 {
"getinfo_MP", &
getinfo_MP,
false,
false,
true },
346 #endif // ENABLE_WALLET
352 for (vcidx = 0; vcidx < (
sizeof(
vRPCCommands) /
sizeof(vRPCCommands[0])); vcidx++)
356 pcmd = &vRPCCommands[vcidx];
357 mapCommands[pcmd->
name] = pcmd;
363 map<string, const CRPCCommand*>::const_iterator it = mapCommands.find(name);
364 if (it == mapCommands.end())
372 string strAuth = mapHeaders[
"authorization"];
373 if (strAuth.substr(0,6) !=
"Basic ")
375 string strUserPass64 = strAuth.substr(6); boost::trim(strUserPass64);
380 void ErrorReply(std::ostream& stream,
const Object& objError,
const Value&
id)
384 int code = find_value(objError,
"code").get_int();
387 string strReply =
JSONRPCReply(Value::null, objError,
id);
388 stream <<
HTTPReply(nStatus, strReply,
false) << std::flush;
395 && (address.to_v6().is_v4_compatible()
396 || address.to_v6().is_v4_mapped()))
399 if (address == asio::ip::address_v4::loopback()
400 || address == asio::ip::address_v6::loopback()
403 && (address.to_v4().to_ulong() & 0xff000000) == 0x7f000000))
406 const string strAddress = address.to_string();
407 const vector<string>& vAllow =
mapMultiArgs[
"-rpcallowip"];
408 BOOST_FOREACH(
string strAllow, vAllow)
419 virtual std::iostream& stream() = 0;
420 virtual std::string peer_address_to_string()
const = 0;
421 virtual void close() = 0;
424 template <
typename Protocol>
429 asio::io_service& io_service,
430 ssl::context &context,
432 sslStream(io_service, context),
433 _d(sslStream, fUseSSL),
445 return peer.address().to_string();
453 typename Protocol::endpoint
peer;
458 iostreams::stream< SSLIOStreamDevice<Protocol> >
_stream;
464 template <
typename Protocol,
typename SocketAcceptorService>
465 static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
466 ssl::context& context,
468 boost::shared_ptr< AcceptedConnection > conn,
469 const boost::system::error_code&
error);
474 template <
typename Protocol,
typename SocketAcceptorService>
475 static void RPCListen(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
476 ssl::context& context,
482 acceptor->async_accept(
483 conn->sslStream.lowest_layer(),
485 boost::bind(&RPCAcceptHandler<Protocol, SocketAcceptorService>,
497 template <
typename Protocol,
typename SocketAcceptorService>
498 static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
499 ssl::context& context,
501 boost::shared_ptr< AcceptedConnection > conn,
502 const boost::system::error_code&
error)
505 if (error != asio::error::operation_aborted && acceptor->is_open())
513 LogPrintf(
"%s: Error: %s\n", __func__, error.message());
534 if (((mapArgs[
"-rpcpassword"] ==
"") ||
535 (mapArgs[
"-rpcuser"] == mapArgs[
"-rpcpassword"])) &&
Params().RequireRPCPassword())
537 unsigned char rand_pwd[32];
538 RAND_bytes(rand_pwd, 32);
539 string strWhatAmI =
"To use mastercored";
540 if (mapArgs.count(
"-server"))
541 strWhatAmI =
strprintf(
_(
"To use the %s option"),
"\"-server\"");
542 else if (mapArgs.count(
"-daemon"))
543 strWhatAmI =
strprintf(
_(
"To use the %s option"),
"\"-daemon\"");
545 _(
"%s, you must set a rpcpassword in the configuration file:\n"
547 "It is recommended you use the following random password:\n"
548 "rpcuser=bitcoinrpc\n"
550 "(you do not need to remember this password)\n"
551 "The username and password MUST NOT be the same.\n"
552 "If the file does not exist, create it with owner-readable-only file permissions.\n"
553 "It is also recommended to set alertnotify so you are notified of problems;\n"
554 "for example: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com\n"),
567 const bool fUseSSL =
GetBoolArg(
"-rpcssl",
false);
573 filesystem::path pathCertFile(
GetArg(
"-rpcsslcertificatechainfile",
"server.cert"));
574 if (!pathCertFile.is_complete()) pathCertFile = filesystem::path(
GetDataDir()) / pathCertFile;
575 if (filesystem::exists(pathCertFile))
rpc_ssl_context->use_certificate_chain_file(pathCertFile.string());
576 else LogPrintf(
"ThreadRPCServer ERROR: missing server certificate file %s\n", pathCertFile.string());
578 filesystem::path pathPKFile(
GetArg(
"-rpcsslprivatekeyfile",
"server.pem"));
579 if (!pathPKFile.is_complete()) pathPKFile = filesystem::path(
GetDataDir()) / pathPKFile;
580 if (filesystem::exists(pathPKFile))
rpc_ssl_context->use_private_key_file(pathPKFile.string(), ssl::context::pem);
581 else LogPrintf(
"ThreadRPCServer ERROR: missing server private key file %s\n", pathPKFile.string());
583 string strCiphers =
GetArg(
"-rpcsslciphers",
"TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH");
588 const bool loopback = !mapArgs.count(
"-rpcallowip");
589 asio::ip::address bindAddress = loopback ? asio::ip::address_v6::loopback() : asio::ip::address_v6::any();
590 ip::tcp::endpoint endpoint(bindAddress,
GetArg(
"-rpcport",
Params().RPCPort()));
591 boost::system::error_code v6_only_error;
593 bool fListening =
false;
597 boost::shared_ptr<ip::tcp::acceptor> acceptor(
new ip::tcp::acceptor(*
rpc_io_service));
598 acceptor->open(endpoint.protocol());
599 acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(
true));
602 acceptor->set_option(boost::asio::ip::v6_only(loopback), v6_only_error);
604 acceptor->bind(endpoint);
605 acceptor->listen(socket_base::max_connections);
609 rpc_acceptors.push_back(acceptor);
612 catch(boost::system::system_error &e)
614 strerr =
strprintf(
_(
"An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s"), endpoint.port(), e.what());
618 if (!fListening || loopback || v6_only_error)
620 bindAddress = loopback ? asio::ip::address_v4::loopback() : asio::ip::address_v4::any();
621 endpoint.address(bindAddress);
623 boost::shared_ptr<ip::tcp::acceptor> acceptor(
new ip::tcp::acceptor(*
rpc_io_service));
624 acceptor->open(endpoint.protocol());
625 acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(
true));
626 acceptor->bind(endpoint);
627 acceptor->listen(socket_base::max_connections);
631 rpc_acceptors.push_back(acceptor);
635 catch(boost::system::system_error &e)
637 strerr =
strprintf(
_(
"An error occurred while setting up the RPC port %u for listening on IPv4: %s"), endpoint.port(), e.what());
647 for (
int i = 0; i <
GetArg(
"-rpcthreads", 4); i++)
671 boost::system::error_code ec;
672 BOOST_FOREACH(
const boost::shared_ptr<ip::tcp::acceptor> &acceptor, rpc_acceptors)
674 acceptor->cancel(ec);
676 LogPrintf(
"%s: Warning: %s when cancelling acceptor", __func__, ec.message());
678 rpc_acceptors.clear();
679 BOOST_FOREACH(
const PAIRTYPE(std::string, boost::shared_ptr<deadline_timer>) &timer, deadlineTimers)
681 timer.second->cancel(ec);
683 LogPrintf(
"%s: Warning: %s when cancelling timer", __func__, ec.message());
685 deadlineTimers.clear();
696 void RPCRunHandler(
const boost::system::error_code& err, boost::function<
void(
void)> func)
702 void RPCRunLater(
const std::string& name, boost::function<
void(
void)> func, int64_t nSeconds)
706 if (deadlineTimers.count(name) == 0)
708 deadlineTimers.insert(make_pair(name,
709 boost::shared_ptr<deadline_timer>(
new deadline_timer(*
rpc_io_service))));
711 deadlineTimers[name]->expires_from_now(posix_time::seconds(nSeconds));
712 deadlineTimers[name]->async_wait(boost::bind(
RPCRunHandler, _1, func));
723 void parse(
const Value& valRequest);
729 if (valRequest.type() != obj_type)
731 const Object& request = valRequest.get_obj();
734 id = find_value(request,
"id");
737 Value valMethod = find_value(request,
"method");
738 if (valMethod.type() == null_type)
740 if (valMethod.type() != str_type)
742 strMethod = valMethod.get_str();
743 if (strMethod !=
"getwork" && strMethod !=
"getblocktemplate")
744 LogPrint(
"rpc",
"ThreadRPCServer method=%s\n", strMethod);
747 Value valParams = find_value(request,
"params");
748 if (valParams.type() == array_type)
749 params = valParams.get_array();
750 else if (valParams.type() == null_type)
768 catch (Object& objError)
772 catch (std::exception& e)
784 for (
unsigned int reqIdx = 0; reqIdx < vReq.size(); reqIdx++)
787 return write_string(Value(ret),
false) +
"\n";
796 map<string, string> mapHeaders;
797 string strRequest, strMethod, strURI;
812 if (mapHeaders.count(
"authorization") == 0)
823 if (
mapArgs[
"-rpcpassword"].size() < 20)
829 if (mapHeaders[
"connection"] ==
"close")
837 if (!read_string(strRequest, valRequest))
843 if (valRequest.type() == obj_type) {
844 jreq.
parse(valRequest);
852 }
else if (valRequest.type() == array_type)
859 catch (Object& objError)
864 catch (std::exception& e)
872 json_spirit::Value
CRPCTable::execute(
const std::string &strMethod,
const json_spirit::Array ¶ms)
const
885 if (strWarning !=
"" && !
GetBoolArg(
"-disablesafemode",
false) &&
895 result = pcmd->
actor(params,
false);
899 result = pcmd->
actor(params,
false);
902 result = pcmd->
actor(params,
false);
904 #else // ENABLE_WALLET
907 result = pcmd->
actor(params,
false);
909 #endif // !ENABLE_WALLET
913 catch (std::exception& e)
920 return "> bitcoin-cli " + methodname +
" " + args +
"\n";
924 return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
925 "\"method\": \"" + methodname +
"\", \"params\": [" + args +
"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
const boost::filesystem::path & GetDataDir(bool fNetSpecific)
uint256 send_MP(const string &FromAddress, const string &ToAddress, const string &RedeemAddress, unsigned int PropertyID, uint64_t Amount)
CClientUIInterface uiInterface
void SetHex(const char *psz)
static std::vector< boost::shared_ptr< ip::tcp::acceptor > > rpc_acceptors
json_spirit::Value setgenerate(const json_spirit::Array ¶ms, bool fHelp)
bool HTTPAuthorized(map< string, string > &mapHeaders)
json_spirit::Value signmessage(const json_spirit::Array ¶ms, bool fHelp)
Value createrawtransaction(const Array ¶ms, bool fHelp)
void RPCRunLater(const std::string &name, boost::function< void(void)> func, int64_t nSeconds)
static string JSONRPCExecBatch(const Array &vReq)
json_spirit::Value movecmd(const json_spirit::Array ¶ms, bool fHelp)
static Object JSONRPCExecOne(const Value &req)
Value stop(const Array ¶ms, bool fHelp)
json_spirit::Value walletpassphrasechange(const json_spirit::Array ¶ms, bool fHelp)
SSLIOStreamDevice< Protocol > _d
string JSONRPCReply(const Value &result, const Value &error, const Value &id)
Value help(const Array ¶ms, bool fHelp)
Bitcoin RPC command dispatcher.
Value getallbalancesforid_MP(const Array ¶ms, bool fHelp)
iostreams::stream< SSLIOStreamDevice< Protocol > > _stream
Value addnode(const Array ¶ms, bool fHelp)
vector< unsigned char > ParseHexO(const Object &o, string strKey)
uint256 ParseHashO(const Object &o, string strKey)
Value sendtoowners_MP(const Array ¶ms, bool fHelp)
asio::ssl::stream< typename Protocol::socket > sslStream
static boost::asio::io_service::work * rpc_dummy_work
Value getblockcount(const Array ¶ms, bool fHelp)
CCriticalSection cs_wallet
Main wallet lock.
void MilliSleep(int64_t n)
bool ReadHTTPRequestLine(std::basic_istream< char > &stream, int &proto, string &http_method, string &http_uri)
Value getinfo(const Array ¶ms, bool fHelp)
json_spirit::Value gettradehistory_MP(const json_spirit::Array ¶ms, bool fHelp)
std::string HelpExampleRpc(string methodname, string args)
Value sendrawtransaction(const Array ¶ms, bool fHelp)
const CRPCCommand * operator[](std::string name) const
Value importwallet(const Array ¶ms, bool fHelp)
std::string EncodeBase58(const unsigned char *pbegin, const unsigned char *pend)
Encode a byte sequence as a base58-encoded string.
string GetWarnings(string strFor)
Format a string that describes several potential problems detected by the core.
json_spirit::Value execute(const std::string &method, const json_spirit::Array ¶ms) const
Execute a method.
Value gettxoutsetinfo(const Array ¶ms, bool fHelp)
Value getactivedexsells_MP(const Array ¶ms, bool fHelp)
bool MoneyRange(int64_t nValue)
bool IsHex(const string &str)
void RPCRunHandler(const boost::system::error_code &err, boost::function< void(void)> func)
Value dumpwallet(const Array ¶ms, bool fHelp)
json_spirit::Value gettradessince_MP(const json_spirit::Array ¶ms, bool fHelp)
virtual ~AcceptedConnection()
Object JSONRPCError(int code, const string &message)
Value getblockchaininfo(const Array ¶ms, bool fHelp)
Value getblock(const Array ¶ms, bool fHelp)
Value getnetworkinfo(const Array ¶ms, bool fHelp)
Value sendrawtx_MP(const Array ¶ms, bool fHelp)
json_spirit::Value getorderbook_MP(const json_spirit::Array ¶ms, bool fHelp)
void RPCTypeCheck(const Array ¶ms, const list< Value_type > &typesExpected, bool fAllowNull)
virtual std::iostream & stream()
static ssl::context * rpc_ssl_context
Value getdifficulty(const Array ¶ms, bool fHelp)
void ErrorReply(std::ostream &stream, const Object &objError, const Value &id)
Value decodescript(const Array ¶ms, bool fHelp)
Value importprivkey(const Array ¶ms, bool fHelp)
Value gettransaction_MP(const Array ¶ms, bool fHelp)
AcceptedConnectionImpl(asio::io_service &io_service, ssl::context &context, bool fUseSSL)
json_spirit::Value getopenorders_MP(const json_spirit::Array ¶ms, bool fHelp)
void ServiceConnection(AcceptedConnection *conn)
virtual std::string peer_address_to_string() const
Value getsto_MP(const Array ¶ms, bool fHelp)
virtual std::string peer_address_to_string() const =0
static void RPCListen(boost::shared_ptr< basic_socket_acceptor< Protocol, SocketAcceptorService > > acceptor, ssl::context &context, const bool fUseSSL)
Sets up I/O resources to accept and handle a new connection.
json_spirit::Value listunspent(const json_spirit::Array ¶ms, bool fHelp)
Value decoderawtransaction(const Array ¶ms, bool fHelp)
json_spirit::Value getunconfirmedbalance(const json_spirit::Array ¶ms, bool fHelp)
std::string HexBits(unsigned int nBits)
static asio::io_service * rpc_io_service
bool GetBoolArg(const std::string &strArg, bool fDefault)
Return boolean argument or default value.
int ReadHTTPMessage(std::basic_istream< char > &stream, map< string, string > &mapHeadersRet, string &strMessageRet, int nProto)
Value ValueFromAmount(int64_t amount)
Value listblocktransactions_MP(const Array ¶ms, bool fHelp)
json_spirit::Value gethashespersec(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value listreceivedbyaddress(const json_spirit::Array ¶ms, bool fHelp)
static int LogPrint(const char *category, const char *format)
json_spirit::Value getnewaddress(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value walletlock(const json_spirit::Array ¶ms, bool fHelp)
Value mscrpc(const Array ¶ms, bool fHelp)
json_spirit::Value settxfee(const json_spirit::Array ¶ms, bool fHelp)
Value getconnectioncount(const Array ¶ms, bool fHelp)
static bool error(const char *format)
Value getmininginfo(const Array ¶ms, bool fHelp)
json_spirit::Value listaddressgroupings(const json_spirit::Array ¶ms, bool fHelp)
static map< string, boost::shared_ptr< deadline_timer > > deadlineTimers
static boost::thread_group * rpc_worker_group
json_spirit::Value sendmany(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value keypoolrefill(const json_spirit::Array ¶ms, bool fHelp)
Value getrawmempool(const Array ¶ms, bool fHelp)
Value listtransactions_MP(const Array ¶ms, bool fHelp)
std::string help(std::string name) const
Note: This interface may still be subject to change.
string HTTPReply(int nStatus, const string &strMsg, bool keepalive)
Value submitblock(const Array ¶ms, bool fHelp)
static std::string strRPCUserColonPass
Value getnettotals(const Array ¶ms, bool fHelp)
Value getallbalancesforaddress_MP(const Array ¶ms, bool fHelp)
json_spirit::Value getgenerate(const json_spirit::Array ¶ms, bool fHelp)
Value getpeerinfo(const Array ¶ms, bool fHelp)
Value createmultisig(const Array ¶ms, bool fHelp)
json_spirit::Value trade_MP(const json_spirit::Array ¶ms, bool fHelp)
Object JSONRPCReplyObj(const Value &result, const Value &error, const Value &id)
static const int64_t COIN
json_spirit::Value listaccounts(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value getwalletinfo(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value listsinceblock(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value encryptwallet(const json_spirit::Array ¶ms, bool fHelp)
const CChainParams & Params()
Return the currently selected parameters.
bool ClientAllowed(const boost::asio::ip::address &address)
static const CRPCCommand vRPCCommands[]
vector< unsigned char > ParseHexV(const Value &v, string strName)
bool WildcardMatch(const char *psz, const char *mask)
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result...
Value signrawtransaction(const Array ¶ms, bool fHelp)
virtual std::iostream & stream()=0
void parse(const Value &valRequest)
Value getbalance_MP(const Array ¶ms, bool fHelp)
Value getgrants_MP(const Array ¶ms, bool fHelp)
json_spirit::Value sendfrom(const json_spirit::Array ¶ms, bool fHelp)
int64_t AmountFromValue(const Value &value)
bool TimingResistantEqual(const T &a, const T &b)
Timing-attack-resistant comparison.
Value getaddednodeinfo(const Array ¶ms, bool fHelp)
json_spirit::Value gettransaction(const json_spirit::Array ¶ms, bool fHelp)
Value getrawtransaction(const Array ¶ms, bool fHelp)
boost::signals2::signal< bool(const std::string &message, const std::string &caption, unsigned int style), boost::signals2::last_value< bool > > ThreadSafeMessageBox
Show message box.
Value verifymessage(const Array ¶ms, bool fHelp)
Value getbestblockhash(const Array ¶ms, bool fHelp)
Value getcrowdsale_MP(const Array ¶ms, bool fHelp)
json_spirit::Value getreceivedbyaccount(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value listtransactions(const json_spirit::Array ¶ms, bool fHelp)
uint256 ParseHashV(const Value &v, string strName)
std::string HelpExampleCli(string methodname, string args)
Value getnetworkhashps(const Array ¶ms, bool fHelp)
std::string GetArg(const std::string &strArg, const std::string &strDefault)
Return string argument or default value.
Value getblockhash(const Array ¶ms, bool fHelp)
json_spirit::Value walletpassphrase(const json_spirit::Array ¶ms, bool fHelp)
int64_t roundint64(double d)
json_spirit::Value lockunspent(const json_spirit::Array ¶ms, bool fHelp)
Value getblocktemplate(const Array ¶ms, bool fHelp)
json_spirit::Value sendtoaddress(const json_spirit::Array ¶ms, bool fHelp)
Value gettxout(const Array ¶ms, bool fHelp)
static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor< Protocol, SocketAcceptorService > > acceptor, ssl::context &context, bool fUseSSL, boost::shared_ptr< AcceptedConnection > conn, const boost::system::error_code &error)
Accept and handle incoming connection.
vector< unsigned char > DecodeBase64(const char *p, bool *pfInvalid)
json_spirit::Value listreceivedbyaccount(const json_spirit::Array ¶ms, bool fHelp)
Value ping(const Array ¶ms, bool fHelp)
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
json_spirit::Value getreceivedbyaddress(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value backupwallet(const json_spirit::Array ¶ms, bool fHelp)
map< string, vector< string > > mapMultiArgs
json_spirit::Value getwork(const json_spirit::Array ¶ms, bool fHelp)
Value gettrade_MP(const Array ¶ms, bool fHelp)
json_spirit::Value addmultisigaddress(const json_spirit::Array ¶ms, bool fHelp)
Value verifychain(const Array ¶ms, bool fHelp)
json_spirit::Value getrawchangeaddress(const json_spirit::Array ¶ms, bool fHelp)
vector< unsigned char > ParseHex(const char *psz)
Value validateaddress(const Array ¶ms, bool fHelp)
Value getactivecrowdsales_MP(const Array ¶ms, bool fHelp)
json_spirit::Value listlockunspent(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value getaccount(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value(* rpcfn_type)(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value getbalance(const json_spirit::Array ¶ms, bool fHelp)
Value getinfo_MP(const Array ¶ms, bool fHelp)
Value listproperties_MP(const Array ¶ms, bool fHelp)
Value getproperty_MP(const Array ¶ms, bool fHelp)
json_spirit::Value setaccount(const json_spirit::Array ¶ms, bool fHelp)
map< string, string > mapArgs
boost::filesystem::path GetConfigFile()
Value dumpprivkey(const Array ¶ms, bool fHelp)
json_spirit::Value getaddressesbyaccount(const json_spirit::Array ¶ms, bool fHelp)
void StartDummyRPCThread()
json_spirit::Value getaccountaddress(const json_spirit::Array ¶ms, bool fHelp)