Browse Source

Update README.md

pull/9/head
jaekwon 10 years ago
parent
commit
2139b488ef
1 changed files with 41 additions and 12 deletions
  1. +41
    -12
      peer/README.md

+ 41
- 12
peer/README.md View File

@ -1,25 +1,43 @@
## Channel ""
## Channels
Each peer connection is multiplexed into channels. Each channel can optionally have an associated filter which determines whether the peer already knows of the message. The system is designed to be easily extensible for various applications.
<hr />
### Default channel
The default channel is used to communicate state changes, pings, peer exchange, and other automatic internal messages that all P2P protocols would want implemented.
<table>
<tr>
<td><b>Channel</b></td>
<td>""</td>
</tr>
<tr>
<td><b>Filter</b></td>
<td>None</td>
<td>None<br/>Messages in this channel is not filtered.</td>
</tr>
<tr>
<td><b>Message</b></td>
<td><b>Messages</b></td>
<td>
<ul>
<li>RefreshFilterMsg</li>
<li>PingMsg/PongMsg</li>
<li>PeerExchangeMsg</li>
<li>RefreshFilterMsg</li>
</ul>
</td>
</tr>
</table>
<hr />
### Block channel
## Channel "block"
The block channel is used to propagate block or header information to new peers or peers catching up with the blockchain.
<table>
<tr>
<td><b>Channel</b></td>
<td>"block"</td>
</tr>
<tr>
<td><b>Filter</b></td>
<td>
@ -38,16 +56,23 @@
</td>
</tr>
</table>
<hr />
### Mempool channel
## Channel "mempool"
The mempool channel is used for broadcasting new transactions that haven't yet entered the blockchain. It uses a lossy bloom filter on either end, but with sufficient fanout and filter nonce updates every new block, all transactions will eventually reach every node.
<table>
<tr>
<td><b>Channel</b></td>
<td>"mempool"</td>
</tr>
<tr>
<td><b>Filter</b></td>
<td>
Bloom filter (n:10k, p:0.02 -> k:6, m:10KB)<br/>
Refreshes every new block
Each peer's filter has a random nonce that scrambles the message hashes<br/>
The filter & nonce refreshes every new block<br/>
</td>
</tr>
<tr>
@ -59,14 +84,22 @@
</td>
</tr>
</table>
<hr />
### Consensus channel
The consensus channel broadcasts all information used in the rounds of the Tendermint consensus mechanism.
## Channel "consensus"
<table>
<tr>
<td><b>Channel</b></td>
<td>"consensus"</td>
</tr>
<tr>
<td><b>Filter</b></td>
<td>
Bitarray filter<br/>
Each validator has a predetermined index in teh bitarray<br/>
Refreshes every new consensus round
</td>
</tr>
@ -81,7 +114,3 @@
</td>
</tr>
</table>

Loading…
Cancel
Save