bmuller / kademlia

A DHT in Python using asyncio
http://kademlia.readthedocs.org
MIT License
830 stars 210 forks source link

Problem of Run multiple node #55

Closed csunny closed 6 years ago

csunny commented 6 years ago

Hello, I meet some mistake when i run multiple node.

Node A

2018-11-30 17:38:32,641 - kademlia.network - INFO - Node 410271437375177868241350581552805887836623615468 listening on 0.0.0.0:8468
2018-11-30 17:38:32,642 - kademlia.network - DEBUG - Refreshing routing table
2018-11-30 17:38:40,002 - kademlia.protocol - INFO - never seen 127.0.0.1:8469 before, adding to router
2018-11-30 17:38:40,005 - kademlia.protocol - INFO - finding neighbors of 361734964577977192664527317510177695264778001408 in local table
2018-11-30 17:38:40,009 - kademlia.protocol - INFO - finding neighbors of 361734964577977192664527317510177695264778001408 in local table

Node B

2018-11-30 17:35:51,994 - kademlia.network - INFO - Node 785497310352827902615457672872274918546086031709 listening on 0.0.0.0:1234
2018-11-30 17:35:52,002 - kademlia.network - DEBUG - Refreshing routing table
2018-11-30 17:35:52,002 - kademlia.network - DEBUG - Attempting to bootstrap node with 1 initial contacts
Did not received reply for msg id b'r+uBvXlcuyTQsB1WhRhEX7hzPxg=' within 5 seconds
2018-11-30 17:35:57,006 - kademlia.crawling - INFO - creating spider with peers: []
2018-11-30 17:35:57,006 - kademlia.crawling - INFO - crawling network with nearest: ()
2018-11-30 17:36:26,830 - kademlia.protocol - INFO - never seen 127.0.0.1:8469 before, adding to router
2018-11-30 17:36:26,835 - kademlia.protocol - INFO - finding neighbors of 1009438779640377194790323085010479765906207537747 in local table

This error raise, and i don't known how to fix this .

Did not received reply for msg id b'r+uBvXlcuyTQsB1WhRhEX7hzPxg=' within 5 seconds

when i run get and set I can connect A or B, but when i set a value in A, It can't get in the node B. I am confused, somebody can explain this to me ?

bmuller commented 6 years ago

Can you attach the code you're running with exact steps to reproduce? I already see something suspicious - the third line of Node A's logs:

2018-11-30 17:38:40,002 - kademlia.protocol - INFO - never seen 127.0.0.1:8469 before, adding to router

Port 8469 isn't being listened to on Node A (port 8468) or Node B (1234) - so I suspect you had another node running before on 8469 and then turned it off - which is why it won't respond to a message.

csunny commented 6 years ago

@bmuller 👍 Yes, just as your say, I run multiple node test successfully. Thank you so much.