You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.9 KiB

  1. package core
  2. import (
  3. rpc "github.com/tendermint/tendermint/rpc/lib/server"
  4. )
  5. // TODO: better system than "unsafe" prefix
  6. var Routes = map[string]*rpc.RPCFunc{
  7. // subscribe/unsubscribe are reserved for websocket events.
  8. "subscribe": rpc.NewWSRPCFunc(Subscribe, "event"),
  9. "unsubscribe": rpc.NewWSRPCFunc(Unsubscribe, "event"),
  10. // info API
  11. "status": rpc.NewRPCFunc(Status, ""),
  12. "net_info": rpc.NewRPCFunc(NetInfo, ""),
  13. "blockchain": rpc.NewRPCFunc(BlockchainInfo, "minHeight,maxHeight"),
  14. "genesis": rpc.NewRPCFunc(Genesis, ""),
  15. "block": rpc.NewRPCFunc(Block, "height"),
  16. "commit": rpc.NewRPCFunc(Commit, "height"),
  17. "tx": rpc.NewRPCFunc(Tx, "hash,prove"),
  18. "validators": rpc.NewRPCFunc(Validators, ""),
  19. "dump_consensus_state": rpc.NewRPCFunc(DumpConsensusState, ""),
  20. "unconfirmed_txs": rpc.NewRPCFunc(UnconfirmedTxs, ""),
  21. "num_unconfirmed_txs": rpc.NewRPCFunc(NumUnconfirmedTxs, ""),
  22. // broadcast API
  23. "broadcast_tx_commit": rpc.NewRPCFunc(BroadcastTxCommit, "tx"),
  24. "broadcast_tx_sync": rpc.NewRPCFunc(BroadcastTxSync, "tx"),
  25. "broadcast_tx_async": rpc.NewRPCFunc(BroadcastTxAsync, "tx"),
  26. // abci API
  27. "abci_query": rpc.NewRPCFunc(ABCIQuery, "path,data,prove"),
  28. "abci_info": rpc.NewRPCFunc(ABCIInfo, ""),
  29. // control API
  30. "dial_seeds": rpc.NewRPCFunc(UnsafeDialSeeds, "seeds"),
  31. "unsafe_flush_mempool": rpc.NewRPCFunc(UnsafeFlushMempool, ""),
  32. // config is not in general thread safe. expose specifics if you need em
  33. // "unsafe_set_config": rpc.NewRPCFunc(UnsafeSetConfig, "type,key,value"),
  34. // profiler API
  35. "unsafe_start_cpu_profiler": rpc.NewRPCFunc(UnsafeStartCPUProfiler, "filename"),
  36. "unsafe_stop_cpu_profiler": rpc.NewRPCFunc(UnsafeStopCPUProfiler, ""),
  37. "unsafe_write_heap_profile": rpc.NewRPCFunc(UnsafeWriteHeapProfile, "filename"),
  38. }