I hereby claim:
- I am ardhipoetra on github.
- I am ardhipoetra (https://keybase.io/ardhipoetra) on keybase.
- I have a public key whose fingerprint is 7EB6 7879 CB8E 3488 D1EA 070D 4A7A C448 C4F0 FF97
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
def test_save_resume(self): | |
def do_test(): | |
tdef = TorrentDef() | |
sourcefn = os.path.join(TESTS_DATA_DIR, 'video.avi') | |
tdef.add_content(sourcefn) | |
tdef.set_tracker("http://localhost/announce") | |
tdef.finalize() | |
torrentfn = os.path.join(self.session.get_state_dir(), "gen.torrent") | |
tdef.save(torrentfn) |
import sys | |
import logging | |
import time | |
sys.path.append('/home/ardhipoetra/git/thesis/tribler/Tribler/Core/DecentralizedTracking') | |
from pymdht.core.pymdht import Pymdht as DHT | |
from pymdht.core.node import Node | |
from pymdht.plugins import lookup_a4 | |
from pymdht.plugins import routing_nice_rtt | |
from pymdht.core import exp_plugin_template |
import libtorrent as lt | |
import time | |
infohash_str = "5aec5ee9f2d044316fe1de29d221452103ceb958" | |
print "version : %s" %lt.version | |
print "start session" | |
ses = lt.session() | |
ses.listen_on(6881, 6891) |
I've put together these notes as I read about DHT's in depth and then learned how the libtorrent implementation based on the Kademlia paper actually works.
400,000,000,000
(400 billion stars), that's a 4 followed by 11 zeros.
The number of atoms in the universe is estimated to be around 10^82
.
A DHT with keys of 160 bits, can have 2^160
possible numbers, which is around 10^48
import libtorrent as lt | |
import time | |
import pprint | |
import sys | |
def create_peerlist_data(peer_info): | |
peer_dict = {} | |
peer_dict['id'] = peer_info.pid | |
peer_dict['extended_version'] = peer_info.client |