Replies: 1 comment 2 replies
-
Hi, for a node to connect to the network it has to first connect to another
node.
Let's say your 4th node connects to node 1, node 1 is connected to both
node 2 and 3, node 2 and 3 are not directly connected, but they are
indirectly connected through node 1.
Each node has an ID (in Hex, like 0xSomething);
So far you have 4 nodes online, all of them are connected to node 1 but
not to each other.
But each node can ask any other node "hey whats the ip of node 4", you can
do so by using the find function of a node and set the key parameter to
node 4's ID (not IP).
Your node will look through the list of nodes they are directly connected
to, if they find a node with the specified ID it will contact it otherwise
it will pick a handful of nodes it thinks are close to the one you are
looking for and ask them if they know node 4.
It's like trying to find someone but you only know the name of the street
they live on, you pick someone who lives there too and ask them if they
know someone named node 4 (ID), if they do they will tell you node 4 lives
there (giving you their IP)
if they don't they will ask someone else who might live closer if they know
node 4, so on and so forth.
I hope this explanation is clear enough, I'm not that good at explaining
things, you might want to have a look at the file "/tests/test.js", line 76
"Node lookup".
Thank you for your time and thank you for trying my code.
…On Sat, 23 Oct 2021 at 21:35, Adamu Muhammad Dankore < ***@***.***> wrote:
Let's say I have 3 nodes running, if a 4th node joins the network, how
could the first 3 nodes automatically get the new node's IP address?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFK5OMJ3HODP52ICYOHAEZ3UIMFBJANCNFSM5GSSXKAA>
.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's say I have 3 nodes running, if a 4th node joins the network, how could the first 3 nodes automatically get the new node's IP address?
Beta Was this translation helpful? Give feedback.
All reactions