(Jahnavi, Kriti, Sai Praneeth)
Wails (Best for Web + Native Integration) https://wails.io
Svelte + Tailwind + Go
- Central Indexing Server stores the
.torrentfiles. Individual file for each music file, mapping should be stored in a different file. - Torrents store metadata of a music file.
musix_randomXYu.torrentfile format
file_name: musix_randomXYu.mp3
artist_name: Alan Walker ft. Sabrina Carpenter
created_at: 172892350
file_size (bytes): 987890
chunk_size (bytes): 65536
duration (seconds): 173
checksum: 3849027328352347901237049
CHUNK_DATA
chunk_0: CHECKSUM_OF_CHUNK_0
chunk_1: CHECKSUM_OF_CHUNK_1
chunk_2: CHECKSUM_OF_CHUNK_2
chunk_3: CHECKSUM_OF_CHUNK_3
...
PEERS
localhost:5123
localhost:5121
localhost:5122
localhost:5126
- Also define a struct similar to this format
(For now, let's focus on only CHUNK_DATA and PEERS in .torrent files, other details can be added later)
- Define a chunking algorithm, common to both client & indexing server (same CHUNK_SIZE).
- Client uploads a music file to the central server.
- Central Server appends a random text / number to the end of file name.
musix.mp3 -> musix_randomXYu.mp3 - Central Server computes full hash of the file. Then, divides the file into chunks, computes checksums of each chunk, and stores them in struct.
- Initially, only the peer who uploaded the file will be present in the peer list (will see redundancy logic later).
- Store all these details (checksums, file_name, file_size, created_at, peer) in the struct.
- Now, after the computation, export this struct into a
.torrentfile. - Send response back to the client with the updated name (
musix_randomXYu.mp3) - Client upon receival of this response, will do the chunking locally, and stores the chunks in
chunks/folder. Choose some naming scheme for the chunks. Example,musix_randomXYu_chunk_0.chunk
- Write a function, which takes file_name as input, it should get all the chunks, merge all of them in order, and finally form the required audio.
- Check if the music file remains same, plays same after merging the divided chunks.
- (edits here)
- Remember that built client application will be an exe file. No changes after.
- Add "Change IP address of central server" option in settings.
- Maintain track of unfinished downloads at client
- After dividing the music file into chunks and sending them to respective peers, store the peers' details in a
.torrentfile. You can directly send this.torrentfile to the leeching peer. - Contributor Nodes (option for client which allows them to act as redundant servers, can be added later)
- Add option to pause / resume seeding at client’s side.