This repository contains the source code for a peer-to-peer (P2P) file storage system developed in Go. It leverages low-level TCP connections to create a decentralized network where users can store and retrieve files securely and efficiently.
The primary goal was to design a system that is:
- Resilient: No single point of failure. The network remains operational even if some peers go offline.
- Secure: Data privacy and integrity are paramount, ensured through strong encryption.
- Performant: File retrieval is optimized for speed and low network overhead.
- Built a robust P2P network from the ground up using Go's standard networking libraries.
- Peers communicate directly over TCP for seamless and reliable data replication.
- Files are automatically replicated across a configurable number of peers to ensure data durability.
- A local caching mechanism is implemented to store frequently accessed files, drastically reducing retrieval times for subsequent requests.
- Encrypted Storage: All file chunks are encrypted before being written to disk on any peer.
- Secure Transmission: Data is encrypted during transit between peers to prevent eavesdropping.
- Designed and implemented an intelligent data request strategy that fetches file chunks from the most optimal peers, enhancing performance and minimizing latency.