Esempio n. 1
0
def _geth_blockchain(
        request,
        ethchain_client,
        private_keys,
        eth_p2p_port,
        eth_rpc_port,
        tmpdir,
        random_marker,
        genesis_path,
):

    """ Helper to do proper cleanup. """
    geth_process = geth_create_blockchain(
        ethchain_client,
        private_keys,
        eth_p2p_port,
        eth_rpc_port,
        str(tmpdir),
        request.config.option.verbose,
        random_marker,
        genesis_path,
    )

    def _cleanup():
        geth_process.terminate()

        cleanup_tasks()

    request.addfinalizer(_cleanup)
    return geth_process
Esempio n. 2
0
def _geth_blockchain(
    request,
    ethchain_client,
    private_keys,
    eth_p2p_port,
    ethrpc_endpoint,
    ethrpc_port,
    tmpdir,
    random_marker,
    genesis_path,
):
    """ Helper to do proper cleanup. """
    geth_process = geth_create_blockchain(
        ethchain_client=ethchain_client,
        private_keys=private_keys,
        gethport=eth_p2p_port,
        gethrpcendpoint=ethrpc_endpoint,
        gethrpcport=ethrpc_port,
        base_datadir=str(tmpdir),
        verbosity=request.config.option.verbose,
        random_marker=random_marker,
        genesis_path=genesis_path,
    )

    def _cleanup():
        geth_process.terminate()

        cleanup_tasks()

    request.addfinalizer(_cleanup)
    return geth_process