Add RPCs for checking peer best blocks & target blocks#117
Conversation
sync/src/block/extension.rs
Outdated
| } | ||
| Event::GetPeerBestBlockHashes(channel) => { | ||
| for header_downloader in self.header_downloaders.values() { | ||
| channel.send(header_downloader.best_hash()).unwrap(); |
There was a problem hiding this comment.
We need the information which peer has which best block hash.
Please pass the IP address of the peer also.
6227757 to
0d3a106
Compare
|
Is there any special reason to select |
|
Aha, SocketAddr has a port number. I agree with @HoOngEe. |
8cf6f2e to
b0d6b0c
Compare
|
I changed IpAddr into SocketAddr and updated JSON-RPC documentation |
3b65f7e to
bb3390d
Compare
HoOngEe
left a comment
There was a problem hiding this comment.
Please change license part.
spec/JSON-RPC.md
Outdated
|
|
||
| ### Returns | ||
|
|
||
| { SocketAddress: `string`, BlockHash: `H256`}[] |
There was a problem hiding this comment.
This type does not match the example.
What you said:
[
{ "SocketAddress": "xxx", "BlockHash": "yyy"},
{ "SocketAddress": "xxx2", "BlockHash": "yyy2"}, ...
]However, in the example:
[["1.2.3.4:3485", "0x56642f04d519ae3262c7ba6facf1c5b11450ebaeb7955337cfbc45420d573077"]]There was a problem hiding this comment.
Okay. Should I introduce new type such as SocketAddressAndHash, or tuple type is sufficient?
There was a problem hiding this comment.
Then the return type should be [ 'string', 'H256'][]?
bb3390d to
ae70e6b
Compare
rpc/src/v1/traits/chain.rs
Outdated
| @@ -1,4 +1,4 @@ | |||
| // Copyright 2018-2019 Kodebox, Inc. | |||
| // Copyright 2018-2020 Kodebox, Inc. | |||
There was a problem hiding this comment.
Please update the copyrights in the files that you changed.
There was a problem hiding this comment.
Sorry. I changed the copyright of wrong file. I pushed the fixed version.
ae70e6b to
2b202f7
Compare
|
There was timeout exceptions in some tests, but they passed successfully in my local machine. @majecty |
2b202f7 to
ba1525f
Compare
It resolves #71