GithubHelp home page GithubHelp logo

tempbottle / bulletinboard-dht Goto Github PK

View Code? Open in Web Editor NEW

This project forked from manuels/bulletinboard-dht

0.0 2.0 0.0 94 KB

Your internet-wide general-purpose DHT to store key/value pairs

Home Page: https://manuels.github.io/bulletinboard-dht/

License: GNU General Public License v2.0

Makefile 0.51% PowerShell 0.86% Shell 6.49% Rust 92.15%

bulletinboard-dht's Introduction

BulletinBoard DHT

Build Status Crates Version

https://github.com/manuels/bulletinboard-dht

Introduction

BulletinBoard is a general-purpose Distributed-Hash-Table based on Kademlia.

The interface is provided as a D-Bus service via these commands (see example below or python example):

Service: org.manuel.BulletinBoard
  Object Path: /
  Interface:   org.manuel.BulletinBoard
  Commands:
   - Store(app_id: str, key: [u8], value: [u8], lifetime_sec: u64)
   - Put(app_id: str, key: [u8], value: [u8])
   - Get(app_id: str, key: [u8]) -> (values: [[u8]])

Please note that the value must not exceed 2048 bytes!

The lifetime for a value you Put() in the DHT is 15 minutes, so you should call Put() every, say, 10 minutes to make sure it stays in the DHT (or just use Store()).

Installation

  1. Download

      # Debian/Ubuntu
      wget 'https://github.com/manuels/bulletinboard-dht/releases/download/v0.5.3/bulletinboard_0.5.3_amd64.deb'
    
      # Fedora
      wget 'https://github.com/manuels/bulletinboard-dht/releases/download/v0.5.3/bulletinboard-0.5.3-1.x86_64.rpm'
    
  2. Install bulletinboard

      # Debian/Ubuntu
      sudo dpkg -i bulletinboard_0.5.3_amd64.deb
    
      # Fedora
      sudo rpm -ivh bulletinboard-0.5.3.x86_64.rpm
    

Usage

Usually BulletinBoard is used by any third-party applications to store and lookup data. You can use the DBus interface to do this by hand for example in your shell scripts.

Storing Data

The Put() command stores data in the DHT. In this example we store under the key what did you eat? the value [8B,AD,F0,0D] using the application ID mytestapp:

     $ dbus-send --session \
        --type=method_call \
        --dest=org.manuel.BulletinBoard / \
        org.manuel.BulletinBoard.Put \
        string:"mytestapp" \
        array:byte:"what did you eat?" \
        array:byte:0x8B,0xAD,0xF0,0x0D

Retrieving Data

Now we can get the stored data by asking the DHT what is stored under the key what did you eat?. Using the Get() command, we get back the [8B,AD,F0,0D] value we stored previously:

     $ dbus-send --session \
        --reply-timeout=60000 \
        --print-reply \
        --type=method_call \
        --dest=org.manuel.BulletinBoard / \
        org.manuel.BulletinBoard.Get \
        string:"mytestapp" \
        array:byte:"what did you eat?"

     array [
        array of bytes [
           8B AD F0 0D
        ]
     ]

Developing

  1. Get Rust

  2. Clone

    git clone https://github.com/manuels/bulletinboard-dht.git
    
  3. Build

    cargo build --release
    

    (in bulletinboard-dht dir)

bulletinboard-dht's People

Contributors

manuels avatar

Watchers

tempbottle avatar  avatar

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.