]> git.mxchange.org Git - quix0rs-apt-p2p.git/blob - README.txt
call back from GetValues each time we get some new values
[quix0rs-apt-p2p.git] / README.txt
1 quick example:
2
3 >>> import khashmir
4 >>> k = khashmir.test_one(4444)  # choose any port
5
6 If you want to make another peer in the same session, use peer = khashmir.Khashmir(host, port) then do peer.app.run() to register with the already running thread.
7
8
9 >>> k.addContact('127.0.0.1', 8080)  # locate another peer
10 >>> k.findCloseNodes()  # query the network to bootstrap our table
11
12 Keys are always 20-character strings (sha1 hashes)
13
14 >>> k.storeKeyForValue(key, value)  # no callback right now
15 >>> k.valueForKey(key, callback)
16