1. Adam Lindsay
  2. thrifty-p2p


Adam Lindsay  committed 13fa662

Updated readme for new CLI options and utilities.

  • Participants
  • Parent commits 1606832
  • Branches default

Comments (0)

Files changed (2)


View file
  • Ignore whitespace
 === Basic usage ===
-  python location.py [[peer_node] port_num]
+  python location.py [-h peer_node] [-p port_num] [--help]
 Initiates and/or joins a simple peer-to-peer network. Default port_num
 is 9900. Absent a peer_node (which is the peer initially contacted for
 The basic server uses consistent hashing via hash_ring.py, developed by
 Amir Salihefendic. For better and for worse, I modified the code to
-allow for easier node set manipulations and different node resolution
-behavior so that it's more trivially related to md5 hashes.
+allow for easier node set manipulations (as if it were a list) and 
+different node resolution behavior so that the internal keys are more 
+directly related to md5 hashes.
 The library requires the Apache Thrift Python libraries to be installed,
-but does not currently technically require the Thrift compiler or any
-other language libraries.
+but - because the thrift compiler has been run already - does not currently 
+require the Thrift compiler or any other language libraries.
 === Design priorities ===
 Although diststore.thrift uses locator.thrift for a lot of its interfaces,
-the implementation overloads many of the base methods. Let's hope it ends
-up an informative example for either one of us. 
+the implementation overloads some of the base methods as an illustration 
+of how this simple library might be used in other projects.
 Example usage, run this in a couple terminal windows:
   python storeserver.py
   python storeput.py b banana
   python storeput.py c crayon
   python storeput.py d dinosaur
+  python storeprimer.py
 You can then query the store:
-  python storeget.py c
+  python storeget.py  c
+  python storetest.py
 or start a new server, and see how a minimum of the existing keys 
 redistribute themselves:

File diststore.thrift

View file
  • Ignore whitespace
 include "locator.thrift"
-struct StarterPackage {
- 1: list<locator.Location> nodes,
- 2: map<string, string>    store,
 service Store extends locator.Locator {
  string                 get     (1:string key)
  oneway void            put     (1:string key, 2:string value)
-# StarterPackage         join    (1:locator.Location location)
-# map<string, string>    add     (1:locator.Location location, 2:list<locator.Location> authorities)