tribler.core.components ======================= .. py:module:: tribler.core.components Attributes ---------- .. autoapisummary:: tribler.core.components.CommunityT Classes ------- .. autoapisummary:: tribler.core.components.CommunityLauncherWEndpoints tribler.core.components.BaseLauncher tribler.core.components.Component tribler.core.components.ComponentLauncher tribler.core.components.ContentDiscoveryComponent tribler.core.components.DatabaseComponent tribler.core.components.TorrentCheckerComponent tribler.core.components.DHTDiscoveryComponent tribler.core.components.RSSComponent tribler.core.components.TunnelComponent tribler.core.components.VersioningComponent tribler.core.components.WatchFolderComponent Module Contents --------------- .. py:data:: CommunityT .. py:class:: CommunityLauncherWEndpoints Bases: :py:obj:`ipv8.loader.CommunityLauncher`\ [\ :py:obj:`tribler.core.session.Session`\ , :py:obj:`CommunityT`\ ] A CommunityLauncher that can supply endpoints. .. py:method:: get_endpoints() -> list[tribler.core.restapi.rest_endpoint.RESTEndpoint] Get a list of endpoints that should be loaded. .. py:class:: BaseLauncher Bases: :py:obj:`CommunityLauncherWEndpoints`\ [\ :py:obj:`CommunityT`\ ] The base class for all Tribler Community launchers. .. py:method:: get_bootstrappers(session: tribler.core.session.Session) -> list[tuple[type[ipv8.bootstrapping.bootstrapper_interface.Bootstrapper], dict]] Simply use the old Dispersy bootstrapper format. .. py:method:: get_walk_strategies() -> list[tuple[type[ipv8.peerdiscovery.discovery.DiscoveryStrategy], dict, int]] Adhere to the default walking behavior. .. py:method:: get_my_peer(ipv8: ipv8_service.IPv8, session: tribler.core.session.Session) -> ipv8.peer.Peer Get the default key. .. py:class:: Component(settings: ipv8.overlay.SettingsClass) Bases: :py:obj:`ipv8.community.Community` A glorified TaskManager. This should also really be a TaskManager. I did not make this a TaskManager because I am lazy - Quinten (2024) .. py:attribute:: bootstrappers :type: list[ipv8.bootstrapping.bootstrapper_interface.Bootstrapper] :value: [] .. py:attribute:: max_peers :value: 0 .. py:attribute:: _prefix .. py:attribute:: settings .. py:class:: ComponentLauncher Bases: :py:obj:`CommunityLauncherWEndpoints`\ [\ :py:obj:`Component`\ ] A launcher for components that simply need a TaskManager, not a full Community. .. py:method:: get_overlay_class() -> type[Component] Create a fake Community. .. py:method:: get_my_peer(ipv8: ipv8_service.IPv8, session: tribler.core.session.Session) -> ipv8.peer.Peer Our peer still uses the Tribler default key. .. py:class:: ContentDiscoveryComponent Bases: :py:obj:`BaseLauncher`\ [\ :py:obj:`tribler.core.content_discovery.community.ContentDiscoveryCommunity`\ ] Launch instructions for the content discovery community. .. py:method:: finalize(ipv8: ipv8_service.IPv8, session: tribler.core.session.Session, community: tribler.core.content_discovery.community.ContentDiscoveryCommunity) -> None When we are done launching, register our REST API. .. py:method:: get_endpoints() -> list[tribler.core.restapi.rest_endpoint.RESTEndpoint] Add the search endpoint. .. py:class:: DatabaseComponent Bases: :py:obj:`ComponentLauncher` Launch instructions for the database. .. py:method:: prepare(ipv8: ipv8_service.IPv8, session: tribler.core.session.Session) -> None Create the database instances we need for Tribler. .. py:method:: finalize(ipv8: ipv8_service.IPv8, session: tribler.core.session.Session, community: Component) -> None When we are done launching, register our REST API. .. py:method:: get_endpoints() -> list[tribler.core.restapi.rest_endpoint.RESTEndpoint] Add the database endpoint. .. py:class:: TorrentCheckerComponent Bases: :py:obj:`ComponentLauncher` Launch instructions for the torrent checker. .. py:method:: prepare(overlay_provider: ipv8_service.IPv8, session: tribler.core.session.Session) -> None Initialize the torrecht checker and the torrent manager. .. py:method:: finalize(ipv8: ipv8_service.IPv8, session: tribler.core.session.Session, community: Component) -> None When we are done launching, register our REST API. .. py:class:: DHTDiscoveryComponent Bases: :py:obj:`BaseLauncher`\ [\ :py:obj:`ipv8.dht.discovery.DHTDiscoveryCommunity`\ ] Launch instructions for the DHT discovery community. .. py:method:: finalize(ipv8: ipv8_service.IPv8, session: tribler.core.session.Session, community: ipv8.dht.discovery.DHTDiscoveryCommunity) -> None When we are done launching, register our REST API. .. py:class:: RSSComponent Bases: :py:obj:`ComponentLauncher` Launch instructions for the RSS component. .. py:method:: finalize(ipv8: ipv8_service.IPv8, session: tribler.core.session.Session, community: Component) -> None When we are done launching, register our REST API. .. py:method:: get_endpoints() -> list[tribler.core.restapi.rest_endpoint.RESTEndpoint] Add the RSS endpoint. .. py:class:: TunnelComponent Bases: :py:obj:`BaseLauncher`\ [\ :py:obj:`tribler.core.tunnel.community.TriblerTunnelCommunity`\ ] Launch instructions for the tunnel community. .. py:method:: get_kwargs(session: tribler.core.session.Session) -> dict Extend our community arguments with all necessary config settings and objects. .. py:method:: finalize(ipv8: ipv8_service.IPv8, session: tribler.core.session.Session, community: tribler.core.tunnel.community.TriblerTunnelCommunity) -> None When we are done launching, register our REST API. .. py:class:: VersioningComponent Bases: :py:obj:`ComponentLauncher` Launch instructions for the versioning of Tribler. .. py:method:: finalize(ipv8: ipv8_service.IPv8, session: tribler.core.session.Session, community: Component) -> None When we are done launching, register our REST API. .. py:method:: get_endpoints() -> list[tribler.core.restapi.rest_endpoint.RESTEndpoint] Add the database endpoint. .. py:class:: WatchFolderComponent Bases: :py:obj:`ComponentLauncher` Launch instructions for the watch folder. .. py:method:: finalize(ipv8: ipv8_service.IPv8, session: tribler.core.session.Session, community: Component) -> None When we are done launching, register our REST API.