-
Hi, i was able to make a p2p network discovering new nodes in local network and were able to publish message using gossipsub protocol. i used below protocol to make it work
Now i want to discover nodes in public network and i have some questions related to that, Thank you for your time. I have 2 nodes lets say Node A and Node B. I tried to connect both nodes on different network with IPFS bootstrap nodes and then i ran kademlia.bootstrap(). i had my kademlia address Will implementing relay in my node code making a third node i.e. Node C and running it on an open port solve my problem? like relay in this below code? will my nodes start to detect each other? this will be relay server right? and to connect to it we should have a relay client right? so Node C will have implementation of relay server and Node A and B will have implementation of client is it correct? Can we have both implementation on one node? apart from running either one (server or client) can we run both at the same time? so all nodes will be running both server and client with a specific open port if one wants to run both. If i just change the address of identify protocol and Kademlia protocol then will it make my network different than others? I have to make my own bootstrap node for that right? can i use above mentioned Node C for that purpose? And does implementing Identify protocol into behaviour does the thing or do we have to do PROVIDE('identify protocol name') into kademlia for identify to work? Changing Identify protocol name to something else and keeping Kademlia protocol same as IPFS was still receiving Identify received events why is that so since my protocol name is different should not it just capture those which have same Identify protocol name/version? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Kademlia is one way though the libp2p bootstrap though you might want to add Node A or Node B to your store and just build out your own nodes. You would probably need to perform a query of DHT (which i recall libp2p bootstrap nodes GET queries are limited to pk and ipns but dont quote me on that since i have yet to get pk or ipns through GET successfully, however your own dht node can do more, with a little work, can do more). The other is to use rendezvous protocol for discovering peers, though it sounds like youre looking for the peer with that specific protocol, in which case you would just need to build your own node out that accept peers with that protocol unless you want to walk the DHT until you do find it and when you receive a identify event with a protocol matching that name you could add or dial it. PUTPROVIDER and GETPROVIDERS might come in handy there too if you want to go that route but if i recall, libp2p bootstrap nodes accepts a CID so thats something you might do then when you discover peers in thats providing the same cid you should proceed from there. There are other protocols out there for discovery as well. Implementing relay (with dcutr if possible) would allow others to dial your node through that relay for a connection especially if youre behind a nat. It really does nothing for discovering nodes by itself. It really sounds like you would need to build out your own dht nodes to do your own queries to locate what youre looking for or just for accepting peers with that protocol. Do you have any code to show what youre doing? |
Beta Was this translation helpful? Give feedback.
-
No its just distribution of nodes in bucket that Node A was not introduced to Node B yet but if I call Node A in get_closest_peer it does find it and adds it into bucket.
even making a Node C and running it open port and using it as a bootstrap node will solve this problem. relay comes when communication between known peers is troublesome.
yes, relay server and DCUTr client
yes but its better to have separate bootstrap node for that purpose otherwise network is a mess. |
Beta Was this translation helpful? Give feedback.
No its just distribution of nodes in bucket that Node A was not introduced to Node B yet but if I call Node A in get_closest_peer it does find it and adds it into bucket.