Post
Topic
Board Development & Technical Discussion
Merits 5 from 1 user
Re: Peer-To-Peer Discussion, How Events Play Out.
by
hhanh00
on 27/11/2014, 06:02:49 UTC
⭐ Merited by ABCbits (5)
This should be of value to you if you haven't seen it already: https://en.bitcoin.it/wiki/Protocol_specification

2. Downloading the Blockchain:
- When my client (node) requests pieces of the blockchain (from my node's peers), how does this play out?
You request data with 'getdata' passing an inventory vector, basically a hash + type. Blocks are returned as 'block' messages.
You can ask for many blocks at once, but they will come back as separate messages.

Quote
4. Do Nodes Request More Peers from other Peers?
- So do nodes ask other peers for their peer list, to expand their own peer list?
- In other words, is it self expanding, or do I have to manually add more peers?
You can proactively ask for peers with the 'getaddr' request or they may be given to you anyway with the 'addr' message.
To bootstrap, there is a hardcoded list of DNS servers specially setup to deliver peer addresses.

Quote
5. Is my Node Being Sent New Transactions (that are not processed)?
- So is my node being sent the thousands of new transactions that have not been processed yet (i.e. put into a block)?
- Or is there something else happening here?
They are sent to you as 'tx' messages if they are being relayed (live). However, if you connect to a peer and want to see the tx that it has unconfirmed, you must send a 'mempool' message.

Quote
6. Right Now, What Data is Being Sent to My Running Node?
- So what data right now is being sent to my node (I'm running the standard Bitcoin WIN Client/Node), I know there is new blockchain data, but what else?
If you don't ask for anything and no one ask you anything, passively you can get: inv, addr, tx, ping and alert.

Quote
7. Is there Any Know P2P Structures that Bitcoin is modeled after?
- What P2P structure is Bitcoin modeled after, is it like a gossip style model or something else entirely?
Similar but different clients have different strategies. The protocol doesn't spec out this aspect. AFAIK, the reference client requests from a single peer but relays to many.