You don't need to install any external libraries. This project uses only Python standard libraries.
###How to use
Open terminal windows and run "python peer.py" you should able to see help message
- Commands:
- peers - show known peers
- showfiles - show local shared files
- get <files> - download a file
- search <files> - search for a file
- exit - quit
show current Peer's neighbors
peers
show current Peer's available files
showfiles
Send request of a files and if other peer has it, it trigger download(ttl=8)
get file7.txt
Search for a file and see which peers has it(ttl=8)
search file7.txt
Exit the program
quit
###NOTE This program initializes every peer with files and name, and connect it:
Peer 1 ↔ Peer 2
Peer 1 ↔ Peer 3
Peer 2 ↔ Peer 4
Peer 2 ↔ Peer 5
UNDER shared directory, each Peer has corresponding folder to share
Peer 1 has:
file1.txt, file2.txt
Peer 2 has:
file3.txt, file4.txt
Peer 3 has:
file5.txt, file6.txt
Peer 4 has:
file6.txt, file7.txt
Peer 5 has:
file7.txt, file8.txt
Once "get file.txt" called you should able to see file being downloaded in "downloads" folder if other peers has the file.