-
Notifications
You must be signed in to change notification settings - Fork 182
/
root.go
21 lines (17 loc) · 956 Bytes
/
root.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package rpc
import (
"github.com/gorilla/mux"
"github.com/okex/exchain/libs/cosmos-sdk/client/context"
)
// Register REST endpoints
func RegisterRPCRoutes(cliCtx context.CLIContext, r *mux.Router) {
r.HandleFunc("/node_info", NodeInfoRequestHandlerFn(cliCtx)).Methods("GET")
r.HandleFunc("/syncing", NodeSyncingRequestHandlerFn(cliCtx)).Methods("GET")
r.HandleFunc("/blocks/latest", LatestBlockRequestHandlerFn(cliCtx)).Methods("GET")
r.HandleFunc("/blocks/{height}", BlockRequestHandlerFn(cliCtx)).Methods("GET")
r.HandleFunc("/block_info/{height}", BlockInfoRequestHandlerFn(cliCtx)).Methods("GET")
r.HandleFunc("/validatorsets/latest", LatestValidatorSetRequestHandlerFn(cliCtx)).Methods("GET")
r.HandleFunc("/validatorsets/{height}", ValidatorSetRequestHandlerFn(cliCtx)).Methods("GET")
// Compatible with cosmos v0.45.1
r.HandleFunc("/cosmos/base/tendermint/v1beta1/blocks/latest", LatestBlockRequestHandlerFn(cliCtx)).Methods("GET")
}