Beispiel #1
0
 def __init__(self, chain, db, peer_pool, token=None) -> None:
     super().__init__(token=token)
     self._chain = chain
     self._header_syncer = ETHHeaderChainSyncer(chain,
                                                db,
                                                peer_pool,
                                                token=self.cancel_token)
     self._single_header_syncer = self.HeaderSyncer_OnlyOne(
         self._header_syncer)
     self._paused_header_syncer = self.HeaderSyncer_PauseThenRest(
         self._header_syncer)
     self._draining_syncer = RegularChainBodySyncer(
         chain,
         db,
         peer_pool,
         self._single_header_syncer,
         SimpleBlockImporter(chain),
         self.cancel_token,
     )
     self._body_syncer = RegularChainBodySyncer(
         chain,
         db,
         peer_pool,
         self._paused_header_syncer,
         SimpleBlockImporter(chain),
         self.cancel_token,
     )
Beispiel #2
0
 def __init__(self,
              chain: AsyncChainAPI,
              db: BaseAsyncChainDB,
              peer_pool: ETHPeerPool,
              token: CancelToken = None) -> None:
     super().__init__(token=token)
     self._header_syncer = ETHHeaderChainSyncer(chain, db, peer_pool, token=self.cancel_token)
     self._body_syncer = RegularChainBodySyncer(
         chain,
         db,
         peer_pool,
         self._header_syncer,
         SimpleBlockImporter(chain),
         self.cancel_token,
     )