{"id":21643680,"url":"https://github.com/akshayxml/peer-to-peer-group-based-file-sharing-system","last_synced_at":"2025-03-19T08:46:55.584Z","repository":{"id":69055147,"uuid":"311509989","full_name":"akshayxml/Peer-to-Peer-Group-Based-File-Sharing-System","owner":"akshayxml","description":"A P2P file sharing system implemented using socket programming, multi-threading and SHA1 hashing. Users can share, download files from the group they belong to. Downloading is done in parallel with multiple pieces from multiple peers.","archived":false,"fork":false,"pushed_at":"2020-11-10T01:23:55.000Z","size":18,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-25T04:09:46.055Z","etag":null,"topics":["cpp","filesharing","multithreading","openssl","peer-to-peer","sha1-hash","socket-programming"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akshayxml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-11-10T01:22:47.000Z","updated_at":"2024-08-19T15:39:44.000Z","dependencies_parsed_at":"2023-04-05T11:16:29.274Z","dependency_job_id":null,"html_url":"https://github.com/akshayxml/Peer-to-Peer-Group-Based-File-Sharing-System","commit_stats":null,"previous_names":["akshayxml/peer-to-peer-group-based-file-sharing-system","akshayviru/peer-to-peer-group-based-file-sharing-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayxml%2FPeer-to-Peer-Group-Based-File-Sharing-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayxml%2FPeer-to-Peer-Group-Based-File-Sharing-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayxml%2FPeer-to-Peer-Group-Based-File-Sharing-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayxml%2FPeer-to-Peer-Group-Based-File-Sharing-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akshayxml","download_url":"https://codeload.github.com/akshayxml/Peer-to-Peer-Group-Based-File-Sharing-System/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244394458,"owners_count":20445631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","filesharing","multithreading","openssl","peer-to-peer","sha1-hash","socket-programming"],"created_at":"2024-11-25T05:35:30.465Z","updated_at":"2025-03-19T08:46:55.564Z","avatar_url":"https://github.com/akshayxml.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Peer-to-Peer Group Based File Sharing System\n\n## Prerequisites\n\n**Software Requirement**\n\n1. G++ compiler\n   - **To install G++ :** `sudo apt-get install g++`\n2. OpenSSL library\n\n   - **To install OpenSSL library :** `sudo apt-get install openssl`\n\n**Platform:** Linux \u003cbr/\u003e\n\n## Installation\n\n```\n1. cd client\n2. make\n3. cd ../tracker\n5. make\n6. cd ..\n```\n\n## Usage\n\n### Tracker\n\n1. Run Tracker:\n\n```\ncd tracker\n./tracker​ \u003cTRACKER INFO FILE\u003e \u003cTRACKER NUMBER\u003e\nex: ./tracker tracker_info.txt 1\n```\n\n`\u003cTRACKER INFO FILE\u003e` contains the IP, Port details of all the trackers.\n\n```\nEx:\n127.0.0.1\n5000\n127.0.0.1\n6000\n```\n\n2. Close Tracker:\n\n```\nquit\n```\n\n### Client:\n\n1. Run Client:\n\n```\ncd client\n./client​ \u003cIP\u003e:\u003cPORT\u003e \u003cTRACKER INFO FILE\u003e\nex: ./client 127.0.0.1:18000 tracker_info.txt\n```\n\n2. Create user account:\n\n```\ncreate_user​ \u003cuser_id\u003e \u003cpassword\u003e\n```\n\n3. Login:\n\n```\nlogin​ \u003cuser_id\u003e \u003cpassword\u003e\n```\n\n4. Create Group:\n\n```\ncreate_group​ \u003cgroup_id\u003e\n```\n\n5. Join Group:\n\n```\njoin_group​ \u003cgroup_id\u003e\n```\n\n6. Leave Group:\n\n```\nleave_group​ \u003cgroup_id\u003e\n```\n\n7. List pending requests:\n\n```\nlist_requests ​\u003cgroup_id\u003e\n```\n\n8. Accept Group Joining Request:\n\n```\naccept_request​ \u003cgroup_id\u003e \u003cuser_id\u003e\n```\n\n9. List All Group In Network:\n\n```\nlist_groups\n```\n\n10. List All sharable Files In Group:\n\n```\nlist_files​ \u003cgroup_id\u003e\n```\n\n11. Upload File:\n\n```\n​upload_file​ \u003cfile_path\u003e \u003cgroup_id​\u003e\n```\n\n12. Download File:​\n\n```\ndownload_file​ \u003cgroup_id\u003e \u003cfile_name\u003e \u003cdestination_path\u003e\n```\n\n13. Logout:​\n\n```\nlogout\n```\n\n14. Show_downloads: ​\n\n```\nshow_downloads\n```\n\n15. Stop sharing: ​\n\n```\nstop_share ​\u003cgroup_id\u003e \u003cfile_name\u003e\n```\n\n## Working\n\n1. User should create an account and register with tracker.\n2. Login using the user credentials.\n3. Tracker maintains information of clients with their files(shared by client) to assist the clients for the communication between peers.\n4. User can create Group and hence will become admin of that group.\n5. User can fetch list of all Groups in server.\n6. User can join/leave group.\n7. Group admin can accept group join requests.\n8. Share file across group: Shares the filename and SHA1 hash of the complete file as well as piecewise SHA1 with the tracker.\n9. Fetch list of all sharable files in a Group.\n10. Download:\n    1. Retrieve peer information from tracker for the file.\n    2. Download file from multiple peers (different pieces of file from different peers - ​piece selection algorithm​) simultaneously and all the files which client downloads will be shareable to other users in the same group. File integrity is ensured using SHA1 comparison.\n11. Piece selection algorithm used: Selects random piece and then downloads it from a random peer having that piece.\n12. Show downloads.\n13. Stop sharing file.\n14. Logout - stops sharing all files.\n15. Whenever client logins, all previously shared files before logout should automatically be on sharing mode.\n\n## Assumptions\n\n1. Only one tracker is implemented and that tracker should always be online.\n2. The peer can login from different IP addresses, but the details of his downloads/uploads will not be persistent across sessions.\n3. SHA1 integrity checking doesn't work correctly for binary files, even though in most likelihood the file would have downloaded correctly.\n4. File paths should be absolute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshayxml%2Fpeer-to-peer-group-based-file-sharing-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakshayxml%2Fpeer-to-peer-group-based-file-sharing-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshayxml%2Fpeer-to-peer-group-based-file-sharing-system/lists"}