An easy to use real time file synchronization application built using Python.
These instructions will get you a copy of the project and ready for use on your local machine.
-
Click on the link to download the tool - Interact.zip
-
Extract the zip folder
-
Python 3.7
-
Clone this repository using the command:
git clone https://github.com/KrishnanSG/Interact.git cd Interact
-
Then install a few required dependencies by using your favorite terminal
pip install -r requirements.txt
You're almost there. The following steps will guide you on how to use this tool.
Use the following commands if you have downloaded the tool using steps described in quick access.
-
Open your favourite terminal
-
Creating host server
./Interact.exe <filename> --host
-
Ask your friend to connect to the server
./Interact.exe <filename> Provide inputs for the prompt messages
-
Creating host server
python main.py <filename> --host
-
Ask your friend to connect to the server
python main.py <filename> Provide inputs for the prompt messages.
-
Enjoy Interact 😀. We automatically detect modification made in the file, so just save the file.
You may use the following command to get help regarding the tool
./Interact.exe --help or python main.py --help
Most of the file synchronziers send the complete file across the network for every sync cycle, this causes unnecessary data transfer.
Let's consider this case where you make a modification on line 10 but your file containing 1000 lines is sent across the network.
" To solve this problem Interact was developed. "
BloomFilter
A Bloom filter is a space-efficient probabilistic data structure that is used to test whether an element is a member of a set. Check out this link to know more.
We will be using a few terms in the due course of the explanation.
- Host - the user who has intiated the P2P server.
- Client - the user who connects to the host.
- User1 - the user who initates the sync cycle (would have made some modification to the file).
- User2 - the user whose file will get updated.
- getMissingContent() - a function to find the missing contents.
- syncFile() - a function to merge (reproduce the changes on the destination).
The algorithm developed does synchronization effieciently since the size of the BloomFiter transmitted is in bits while the file would be in MBs.
The total average transmition cost was found out to be size_of_BloomFilter (Few btyes) + number of lines modified (a few 100 bytes).
- Krishnan S G - @KrishnanSG
- Sivagiri Visakan - @SivagiriVisakan