Tribler / trustchain-superapp

Kotlin implementation of Trustchain and IPv8 with rich networking: multihoming of local Bluetooth+4G, decentral social networking, UDP hole punching, etc.
GNU General Public License v3.0
80 stars 63 forks source link

Extended gossiper and dummy nodes, added recommender framework #143

Closed Floor97 closed 1 year ago

Floor97 commented 1 year ago

Gossiper

The gossiper functionality was refactored and extended. Refactored the GossiperService to easily add new gossipers. Created a Gossiper abstract class as a blueprint for new gossipers, where delay and peers are required variables. delay is how long of a delay there should be in between gossips. peers determines how many peers is gossiped with. The gossipWith function in DeToksCommunity was also refactored to allow for any message that implements Serializable.

In terms of functionality, a BootGossiper, NetworkSizeGossiper and WatchTimeGossiper was added to be able to aggregate watch time per video:

Recommender

Added a recommender and a framework for (recommendation) profiles with a set of metrics for each video a user interacted with. This currently tracks the time at which the torrent was first seen and the total aggregate watch time among all users. The recommender has two functions for determining the order of videos the user should still watch. The first is random (coin toss) and the second first sorts by watch time, and secondly by the time the torrent was first seen. We also update the watch time of a video after the user swipes to a next video, and added functionality to determine which videos have (not) been watched.

Dummy nodes

The dummy nodes have been reworked to work with docker for easier setup on multiple systems. Also, 21 creative commons torrent files were added that the dummy nodes randomly pick from to boot with.

Floor97 commented 1 year ago

@InvictusRMC could you add yourself and OrestisKan as reviewers? I do not have the permission to do this, but this was requested by @synctext.

InvictusRMC commented 1 year ago

@OrestisKan can you review this PR please?

Floor97 commented 1 year ago

@OrestisKan we merged a clean code pr where we fixed for example the sketchy pairs by changing how gossip messages work. It now uses json and there is no more pair casting needed. See this pr for the changes we applied. The FIXME and NOTE were changed to TODO's, and the other requests you made have comments to address the questions/issues.

Floor97 commented 1 year ago

The Recommender class has been removed. This class was not integrated in the rest of the code yet so had no effect on the videos being played. The pr was mostly meant for the gossipers and the profiles. The recommender was also removed in our development branch as this was implemented in a different way, but this code is not yet ready for this pr and will come in a future pr. The two todo's were fixed, see this pr to view the new changes separately.

synctext commented 1 year ago

perfect! Please merge if there are no open issues. @OrestisKan

OrestisKan commented 1 year ago

perfect! Please merge if there are no open issues. @OrestisKan

@synctext Aren't the ones who created the merge requests the ones who are supposed to merge it ? Mainly in the case of merge conflicts I might introduce errors.

Floor97 commented 1 year ago

@OrestisKan we don't have the required permission to merge. Also I don't think it is a problem, because github notifies you and makes you unable to merge if there are merge conflicts.