def start_nodes_from_dir(ddir, num_nodes=MAX_NODES):
    self.log.info(('Starting %d nodes...' % num_nodes))
    for i in range(num_nodes):
        datadir = initialize_datadir(ddir, i)
        if (i == 0):
            open(os.path.join(datadir, '.incomplete'), 'a').close()
        args = [os.getenv('BITCOIND', 't_notesd'), '-spendzeroconfchange=1', '-server', '-keypool=1', ('-datadir=' + datadir), '-discover=0']
        self.nodes.append(TestNode(i, ddir, extra_args=[], rpchost=None, timewait=self.rpc_timewait, binary=None, stderr=None, mocktime=self.mocktime, coverage_dir=None))
        self.nodes[i].args = args
        self.start_node(i)
        self.log.info(('Node %d started.' % i))
    self.log.info('Nodes started. Waiting for RPC connections...')
    for node in range(4):
        self.nodes[node].wait_for_rpc_connection()
    self.log.info('Connecting nodes')
    connect_nodes_clique(self.nodes)
def start_nodes_from_dir(ddir, num_nodes=MAX_NODES):
    self.log.info(('Starting %d nodes...' % num_nodes))
    for i in range(num_nodes):
        datadir = initialize_datadir(ddir, i)
        if (i == 0):
            open(os.path.join(datadir, '.incomplete'), 'a').close()
        args = [os.getenv('BITCOIND', 't_notesd'), '-spendzeroconfchange=1', '-server', '-keypool=1', ('-datadir=' + datadir), '-discover=0']
        self.nodes.append(TestNode(i, ddir, extra_args=[], rpchost=None, timewait=self.rpc_timewait, binary=None, stderr=None, mocktime=self.mocktime, coverage_dir=None))
        self.nodes[i].args = args
        self.start_node(i)
        self.log.info(('Node %d started.' % i))
    self.log.info('Nodes started. Waiting for RPC connections...')
    for node in range(4):
        self.nodes[node].wait_for_rpc_connection()
    self.log.info('Connecting nodes')
    connect_nodes_clique(self.nodes)