#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 Bitcoin server.");
+ "\nStop Komodo server.");
// Shutdown will take long enough that the response should get back
StartShutdown();
- return "Bitcoin 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 },
{ "mining", "getnetworkhashps", &getnetworkhashps, true },
{ "mining", "prioritisetransaction", &prioritisetransaction, true },
{ "mining", "submitblock", &submitblock, true },
+ { "mining", "getblocksubsidy", &getblocksubsidy, true },
#ifdef ENABLE_WALLET
/* Coin generation */
{ "wallet", "walletlock", &walletlock, true },
{ "wallet", "walletpassphrasechange", &walletpassphrasechange, true },
{ "wallet", "walletpassphrase", &walletpassphrase, true },
+ { "wallet", "zcbenchmark", &zc_benchmark, true },
+ { "wallet", "zcrawkeygen", &zc_raw_keygen, 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", "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);
vEndpoints.push_back(ip::tcp::endpoint(boost::asio::ip::address_v6::any(), defaultPort));
vEndpoints.push_back(ip::tcp::endpoint(boost::asio::ip::address_v4::any(), defaultPort));
// Prefer making the socket dual IPv6/IPv4 instead of binding
- // to both addresses seperately.
+ // to both addresses separately.
bBindAny = true;
}
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()
{
acceptor->cancel(ec);
if (ec)
- LogPrintf("%s: Warning: %s when cancelling acceptor", __func__, ec.message());
+ LogPrintf("%s: Warning: %s when cancelling acceptor\n", __func__, ec.message());
}
rpc_acceptors.clear();
BOOST_FOREACH(const PAIRTYPE(std::string, boost::shared_ptr<deadline_timer>) &timer, deadlineTimers)
{
timer.second->cancel(ec);
if (ec)
- LogPrintf("%s: Warning: %s when cancelling timer", __func__, ec.message());
+ LogPrintf("%s: Warning: %s when cancelling timer\n", __func__, ec.message());
}
deadlineTimers.clear();
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){
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
- "\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
+ "\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8232/\n";
}
const CRPCTable tableRPC;
+
+// Return async rpc queue
+std::shared_ptr<AsyncRPCQueue> getAsyncRPCQueue()
+{
+ return AsyncRPCQueue::sharedInstance();
+}