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.

21 lines
531 B

  1. package rpc
  2. import (
  3. "net/http"
  4. . "github.com/tendermint/tendermint/common"
  5. . "github.com/tendermint/tendermint/config"
  6. )
  7. func StartHTTPServer() {
  8. http.HandleFunc("/blockchain", BlockchainInfoHandler)
  9. http.HandleFunc("/block", BlockHandler)
  10. http.HandleFunc("/broadcast_tx", BroadcastTxHandler)
  11. log.Info(Fmt("Starting RPC HTTP server on %s", Config.RPC.HTTPLAddr))
  12. go func() {
  13. log.Crit("RPC HTTPServer stopped", "result", http.ListenAndServe(Config.RPC.HTTPLAddr, RecoverAndLogHandler(http.DefaultServeMux)))
  14. }()
  15. }