Replicator rework

* Move more of the replicator logic into the replicator class
* Add support for the RPC interface to query the storage last_id value
  that the replicator would sign and use to pick a block.
* Fix replicator connecting to gossip and change test to exercise that
  scenario.
This commit is contained in:
Stephen Akridge
2018-11-02 08:40:29 -07:00
committed by sakridge
parent fa288ab197
commit 3441d3399b
8 changed files with 212 additions and 152 deletions

View File

@@ -53,6 +53,7 @@ pub enum RpcRequest {
RegisterNode,
SignVote,
DeregisterNode,
GetStorageMiningLastId,
}
impl RpcRequest {
@@ -95,6 +96,7 @@ impl RpcRequest {
RpcRequest::RegisterNode => "registerNode",
RpcRequest::SignVote => "signVote",
RpcRequest::DeregisterNode => "deregisterNode",
RpcRequest::GetStorageMiningLastId => "getStorageMiningLastId",
};
let mut request = json!({
"jsonrpc": jsonrpc,