github.com/noirx94/tendermintmp@v0.0.1/rpc/core/routes.go (about) 1 package core 2 3 import ( 4 rpc "github.com/tendermint/tendermint/rpc/jsonrpc/server" 5 ) 6 7 // TODO: better system than "unsafe" prefix 8 9 // Routes is a map of available routes. 10 var Routes = map[string]*rpc.RPCFunc{ 11 // subscribe/unsubscribe are reserved for websocket events. 12 "subscribe": rpc.NewWSRPCFunc(Subscribe, "query"), 13 "unsubscribe": rpc.NewWSRPCFunc(Unsubscribe, "query"), 14 "unsubscribe_all": rpc.NewWSRPCFunc(UnsubscribeAll, ""), 15 16 // info API 17 "health": rpc.NewRPCFunc(Health, ""), 18 "status": rpc.NewRPCFunc(Status, ""), 19 "net_info": rpc.NewRPCFunc(NetInfo, ""), 20 "blockchain": rpc.NewRPCFunc(BlockchainInfo, "minHeight,maxHeight"), 21 "genesis": rpc.NewRPCFunc(Genesis, ""), 22 "genesis_chunked": rpc.NewRPCFunc(GenesisChunked, "chunk"), 23 "block": rpc.NewRPCFunc(Block, "height"), 24 "block_by_hash": rpc.NewRPCFunc(BlockByHash, "hash"), 25 "block_results": rpc.NewRPCFunc(BlockResults, "height"), 26 "commit": rpc.NewRPCFunc(Commit, "height"), 27 "check_tx": rpc.NewRPCFunc(CheckTx, "tx"), 28 "tx": rpc.NewRPCFunc(Tx, "hash,prove"), 29 "tx_search": rpc.NewRPCFunc(TxSearch, "query,prove,page,per_page,order_by"), 30 "block_search": rpc.NewRPCFunc(BlockSearch, "query,page,per_page,order_by"), 31 "validators": rpc.NewRPCFunc(Validators, "height,page,per_page"), 32 "dump_consensus_state": rpc.NewRPCFunc(DumpConsensusState, ""), 33 "consensus_state": rpc.NewRPCFunc(ConsensusState, ""), 34 "consensus_params": rpc.NewRPCFunc(ConsensusParams, "height"), 35 "unconfirmed_txs": rpc.NewRPCFunc(UnconfirmedTxs, "limit"), 36 "num_unconfirmed_txs": rpc.NewRPCFunc(NumUnconfirmedTxs, ""), 37 38 // tx broadcast API 39 "broadcast_tx_commit": rpc.NewRPCFunc(BroadcastTxCommit, "tx"), 40 "broadcast_tx_sync": rpc.NewRPCFunc(BroadcastTxSync, "tx"), 41 "broadcast_tx_async": rpc.NewRPCFunc(BroadcastTxAsync, "tx"), 42 43 // abci API 44 "abci_query": rpc.NewRPCFunc(ABCIQuery, "path,data,height,prove"), 45 "abci_info": rpc.NewRPCFunc(ABCIInfo, ""), 46 47 // evidence API 48 "broadcast_evidence": rpc.NewRPCFunc(BroadcastEvidence, "evidence"), 49 } 50 51 // AddUnsafeRoutes adds unsafe routes. 52 func AddUnsafeRoutes() { 53 // control API 54 Routes["dial_seeds"] = rpc.NewRPCFunc(UnsafeDialSeeds, "seeds") 55 Routes["dial_peers"] = rpc.NewRPCFunc(UnsafeDialPeers, "peers,persistent,unconditional,private") 56 Routes["unsafe_flush_mempool"] = rpc.NewRPCFunc(UnsafeFlushMempool, "") 57 }