Coder Social home page Coder Social logo

tomp2p's Introduction

TomP2P Build Status

TomP2P is a P2P library and a distributed hash table (DHT) implementation which provides a decentralized key-value infrastructure for distributed applications. Each peer has a table that can be configured either to be disk-based or memory-based to store its values.

TomP2P stores key-value pairs in a distributed manner. To find the peers to store the data in the distributed hash table, TomP2P uses an iterative routing to find the closest peers. Since TomP2P uses non-blocking communication, a future object is required to keep track of future results. This key concept is used for all the communication (iterative routing and DHT operations, such as storing a value on multiple peers) in TomP2P and it is also exposed in the API. Thus, an operation such as get or put will return immediately and the user can either block the operation to wait for the completion or add a listener that gets notified when the operation completes.

Features

  • Java6 DHT implementation with non-blocking IO using Netty.
  • XOR-based iterative routing similar to Kademlia.
  • Standard DHT operations: put(), get()
  • Extended DHT operations and support for custom operations: putIfAbsent(), add(), send(), digest()
  • Selective get() using min-max or Bloom filters
  • Direct and indirect replication.
  • Mesh-based distributed tracker.
  • Data protection based on signatures.
  • Port forwarding detection and configuration via UPNP and NAT-PMP.
  • Runs with IPv6 and IPv4.
  • Network operations support the listenable future objects concept.

Code Examples (API v4.1)

//create a peer
Peer peer = new PeerMaker(new Number160(rnd)).setPorts(port).buildAndListen();

//store object
FutureDHT f =peer.put(Number160.createHash(“key”)).setObject(“hello world”).build();

//get object
FutureDHT f = peer.get(Number160.createHash(“key”)).build();

//to get the result, either add listener
f.addListener(...)
//or block
f.await()

//send direct messages to a particular peer
peer.sendDirect().setPeerAddress(peer1).setObject(“test”).build();

tomp2p's People

Contributors

tbocek avatar jonaswagner avatar ippes avatar omnibrain avatar manfredkarrer avatar chefmoensch avatar esfomeado avatar sandymac avatar

Watchers

James Cloos 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.