forked from driftluo/tentacle
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from nervosnetwork/upgrade-dep
chore: add readme and upgrade molecule
- Loading branch information
Showing
18 changed files
with
772 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,34 @@ | ||
# discovery | ||
## Discovery | ||
Node discovery (mainly same with bitcoin, for blockchain project) | ||
|
||
### Discovery behavior | ||
|
||
On the current NAT forwarding network environment, whether it is self-discovery or the discovery behavior | ||
of the other party is not completely accurate, it is certain that the address received by | ||
the user is not 100% available. | ||
|
||
There are two actions in this protocol: | ||
|
||
- When the connection is established, the requester(Client) will actively request the responder(Server) to | ||
request the list of available addresses that the responder has stored. **WARNING**: This behavior is only | ||
allowed once, otherwise it will be disconnected by the other peers. | ||
|
||
- Each node periodically broadcasts hot address to its neighbor peers. The hot address refers to the listen | ||
address of the neighbor peers that the node keeps communicating continuously, which means active connection. | ||
|
||
### Message type | ||
|
||
``` | ||
/// request for address list | ||
GetNodes { | ||
version: Uint32, | ||
count: Uint32, | ||
listen_port: PortOpt, | ||
} | ||
/// response address list | ||
Nodes { | ||
announce: Bool, | ||
items: NodeVec, | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.