Exemplo n.º 1
0
 def get_p2p_server(self) -> LightServer:
     if self._p2p_server is None:
         self._p2p_server = LightServer(
             privkey=self._nodekey,
             port=self._port,
             chain=self.get_full_chain(),
             chaindb=AsyncChainDB(self._base_db),
             headerdb=self.headerdb,
             base_db=self._base_db,
             network_id=self._network_id,
             max_peers=self._max_peers,
             event_bus=self.event_bus,
             metrics_registry=self.metrics_service.registry,
         )
     return self._p2p_server
Exemplo n.º 2
0
 def get_p2p_server(self) -> LightServer:
     if self._p2p_server is None:
         self._p2p_server = LightServer(
             privkey=self._nodekey,
             port=self._port,
             chain=self.get_full_chain(),
             chaindb=AsyncChainDB(self._base_db),
             headerdb=self.headerdb,
             base_db=self._base_db,
             network_id=self._network_id,
             max_peers=self._max_peers,
             token=self.master_cancel_token,
             event_bus=self.event_bus,
         )
     return self._p2p_server
Exemplo n.º 3
0
 def get_p2p_server(self) -> LightServer:
     if self._p2p_server is None:
         manager = self.db_manager
         self._p2p_server = LightServer(
             privkey=self._nodekey,
             port=self._port,
             chain=self.get_full_chain(),
             chaindb=manager.get_chaindb(),  # type: ignore
             headerdb=self.headerdb,
             base_db=manager.get_db(),  # type: ignore
             network_id=self._network_id,
             max_peers=self._max_peers,
             bootstrap_nodes=self._bootstrap_nodes,
             preferred_nodes=self._preferred_nodes,
             token=self.cancel_token,
             event_bus=self.event_bus,
         )
     return self._p2p_server
Exemplo n.º 4
0
 def get_p2p_server(self) -> LightServer:
     if self._p2p_server is None:
         manager = self.db_manager
         self._p2p_server = LightServer(
             self._nodekey,
             self._port,
             manager.get_chain(),  # type: ignore
             manager.get_chaindb(),  # type: ignore
             self.headerdb,
             manager.get_db(),  # type: ignore
             self._network_id,
             max_peers=self._max_peers,
             peer_class=LESPeer,
             bootstrap_nodes=self._bootstrap_nodes,
             preferred_nodes=self._preferred_nodes,
             token=self.cancel_token,
         )
     return self._p2p_server
Exemplo n.º 5
0
 def get_p2p_server(self) -> LightServer:
     if self._p2p_server is None:
         manager = self.db_manager
         self._p2p_server = LightServer(
             self._nodekey,
             self._port,
             manager.get_chain(),  # type: ignore
             manager.get_chaindb(),  # type: ignore
             self.headerdb,
             manager.get_db(),  # type: ignore
             self._network_id,
             max_peers=self._max_peers,
             bootstrap_nodes=self._bootstrap_nodes,
             preferred_nodes=self._preferred_nodes,
             use_discv5=self._use_discv5,
             token=self.cancel_token,
             event_bus=self._plugin_manager.event_bus_endpoint,
         )
     return self._p2p_server