Skip to content

0xphen/syncx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Syncx 🚧

Syncx facilitates client-server interactions for file uploads and downloads, utilizing Google Cloud Storage. The server stores files uploaded by clients, who can later retrieve these files along with a Merkle proof to verify integrity. The project comprises four crates, implementing a simple yet effective architecture with gRPC communication, a background worker system, and MongoDB and Redis for data management.

Crates Overview

  • merkle-tree: Implements an efficient Merkle tree for data integrity verification. It generates trees from any data convertible to bytes and includes leaf indexing for fast Merkle proof verification.

  • common: A shared library between the client and server. It centralizes common functionalities to avoid code duplication and enhance maintainability.

  • client: A CLI-based client application. It handles file uploads to the server, file downloads, and locally stores the Merkle root for uploaded files.

  • server: Manages file storage on Google Cloud Storage, handles client requests for file uploads and downloads, and provides Merkle proofs for downloaded files. Client credentials are securely managed via MongoDB.

Setup

Dependencies

To set up this project, you need the protoc Protocol Buffers compiler, along with Protocol Buffers resource files.. For installing and setting up the Protocol Buffer compiler, refer to the tonic documentation.

Build

Ensure Rust is installed on your machine. The and Clone the repository and install dependencies:

$ git clone git@github.com:0xphen/syncx.git
$ cd syncx
$ cargo build

Usage

Before running the server or worker, set up your .env file in the root of the server crate.

Run the server and worker

$ cargo run --bin server

In another terminal, run the worker:

$ cargo run --bin worker

Client

Register client on server

$ cargo run create_account -p "<password>"  
Upload file(s) server

This command uploads all files in the specified directory, and deletes them afterwards.

$ cargo run upload -d <path to directory>
Download file from server
$ cargo run download -f <name of file> -d <path to save download>
Read merkle root of uploaded files
$ cargo run merkleroot 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages