uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33],ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE;
bool VERUS_MINTBLOCKS;
-char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN],ASSETCHAINS_USERPASS[4096];
+char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN], ASSETCHAINS_USERPASS[4096];
bool PBAAS_TESTMODE;
std::string PBAAS_HOST;
int32_t PBAAS_PORT;
std::string PBAAS_USERPASS;
+std::string ASSETCHAINS_RPCHOST, ASSETCHAINS_RPCCREDENTIALS;
uint160 ASSETCHAINS_CHAINID;
uint160 VERUS_CHAINID;
PBAAS_STARTBLOCK = GetArg("-startblock", 0);
PBAAS_ENDBLOCK = GetArg("-endblock", 0);
+
+ ASSETCHAINS_RPCHOST = GetArg("-rpchost", "127.0.0.1");
}
MAX_BLOCK_SIGOPS = 60000;
{
int32_t komodo_baseid(char *origbase);
extern int COINBASE_MATURITY;
- if ( (port= komodo_userpass(ASSETCHAINS_USERPASS,ASSETCHAINS_SYMBOL)) != 0 )
+ if ( (port= komodo_userpass(ASSETCHAINS_USERPASS, ASSETCHAINS_SYMBOL)) != 0 )
ASSETCHAINS_RPCPORT = port;
else komodo_configfile(ASSETCHAINS_SYMBOL,ASSETCHAINS_P2PPORT + 1);
if (ASSETCHAINS_LASTERA == 0 && ASSETCHAINS_REWARD[0] == 0)
COINBASE_MATURITY = 1;
//fprintf(stderr,"ASSETCHAINS_RPCPORT (%s) %u\n",ASSETCHAINS_SYMBOL,ASSETCHAINS_RPCPORT);
+ ASSETCHAINS_RPCCREDENTIALS = string(ASSETCHAINS_USERPASS);
+ ASSETCHAINS_RPCHOST = GetArg("-rpchost", "127.0.0.1");
}
if ( ASSETCHAINS_RPCPORT == 0 )
ASSETCHAINS_RPCPORT = ASSETCHAINS_P2PPORT + 1;
}
obj.push_back(Pair("eras", eras));
+ /* We need to store node information here
+ UniValue nodes(UniValue::VARR);
+ {
+ UniValue node(UniValue::VOBJ);
+ node.push_back(Pair("networkaddress", ));
+ node.push_back(Pair("paymentaddress", ));
+ }
+ obj.push_back(Pair("nodes", nodes));
+ */
+
SetThisChain(obj);
paramsLoaded = true;
}
extern uint160 VERUS_CHAINID;
extern std::string VERUS_CHAINNAME;
extern int32_t PBAAS_STARTBLOCK, PBAAS_ENDBLOCK;
-extern string PBAAS_HOST, PBAAS_USERPASS;
+extern string PBAAS_HOST, PBAAS_USERPASS, ASSETCHAINS_RPCHOST, ASSETCHAINS_RPCCREDENTIALS;;
extern int32_t PBAAS_PORT;
+extern uint16_t ASSETCHAINS_RPCPORT;
extern std::string NOTARY_PUBKEY,ASSETCHAINS_OVERRIDE_PUBKEY;
void vcalc_sha256(char deprecated[(256 >> 3) * 2 + 1],uint8_t hash[256 >> 3],uint8_t *src,int32_t len);
{
UniValue params(UniValue::VARR);
+ UniValue error(UniValue::VARR);
params.push_back(EncodeHexBlk(*pblock));
params.push_back(ASSETCHAINS_SYMBOL);
- params.push_back(PBAAS_HOST);
- params.push_back(PBAAS_PORT);
- params.push_back(PBAAS_USERPASS);
+ params.push_back(ASSETCHAINS_RPCHOST);
+ params.push_back(ASSETCHAINS_RPCPORT);
+ params.push_back(ASSETCHAINS_RPCCREDENTIALS);
try
{
- params = find_value(RPCCallRoot("addmergedblock", params), "result");
+ params = RPCCallRoot("addmergedblock", params);
+ params = find_value(params, "result");
+ error = find_value(params, "error");
} catch (std::exception e)
{
printf("Failed to connect to %s chain\n", ConnectedChains.notaryChain.chainDefinition.name.c_str());
params = UniValue(e.what());
}
- if (mergeMining = params.isNull())
+ if (mergeMining = (params.isNull() && error.isNull()))
{
printf("Merge mining with %s as the actual mining chain\n", ConnectedChains.notaryChain.chainDefinition.name.c_str());
LogPrintf("Merge mining with %s\n",ASSETCHAINS_ALGORITHMS[ASSETCHAINS_ALGO]);
}
else if (ReadConfigFile(PBAAS_TESTMODE ? "VRSCTEST" : "VRSC", settings, settingsmulti))
{
- credentials = settingsmulti.find("-rpcuser")->second[0] + ":" + settingsmulti.find("-rpcpassword")->second[0];
- port = atoi(settingsmulti.find("-rpcport")->second[0]);
- host = settingsmulti.find("-rpchost")->second[0];
- if (!host.size())
+ PBAAS_USERPASS = settingsmulti.find("-rpcuser")->second[0] + ":" + settingsmulti.find("-rpcpassword")->second[0];
+ PBAAS_PORT = atoi(settingsmulti.find("-rpcport")->second[0]);
+ PBAAS_HOST = settingsmulti.find("-rpchost")->second[0];
+ if (!PBAAS_HOST.size())
{
- host = "127.0.0.1";
+ PBAAS_HOST = "127.0.0.1";
}
return RPCCall(strMethod, params, credentials, port, host);
}