Getting closer, invalid rpc user/pass instead of wrong port

This commit is contained in:
Jonathan "Duke" Leto
2018-08-07 20:13:32 +02:00
parent 5ec4373ca4
commit 626af0e73e
2 changed files with 28 additions and 14 deletions

View File

@@ -26,20 +26,24 @@ class CryptoConditionsTest (BitcoinTestFramework):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir,
extra_args=[[
'-regtest',
'-server=1',
'-rpcport=64368',
# TODO: AC.conf instead of komodo.conf
#'-conf='+self.options.tmpdir+'/node0/komodo.conf',
'-conf='+self.options.tmpdir+'/node0/REGTEST.conf',
'-port=64367',
'-rpcport=64368',
'-ac_name=REGTEST',
'-addressindex=1',
'-spentindex=1',
'-ac_supply=5555555',
'-ac_reward=10000000',
'-pubkey=02676d00110c2cd14ae24f95969e8598f7ccfaa675498b82654a5b5bd57fc1d8cf',
'-ac_cc=1'
'-ac_cc=1',
'-daemon',
]] * self.num_nodes
)
self.is_network_split = split
self.sync_all()
print("Done setting up network")
def run_test (self):
print("Mining blocks...")

View File

@@ -84,10 +84,10 @@ def initialize_datadir(dirname, n):
f.write("showmetrics=0\n");
f.write("rpcuser=rt\n");
f.write("rpcpassword=rt\n");
f.write("port="+str(p2p_port(n))+"\n");
rpcport = str(rpc_port(n))
f.write("rpcport="+rpcport+"\n");
print "RPC port=" + rpcport
#f.write("port="+str(p2p_port(n))+"\n");
#rpcport = str(rpc_port(n))
#f.write("rpcport="+rpcport+"\n");
#print "RPC port=" + rpcport
f.write("listenonion=0\n");
# TODO: maybe make these optional, defaulted to on for now
f.write("addressindex=1\n");
@@ -115,8 +115,11 @@ def initialize_chain(test_dir):
cmd_args = cmd + " -datadir="+datadir + " -rpcwait getblockcount"
if os.getenv("PYTHON_DEBUG", ""):
print "initialize_chain: komodod started, calling: " + cmd_args
subprocess.check_call([ cmd, "-datadir="+datadir,
"-rpcwait", "getblockcount"]) #, stdout=devnull)
strcmd = cmd + " " + "-datadir="+datadir + " -rpcwait getblockcount"
print("Running " + strcmd)
subprocess.check_call(strcmd, shell=True);
#subprocess.check_call([ cmd, "-rpcwait", "getblockcount"], stdout=devnull)
if os.getenv("PYTHON_DEBUG", ""):
print "initialize_chain: komodo-cli -rpcwait getblockcount completed"
devnull.close()
@@ -198,13 +201,20 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
if extra_args is not None: args.extend(extra_args)
bitcoind_processes[i] = subprocess.Popen(args)
devnull = open("/dev/null", "w+")
cmd = os.getenv("BITCOINCLI", "komodo-cli")
cmd_args = cmd + "-datadir="+datadir + " -rpcwait getblockcount"
print("cmd=" + cmd)
#TODO:
cmd_args = " -datadir="+datadir + " -rpcport=64368 -rpcwait -conf=" +datadir+"/komodo.conf getblockcount "
if os.getenv("PYTHON_DEBUG", ""):
print "start_node: komodod started, calling : " + cmd_args
subprocess.check_call([ os.getenv("BITCOINCLI", "komodo-cli"), "-datadir="+datadir] +
_rpchost_to_args(rpchost) +
["-rpcwait", "getblockcount"], stdout=devnull)
print "start_node: komodod started, calling : " + cmd + " " + cmd_args
strcmd = cmd + " " + cmd_args
print("Running " + strcmd)
subprocess.check_call(strcmd, shell=True);
#subprocess.check_call([ os.getenv("BITCOINCLI", "komodo-cli"), "-datadir="+datadir] +
# _rpchost_to_args(rpchost) +
# ["-rpcwait", "-rpcport=6438", "getblockcount"], stdout=devnull)
if os.getenv("PYTHON_DEBUG", ""):
print "start_node: calling komodo-cli -rpcwait getblockcount returned"
devnull.close()