Ejemplo n.º 1
0
    def on_ready(self, manager_eventbus: TrinityEventBusEndpoint) -> None:
        args = self.context.args

        if not args.ethstats:
            return

        if not (args.ethstats_server_url or self.get_default_server_url()):
            self.logger.error(
                'You must provide ethstats server url using the `--ethstats-server-url`'
            )
            manager_eventbus.request_shutdown("Missing EthStats Server URL")
            return

        if not args.ethstats_server_secret:
            self.logger.error(
                'You must provide ethstats server secret using `--ethstats-server-secret`'
            )
            manager_eventbus.request_shutdown("Missing EthStats Server Secret")
            return

        if (args.ethstats_server_url):
            self.server_url = args.ethstats_server_url
        else:
            self.server_url = self.get_default_server_url()

        self.server_secret = args.ethstats_server_secret

        self.node_id = args.ethstats_node_id
        self.node_contact = args.ethstats_node_contact
        self.stats_interval = args.ethstats_interval

        self.start()
Ejemplo n.º 2
0
    def on_ready(self, manager_eventbus: TrinityEventBusEndpoint) -> None:

        light_mode = self.boot_info.args.sync_mode == SYNC_LIGHT
        is_enabled = self.boot_info.args.tx_pool and not light_mode

        unsupported = self.boot_info.args.tx_pool and light_mode

        if is_enabled and not unsupported:
            self.start()
        elif unsupported:
            unsupported_msg = "Transaction pool not available in light mode"
            self.logger.error(unsupported_msg)
            manager_eventbus.request_shutdown(unsupported_msg)
Ejemplo n.º 3
0
    def on_ready(self, manager_eventbus: TrinityEventBusEndpoint) -> None:

        light_mode = self.context.args.sync_mode == SYNC_LIGHT
        self.is_enabled = self.context.args.tx_pool and not light_mode

        unsupported = self.context.args.tx_pool and light_mode

        if unsupported:
            unsupported_msg = "Transaction pool not available in light mode"
            self.logger.error(unsupported_msg)
            manager_eventbus.request_shutdown(unsupported_msg)

        self.event_bus.subscribe(ResourceAvailableEvent, self.handle_event)
Ejemplo n.º 4
0
 def on_ready(self, manager_eventbus: TrinityEventBusEndpoint) -> None:
     if self.boot_info.args.disable_networkdb_plugin:
         self.logger.warning("Network Database disabled via CLI flag")
         # Allow this plugin to be disabled for extreme cases such as the
         # user swapping in an equivalent experimental version.
         return
     else:
         try:
             get_tracking_database(
                 get_networkdb_path(self.boot_info.trinity_config))
         except BadDatabaseError as err:
             manager_eventbus.request_shutdown(
                 "Error loading network database.  Trying removing database "
                 f"with `remove-network-db` command:\n{err}")
         else:
             self.start()