#ifdef ENABLE_WALLET
#include "wallet/wallet.h"
#endif
+#include "asyncrpcqueue.h"
+
+#include <memory>
#include <boost/algorithm/string.hpp>
#include <boost/asio.hpp>
Value stop(const Array& params, bool fHelp)
{
- // Accept the deprecated and ignored 'detach' boolean argument
+ // Accept the deprecated and ignored 'detach' boolean argument
if (fHelp || params.size() > 1)
throw runtime_error(
"stop\n"
- "\nStop Zcash server.");
+ "\nStop Komodo server.");
// Shutdown will take long enough that the response should get back
StartShutdown();
- return "Zcash server stopping";
+ return "Komodo server stopping";
}
{ "blockchain", "verifytxoutproof", &verifytxoutproof, true },
{ "blockchain", "gettxoutsetinfo", &gettxoutsetinfo, true },
{ "blockchain", "verifychain", &verifychain, true },
+ { "blockchain", "paxprice", &paxprice, true },
+ { "blockchain", "paxprices", &paxprices, true },
+ { "blockchain", "notaries", ¬aries, true },
/* Mining */
{ "mining", "getblocktemplate", &getblocktemplate, true },
{ "wallet", "zcrawjoinsplit", &zc_raw_joinsplit, true },
{ "wallet", "zcrawreceive", &zc_raw_receive, true },
{ "wallet", "zcsamplejoinsplit", &zc_sample_joinsplit, true },
+ { "wallet", "z_listreceivedbyaddress",&z_listreceivedbyaddress,false },
+ { "wallet", "z_getbalance", &z_getbalance, false },
+ { "wallet", "z_gettotalbalance", &z_gettotalbalance, false },
+ { "wallet", "z_sendmany", &z_sendmany, false },
+ { "wallet", "z_getoperationstatus", &z_getoperationstatus, true },
+ { "wallet", "z_getoperationresult", &z_getoperationresult, true },
+ { "wallet", "z_listoperationids", &z_listoperationids, true },
{ "wallet", "z_getnewaddress", &z_getnewaddress, true },
{ "wallet", "z_listaddresses", &z_listaddresses, true },
{ "wallet", "z_exportkey", &z_exportkey, true },
{ "wallet", "z_importkey", &z_importkey, true },
{ "wallet", "z_exportwallet", &z_exportwallet, true },
- { "wallet", "z_importwallet", &z_importwallet, true }
+ { "wallet", "z_importwallet", &z_importwallet, true },
+
+ { "wallet", "paxdeposit", &paxdeposit, true },
+ { "wallet", "paxwithdraw", &paxwithdraw, true }
#endif // ENABLE_WALLET
};
unsigned char rand_pwd[32];
GetRandBytes(rand_pwd, 32);
uiInterface.ThreadSafeMessageBox(strprintf(
- _("To use bitcoind, or the -server option to bitcoin-qt, you must set an rpcpassword in the configuration file:\n"
+ _("To use komodod you must set an rpcpassword in the configuration file:\n"
"%s\n"
"It is recommended you use the following random password:\n"
- "rpcuser=bitcoinrpc\n"
+ "rpcuser=zcashrpc\n"
"rpcpassword=%s\n"
"(you do not need to remember this password)\n"
"The username and password MUST NOT be the same.\n"
"If the file does not exist, create it with owner-readable-only file permissions.\n"
"It is also recommended to set alertnotify so you are notified of problems;\n"
- "for example: alertnotify=echo %%s | mail -s \"
Bitcoin Alert\"
[email protected]\n"),
+ "for example: alertnotify=echo %%s | mail -s \"
Komodo Alert\"
[email protected]\n"),
GetConfigFile().string(),
EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32)),
"", CClientUIInterface::MSG_ERROR | CClientUIInterface::SECURE);
rpc_worker_group->create_thread(boost::bind(&boost::asio::io_service::run, rpc_io_service));
fRPCRunning = true;
g_rpcSignals.Started();
+
+ // Launch one async rpc worker. The ability to launch multiple workers is not recommended at present and thus the option is disabled.
+ //for (int i=0; i<32; i++)
+ getAsyncRPCQueue()->addWorker();
+/*
+ int n = GetArg("-rpcasyncthreads", 1);
+ if (n<1) {
+ LogPrintf("ERROR: Invalid value %d for -rpcasyncthreads. Must be at least 1.\n", n);
+ strerr = strprintf(_("An error occurred while setting up the Async RPC threads, invalid parameter value of %d (must be at least 1)."), n);
+ uiInterface.ThreadSafeMessageBox(strerr, "", CClientUIInterface::MSG_ERROR);
+ StartShutdown();
+ return;
+ }
+ for (int i = 0; i < n; i++)
+ getAsyncRPCQueue()->addWorker();
+*/
}
void StartDummyRPCThread()
delete rpc_worker_group; rpc_worker_group = NULL;
delete rpc_ssl_context; rpc_ssl_context = NULL;
delete rpc_io_service; rpc_io_service = NULL;
+
+ // Tells async queue to cancel all operations and shutdown.
+ LogPrintf("%s: waiting for async rpc workers to stop\n", __func__);
+ getAsyncRPCQueue()->closeAndWait();
}
bool IsRPCRunning()
conn->stream() << HTTPError(HTTP_UNAUTHORIZED, false) << std::flush;
return false;
}
-
JSONRequest jreq;
try
{
// Parse request
Value valRequest;
if (!read_string(strRequest, valRequest))
+ {
+ fprintf(stderr,"CANTPARSE.(%s)\n",strRequest.c_str());
throw JSONRPCError(RPC_PARSE_ERROR, "Parse error");
-
+ }
// Return immediately if in warmup
{
LOCK(cs_rpcWarmup);
}
std::string HelpExampleCli(string methodname, string args){
- return "> bitcoin-cli " + methodname + " " + args + "\n";
+ return "> zcash-cli " + methodname + " " + args + "\n";
}
std::string HelpExampleRpc(string methodname, string args){
}
const CRPCTable tableRPC;
+
+// Return async rpc queue
+std::shared_ptr<AsyncRPCQueue> getAsyncRPCQueue()
+{
+ return AsyncRPCQueue::sharedInstance();
+}