move DialSeeds to go-p2p and add to rpc

This commit is contained in:
Ethan Buchman
2016-01-20 13:12:42 -05:00
parent 4b40a58c0e
commit 3cce757adc
7 changed files with 69 additions and 60 deletions

View File

@ -12,6 +12,7 @@ var Routes = map[string]*rpc.RPCFunc{
"unsubscribe": rpc.NewWSRPCFunc(UnsubscribeResult, "event"),
"status": rpc.NewRPCFunc(StatusResult, ""),
"net_info": rpc.NewRPCFunc(NetInfoResult, ""),
"dial_seeds": rpc.NewRPCFunc(DialSeedsResult, "seeds"),
"blockchain": rpc.NewRPCFunc(BlockchainInfoResult, "minHeight,maxHeight"),
"genesis": rpc.NewRPCFunc(GenesisResult, ""),
"get_block": rpc.NewRPCFunc(GetBlockResult, "height"),
@ -54,6 +55,14 @@ func NetInfoResult() (ctypes.TMResult, error) {
}
}
func DialSeedsResult(seeds []string) (ctypes.TMResult, error) {
if r, err := DialSeeds(seeds); err != nil {
return nil, err
} else {
return r, nil
}
}
func BlockchainInfoResult(min, max int) (ctypes.TMResult, error) {
if r, err := BlockchainInfo(min, max); err != nil {
return nil, err