Skip to content

elff1/dfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

P2P Decentralized File Sharing (DFS)

A Rust-based peer-to-peer decentralized file sharing application.


🚀 Features

  • Peer Discovery & Networking: Powered by rust-libp2p for robust decentralized communication.
  • gRPC API: File operations exposed via tonic for easy integration.
  • Multi-threaded Transfers: Efficient uploads/downloads using tokio.
  • Data Integrity: Merkle tree verification with rs_merkle ensures files are untampered and complete.
  • Efficient Metadata Storage: Uses serde_cbor for compact binary encoding of file metadata.
  • Persistent System State: rust-rocksdb for reliable, high-performance storage.
  • Fault Tolerance: Automatic recovery and partition handling.
  • Modular Architecture: Easily extend or customize components.

🛠️ Getting Started

Prerequisites

  • Rust (latest stable)

Build & Run

cargo build --release
cargo run --release

📚 Usage Guide

1. Start DFS Nodes

Start multiple nodes to form your P2P network:

cargo run --release -- --base-path ./node1 --grpc-port 8888 start
cargo run --release -- --base-path ./node2 --grpc-port 9999 start

2. Publish a File

Send a PublishFile gRPC request to localhost:8888 (node 1).

3. Download a File

Send a Download gRPC request to localhost:9999 (node 2), using the fileId from node 1's logs after publishing.

Hint: The gRPC interface is defined in proto/dfs.proto.


📝 TODOs

  • Add support for file versioning.
  • Develop a web-based management dashboard.
  • Write comprehensive tests and benchmarks.
  • Add documentation for API usage.

📊 Code Statistics

Generated by cloc:

❯ cloc src
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Rust                            18            411             86           2582
-------------------------------------------------------------------------------
SUM:                            18            411             86           2582
-------------------------------------------------------------------------------

📄 License

This project is licensed under the MIT License.

About

A Rust-based peer-to-peer decentralized file sharing application.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages