I was thinking to design a application which is not dependent on server and can directly send and receive data to and from other clients.I learned it is possible with UDP but how can new users join in the network and is it possible for any node to calculate active nodes .I would implement this with Socket programming using java .


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

The Satoshi client discovers the IP address and port of nodes in several different ways.

Nodes discover their own external address by various methods.
Nodes receive the callback address of remote nodes that connect to them.
Nodes makes DNS request to receive IP addresses.
Nodes can use addresses hard coded into the software.
Nodes exchange addresses with other nodes.
Nodes store addresses in a database and read that database on startup.
Nodes can be provided addresses as command line arguments
Nodes read addresses from a user provided text file on startup

That last item is probably a reference to this line CAutoFile filein = fopen("addr.txt", "rt"); in db.cpp in the src folder of Bitcoin 0.1.0

Further reading:

  • Can you give me more insight ,what protocols would new client take in the network .I heard the software itself have hard coded ip address which are used by client to become part of the network .Can you clarify ,Thanks in advance . – Siddharth Teli Jan 23 '20 at 9:58
  • @SiddharthTeli Related: How do Bitcoin Clients Find Each Other? – Ugam Kamat Jan 23 '20 at 11:26
  • Where did the last one come from? That’s not even a thing. – Pseudonymous Jan 23 '20 at 13:49
  • @Anonymous I think there used to be a addr.dat file earlier which was removed from v0.7 or v0.8 – Ugam Kamat Jan 23 '20 at 18:27
  • 1
    @SiddharthTeli: Bitcoin.Stackexchange.com is a Q&A website not a discussion forum. Please ask a new question using the "Ask Question" button at top right of page. It will be worth searching first for similar questions (example1, example2) that may already have answers. Answer updated. – RedGrittyBrick Jan 24 '20 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.