reconnect validator

This commit is contained in:
Ethan Buchman
2016-02-02 20:21:06 -05:00
parent 2b3fc11697
commit d52f690e56
8 changed files with 99 additions and 33 deletions

View File

@ -12,11 +12,12 @@ func Routes(network *TendermintNetwork) map[string]*rpc.RPCFunc {
// "unsubscribe": rpc.NewWSRPCFunc(Unsubscribe, []string{"event"}),
"status": rpc.NewRPCFunc(StatusResult(network), ""),
"blockchain": rpc.NewRPCFunc(GetChainResult(network), "chain"),
"get_chain": rpc.NewRPCFunc(GetChainResult(network), "chainID"),
"register_chain": rpc.NewRPCFunc(RegisterChainResult(network), "chainConfig"),
"validator_set": rpc.NewRPCFunc(GetValidatorSetResult(network), "valsetID"),
"register_validator_set": rpc.NewRPCFunc(RegisterValidatorSetResult(network), "valSet"),
"register_validator_set": rpc.NewRPCFunc(RegisterValidatorSetResult(network), "valSetID"),
"validator": rpc.NewRPCFunc(GetValidatorResult(network), "valSetID,valID"),
"update_validator": rpc.NewRPCFunc(UpdateValidatorResult(network), "chainID,valID,rpcAddr"),
"start_meter": rpc.NewRPCFunc(network.StartMeter, "chainID,valID,event"),
"stop_meter": rpc.NewRPCFunc(network.StopMeter, "chainID,valID,event"),
@ -60,6 +61,12 @@ func GetValidatorResult(network *TendermintNetwork) interface{} {
}
}
func UpdateValidatorResult(network *TendermintNetwork) interface{} {
return func(chainID, valID, rpcAddr string) (NetMonResult, error) {
return network.UpdateValidator(chainID, valID, rpcAddr)
}
}
func GetMeterResult(network *TendermintNetwork) interface{} {
return func(chainID, valID, eventID string) (NetMonResult, error) {
return network.GetMeter(chainID, valID, eventID)