GithubHelp home page GithubHelp logo

libp2p-rust-dht's Introduction

sifis-dht

Actions Status CodeCov LICENSE

The SIFIS-HOME DHT is a component that offers a completely distributed publish/subscribe mechanism through which SIFIS-HOME applications can exchange messages.

The SIFIS-HOME DHT allows to publish both persistent and volatile messages. Persistent messages are messages that need to be stored in a persistent way, so that they are available even after a node reboot operation. Volatile messages are instead messages that need to be delivered to all the available applications but that do not need to be persisted on disk. The SIFIS-HOME DHT has a built-in mechanism to solve possible data conflicts that can arise when a network partition occurs. In detail, every time a message is published on the DHT, the DHT also stores its publication timestamp. Then, the publication timestamp is used to assure that only the most recently published messages will be stored and made available to the applications.

Build

cargo build --release

You can find the sifis-dht executable in the target/release folder.

Test

cargo test

Usage

sifis-dht <SQLITE_FILE> <PRIVATE_KEY_FILE> <IS_PERSISTENT_CACHE> <SHARED_KEY> <HTTP_PORT> <LOOPBACK_ONLY>

where

SQLITE_FILE: absolute path of the sqlite file where persistent messages published on the DHT are stored.

PRIVATE_KEY_FILE: path to the file containing the private key of the node in PEM format. A 2048 bytes long private key file in PEM format can be generated using command "openssl genrsa -out private.pem 2048". If private_key_file does not exist, the key pair is automatically generated by sifis-dht and stored inside file private_key_file .

IS_PERSISTENT_CACHE: if set to true indicates that sifis-dht is authorized to write messages to the provided sqlite file. If set to false, the SQLITE_FILE content will only be used to initialize the cache.

SHARED_KEY: 32 bytes long shared key in hex format (command "openssl rand -hex 32" can be used to generate a random key)

HTTP_PORT: port to be used for the HTTP interface

LOOPBACK_ONLY: if set to true, only the loopback interface will be used, meaning that only other local instances of sifis-dht are discovered. If set to false, all the available network interfaces of the device will be used. Hence, two sifis-dht instances running on the same local network should discover each other.

Acknowledgements

libp2p-rust-dht's People

Contributors

ddeguglielmo avatar lu-zero avatar arpad-m avatar luni-4 avatar dodomorandi avatar

libp2p-rust-dht's Issues

Split the library crate from the binary one

Given we'll have crates using the dht through the library cache would be good to move everything that should not be shared (e.g. rust and websocket layer) to the binary crate.

My suggestion is to have in the library only the domocache level exposed.

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.