Skip to content
A P2P-based high performance key-value pair storage library
Branch: master
Clone or download
Latest commit b9581f5 Nov 20, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
all changed from maven to gradle Nov 9, 2017
benchmark cleanup and smaller fixes May 6, 2015
core fixing testcases Nov 20, 2018
dht
examples Improved SCTP support. Adding base for relaying Dec 3, 2017
gradle/wrapper upgraded to latest version Oct 16, 2018
interop cleanup and smaller fixes May 6, 2015
nat
replication Improved SCTP support. Adding base for relaying Dec 3, 2017
social changed from maven to gradle Nov 9, 2017
storage changed from maven to gradle Nov 9, 2017
task
tracker Improved SCTP support. Adding base for relaying Dec 3, 2017
.checkstyle.xml tomp2p release 5 initial commit Sep 4, 2013
.gitignore
.tomp2p-header-check.txt
.travis.yml make travis work with java 8 Mar 11, 2017
LICENSE.txt
README.md
build.gradle
gradlew Improved SCTP support. Adding base for relaying Dec 3, 2017
gradlew.bat Improved SCTP support. Adding base for relaying Dec 3, 2017
release_instructions.txt NAT fixes Sep 16, 2015
settings.gradle first sctp4nat commit -> contains errors Nov 14, 2017

README.md

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();
You can’t perform that action at this time.