def export_traces_command(execution_date, **kwargs):
        task_instance = kwargs['ti']
        live_uri = task_instance.xcom_pull(key='live_uri',
                                           task_ids='node_watch')
        with TemporaryDirectory() as tempdir:
            start_block, end_block = get_block_range(tempdir,
                                                     execution_date,
                                                     provider_uri=live_uri)
            logging.info(
                'Calling export_traces({}, {}, {}, ...,{}, {}, {}, {})'.format(
                    start_block, end_block, export_batch_size,
                    export_max_workers, live_uri, export_genesis_traces_option,
                    export_daofork_traces_option))
            export_traces.callback(
                start_block=start_block,
                end_block=end_block,
                batch_size=export_batch_size,
                output=os.path.join(tempdir, "traces.csv"),
                max_workers=export_max_workers,
                provider_uri=live_uri,
                genesis_traces=export_genesis_traces_option,
                daofork_traces=export_daofork_traces_option,
            )

            copy_to_export_path(os.path.join(tempdir, "traces.csv"),
                                export_path("traces", execution_date))
Example #2
0
def export_traces_command(execution_date, **kwargs):
    with TemporaryDirectory() as tempdir:
        start_block, end_block = get_block_range(tempdir, execution_date)

        export_traces.callback(
            start_block=start_block,
            end_block=end_block,
            batch_size=export_batch_size,
            output=os.path.join(tempdir, "traces.csv"),
            max_workers=export_max_workers,
            provider_uri=web3_provider_uri_archival,
            genesis_traces=export_genesis_traces_option,
            daofork_traces=export_daofork_traces_option,
        )

        copy_to_export_path(os.path.join(tempdir, "traces.csv"),
                            export_path("traces", execution_date))
    def export_traces_command(execution_date, provider_uri, **kwargs):
        with TemporaryDirectory() as tempdir:
            start_block, end_block = get_block_range(tempdir, execution_date, provider_uri)

            logging.info('Calling export_traces({}, {}, {}, ...,{}, {}, {}, {})'.format(
                start_block, end_block, export_batch_size, export_max_workers, provider_uri,
                export_genesis_traces_option, export_daofork_traces_option
            ))
            export_traces.callback(
                start_block=start_block,
                end_block=end_block,
                batch_size=export_batch_size,
                output=os.path.join(tempdir, "traces.csv"),
                max_workers=export_max_workers,
                provider_uri=provider_uri,
                genesis_traces=export_genesis_traces_option,
                daofork_traces=export_daofork_traces_option,
            )

            copy_to_export_path(
                os.path.join(tempdir, "traces.csv"), export_path("traces", execution_date)
            )