PeerVault is a P2P distributed file storage system that allows you to store and retrieve files across a distributed network of nodes. It uses encryption to secure your files and ensures redundancy by broadcasting files to multiple peers in the network and makes sure they’re available even if one computer goes offline.
- Distributed File Storage: Files are stored across multiple nodes in the network.
- Encryption: Files are encrypted before being stored and decrypted when retrieved.
- Streaming Support: Handles large files efficiently using streaming.
- Custom Protocol: Uses a lightweight custom protocol for communication between nodes.
- Peer Discovery: Automatically connects to other nodes in the network for redundancy.
-
Download the project:
git clone https://github.com/AdityaKrSingh26/PeerVault.git cd PeerVault -
Build the project:
make build
Start a node:
./bin/fs -addr :3000Store a file like this:
data := bytes.NewReader([]byte("Hello, PeerVault!"))
fileServer.Store("myfile.txt", data)Retrieve a file like this:
reader, err := fileServer.Get("myfile.txt")
if err != nil {
log.Fatal(err)
}
data, _ := ioutil.ReadAll(reader)
fmt.Println(string(data)) // Output: Hello, PeerVault!-
Start the first computer:
./bin/fs -addr :3000
-
Start the second computer:
./bin/fs -addr :7000
-
Start the third computer and connect to the first two:
./bin/fs -addr :5000 -bootstrap :3000,:7000
Now, you can store and retrieve files across all three computers!
Run tests to make sure everything works:
make test