dht script 2

This commit is contained in:
Alex Grintsvayg 2018-04-17 13:47:56 -04:00
parent d8b424e694
commit d973d1270d

View file

@ -17,14 +17,22 @@ log = logging.getLogger(__name__)
@defer.inlineCallbacks
def run():
node = Node(externalIP='127.0.0.1', udpPort=21215)
nodeid = "9648996b4bef3ff41176668a0577f86aba7f1ea2996edd18f9c42430802c8085331345c5f0c44a7f352e2ba8ae59aaaa".decode("hex")
node = Node(node_id=nodeid, externalIP='127.0.0.1', udpPort=21999, peerPort=1234)
node.startNetwork()
yield node.joinNetwork([("127.0.0.1", 21216)])
node2 = Node(externalIP='127.0.0.1', udpPort=21217)
node2.startNetwork()
yield node2.joinNetwork([("127.0.0.1", 21216)])
yield node.joinNetwork([("127.0.0.1", 21001)])
print ""
print ""
print ""
print ""
print ""
print ""
yield node.announceHaveBlob("2bb150cb996b4bef3ff41176648a0577f86abb7f1ea2996edd18f9c42430802c8085331345c5f0c44a7f352e2ba8ae59".decode("hex"))
log.info("Shutting down...")
reactor.callLater(0, reactor.stop)
reactor.callLater(1, reactor.stop)
def main():