cloning bitcoin how bitcoin find new nodes

cloning bitcoin how bitcoin find new nodes

I am studying blockchain, cpp and crypto so I cloned bitcoin and created a new altcoin.

everything it is working fine as I expected, but i have some questions which i could not find a answer.

the question it is about nodes,let me explain my case.

I have now 3 VM's running the bitcoin clone wallets which it is a new coin now.

vm 1 = it is connected to the node 100.00.00.0

coinname.conf

addnode=100.00.00.0

vm 2 = it is the server which provide the ip: 100.00.00.0 for the vm 1

vm 3 = random wallet as well connected to the ip 100.00.00.0 for the vm2.

coinname.conf

addnode=100.00.00.0

I removed the nodes and dns from net.cpp for do this experiment ok?

strMainNetDNSSeed[][2]

pnSeed[]

so I started do experiment, turning of the VM 2 which provides the ip for the wallets connect.

after this the VM1 and VM3 lost the connection, fine I expected that.

so my question is, how the wallet VM 1 and VM 3 will connect by themselves and keep the networking running if the VM 2 if the server it is offline? and as well if the 2 users don't know the ip it is sharing the nodes?

I searched this topics bellow but i could not find what I am looking for.

How does bitcoin find peers?

How do bitcoin nodes initially find peers?

https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery

EDIT: the user bellow was right, after while the other wallets get the peers and nodes , so does not matter anymore if the VM2 it is offline, the network keeps on, amazing thing about bitcoin. :)

https://ift.tt/2pPuwR1

Comments

Popular posts from this blog

sendrawtransaction and txn-mempool-conflict

couldn't connect to server: EOF reached (code 1)