Coder Social home page Coder Social logo

edelta's Introduction

  • REQUIREMENTS
  • BUILD
  • EXAMPLE

REQUIREMENTS

This project is build on Ubuntu 22.04.2 LTS with following dependencies:

Leveldb, sockpp, bshoshany-thread-pool and xdelta3 are packed in source.

The remaining dependencies can be installed via apt-get:

$ apt-get install llvm cmake libboost-all-dev libssl1.0-dev libgf-complete-dev libsnappy-dev

BUILD

Build this project with cmake

$ mkdir -p ./build && cd ./build
$ cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
$ make -j 6
$ cd ..

And the executables of server and client will be built to the directory ./bin

EXAMPLE

server

It's required to run four server instances simultaneously in different directories.

The server will try to read the json configuration file when it starts, and the format of the configuration file is as follows:

{
  "cluster": [
    {"ip": "127.0.0.1", "port": "6000"},
    {"ip": "127.0.0.1", "port": "6001"},
    {"ip": "127.0.0.1", "port": "6002"},
    {"ip": "127.0.0.1", "port": "6003"}
  ],
  "database dir": "./meta/DedupDB/",
  "container dir": "./meta/Container/",
  "clean": true
}
  • cluster specifies the addresses of the four servers
  • database dir specifies the path where the database files are stored
  • container dir specifies the path where the share data container files are stored
  • clean specifies whether the server will clear the files saved during previous runs

Note that the database dir and container dir for the four server instances need to be different, so it is recommended to use relative paths

Usage of server:

$ server <port index> [config file]
  • <port> specifies the addresses index of this server node in the config file
  • [config file] is an optinal, from which the configuration file will be loaded, otherwise a default configuration will be loaded if not specified or fail to load the given one.

client

The client will try to read a configuration file named config in the current directory, and the configuration file specifies the addresses of the four servers in turn:

0.0.0.0:6000
0.0.0.0:6001
0.0.0.0:6002
0.0.0.0:6003

Usage of client:

To upload a file:

$ client <target file> <user id> -u
  • <target file> specifies the path to the file to upload
  • <user id> specifies the user id

To download a file:

$ client <target file> <user id> -d
  • <target file> specifies a previously uploaded file
  • <user id> specifies the user id

If the download is successful, a file named <target file>.decode will appear in the same directory as the uploaded file

And we can use md5sum to check whether the uploaded one and the downloaded one are identical:

$ md5sum <upload file> <download file>

edelta's People

Contributors

yuchonghu avatar

Stargazers

Shlqlu avatar AxelSingleton avatar

Watchers

 avatar

Forkers

georgy760

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.