Exemple #1
0
    async def sync(self, args: Namespace, logger: logging.Logger,
                   chain: AsyncChainAPI, base_db: AtomicDatabaseAPI,
                   peer_pool: BasePeerPool, event_bus: EndpointAPI,
                   metrics_service: MetricsServiceAPI) -> None:

        # create registry for tracking beam sync pivot metrics if enabled
        if metrics_service == NOOP_METRICS_SERVICE:
            sync_metrics_registry = None
        else:
            sync_metrics_registry = SyncMetricsRegistry(metrics_service)

        syncer = BeamSyncService(
            chain,
            AsyncChainDB(base_db),
            base_db,
            cast(ETHPeerPool, peer_pool),
            event_bus,
            args.sync_from_checkpoint,
            args.force_beam_block_number,
            not args.disable_backfill,
            sync_metrics_registry,
        )

        async with background_asyncio_service(syncer) as manager:
            await manager.wait_finished()
Exemple #2
0
    async def sync(self, args: Namespace, logger: logging.Logger,
                   chain: AsyncChainAPI, base_db: AtomicDatabaseAPI,
                   peer_pool: BasePeerPool, event_bus: EndpointAPI) -> None:

        syncer = BeamSyncService(chain, AsyncChainDB(base_db), base_db,
                                 cast(ETHPeerPool, peer_pool), event_bus,
                                 args.sync_from_checkpoint,
                                 args.force_beam_block_number,
                                 not args.disable_backfill)

        async with background_asyncio_service(syncer) as manager:
            await manager.wait_finished()
Exemple #3
0
    async def sync(self, logger: Logger, chain: BaseChain,
                   db_manager: BaseManager, peer_pool: BasePeerPool,
                   event_bus: EndpointAPI, cancel_token: CancelToken) -> None:

        syncer = BeamSyncService(
            chain,
            db_manager.get_chaindb(),  # type: ignore
            db_manager.get_db(),  # type: ignore
            cast(ETHPeerPool, peer_pool),
            event_bus,
            cancel_token,
        )

        await syncer.run()
Exemple #4
0
    async def sync(self, args: Namespace, logger: Logger, chain: AsyncChainAPI,
                   base_db: AtomicDatabaseAPI, peer_pool: BasePeerPool,
                   event_bus: EndpointAPI, cancel_token: CancelToken) -> None:

        syncer = BeamSyncService(
            chain,
            AsyncChainDB(base_db),
            base_db,
            cast(ETHPeerPool, peer_pool),
            event_bus,
            args.beam_from_checkpoint,
            args.force_beam_block_number,
            cancel_token,
        )

        await syncer.run()