github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/tm2/pkg/bft/rpc/core/routes.go (about) 1 package core 2 3 import ( 4 rpc "github.com/gnolang/gno/tm2/pkg/bft/rpc/lib/server" 5 ) 6 7 // TODO: better system than "unsafe" prefix 8 // NOTE: Amino is registered in rpc/core/types/codec.go. 9 var Routes = map[string]*rpc.RPCFunc{ 10 // info API 11 "health": rpc.NewRPCFunc(Health, ""), 12 "status": rpc.NewRPCFunc(Status, ""), 13 "net_info": rpc.NewRPCFunc(NetInfo, ""), 14 "blockchain": rpc.NewRPCFunc(BlockchainInfo, "minHeight,maxHeight"), 15 "genesis": rpc.NewRPCFunc(Genesis, ""), 16 "block": rpc.NewRPCFunc(Block, "height"), 17 "block_results": rpc.NewRPCFunc(BlockResults, "height"), 18 "commit": rpc.NewRPCFunc(Commit, "height"), 19 "tx": rpc.NewRPCFunc(Tx, "hash"), 20 "validators": rpc.NewRPCFunc(Validators, "height"), 21 "dump_consensus_state": rpc.NewRPCFunc(DumpConsensusState, ""), 22 "consensus_state": rpc.NewRPCFunc(ConsensusState, ""), 23 "consensus_params": rpc.NewRPCFunc(ConsensusParams, "height"), 24 "unconfirmed_txs": rpc.NewRPCFunc(UnconfirmedTxs, "limit"), 25 "num_unconfirmed_txs": rpc.NewRPCFunc(NumUnconfirmedTxs, ""), 26 27 // tx broadcast API 28 "broadcast_tx_commit": rpc.NewRPCFunc(BroadcastTxCommit, "tx"), 29 "broadcast_tx_sync": rpc.NewRPCFunc(BroadcastTxSync, "tx"), 30 "broadcast_tx_async": rpc.NewRPCFunc(BroadcastTxAsync, "tx"), 31 32 // abci API 33 "abci_query": rpc.NewRPCFunc(ABCIQuery, "path,data,height,prove"), 34 "abci_info": rpc.NewRPCFunc(ABCIInfo, ""), 35 } 36 37 func AddUnsafeRoutes() { 38 // control API 39 Routes["dial_seeds"] = rpc.NewRPCFunc(UnsafeDialSeeds, "seeds") 40 Routes["dial_peers"] = rpc.NewRPCFunc(UnsafeDialPeers, "peers,persistent") 41 Routes["unsafe_flush_mempool"] = rpc.NewRPCFunc(UnsafeFlushMempool, "") 42 43 // profiler API 44 Routes["unsafe_start_cpu_profiler"] = rpc.NewRPCFunc(UnsafeStartCPUProfiler, "filename") 45 Routes["unsafe_stop_cpu_profiler"] = rpc.NewRPCFunc(UnsafeStopCPUProfiler, "") 46 Routes["unsafe_write_heap_profile"] = rpc.NewRPCFunc(UnsafeWriteHeapProfile, "filename") 47 }