|
|
|
@ -85,11 +85,11 @@ def initialize_chain(test_dir):
@@ -85,11 +85,11 @@ def initialize_chain(test_dir):
|
|
|
|
|
# Create cache directories, run bitcoinds: |
|
|
|
|
for i in range(4): |
|
|
|
|
datadir=initialize_datadir("cache", i) |
|
|
|
|
args = [ "bitcoind", "-keypool=1", "-datadir="+datadir, "-discover=0" ] |
|
|
|
|
args = [ os.getenv("BITCOIND", "bitcoind"), "-keypool=1", "-datadir="+datadir, "-discover=0" ] |
|
|
|
|
if i > 0: |
|
|
|
|
args.append("-connect=127.0.0.1:"+str(p2p_port(0))) |
|
|
|
|
bitcoind_processes[i] = subprocess.Popen(args) |
|
|
|
|
subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir, |
|
|
|
|
subprocess.check_call([ os.getenv("BITCOINCLI", "bitcoin-cli"), "-datadir="+datadir, |
|
|
|
|
"-rpcwait", "getblockcount"], stdout=devnull) |
|
|
|
|
devnull.close() |
|
|
|
|
rpcs = [] |
|
|
|
@ -150,11 +150,11 @@ def start_node(i, dir, extra_args=None, rpchost=None):
@@ -150,11 +150,11 @@ def start_node(i, dir, extra_args=None, rpchost=None):
|
|
|
|
|
Start a bitcoind and return RPC connection to it |
|
|
|
|
""" |
|
|
|
|
datadir = os.path.join(dir, "node"+str(i)) |
|
|
|
|
args = [ "bitcoind", "-datadir="+datadir, "-keypool=1", "-discover=0" ] |
|
|
|
|
args = [ os.getenv("BITCOIND", "bitcoind"), "-datadir="+datadir, "-keypool=1", "-discover=0" ] |
|
|
|
|
if extra_args is not None: args.extend(extra_args) |
|
|
|
|
bitcoind_processes[i] = subprocess.Popen(args) |
|
|
|
|
devnull = open("/dev/null", "w+") |
|
|
|
|
subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir] + |
|
|
|
|
subprocess.check_call([ os.getenv("BITCOINCLI", "bitcoin-cli"), "-datadir="+datadir] + |
|
|
|
|
_rpchost_to_args(rpchost) + |
|
|
|
|
["-rpcwait", "getblockcount"], stdout=devnull) |
|
|
|
|
devnull.close() |
|
|
|
|