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.

29 lines
551 B

  1. package main
  2. import (
  3. "flag"
  4. . "github.com/tendermint/go-common"
  5. "github.com/tendermint/tmsp/example/counter"
  6. "github.com/tendermint/tmsp/server"
  7. )
  8. func main() {
  9. addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address")
  10. serialPtr := flag.Bool("serial", false, "Enforce incrementing (serial) txs")
  11. flag.Parse()
  12. app := counter.NewCounterApplication(*serialPtr)
  13. // Start the listener
  14. _, err := server.NewServer(*addrPtr, app)
  15. if err != nil {
  16. Exit(err.Error())
  17. }
  18. // Wait forever
  19. TrapSignal(func() {
  20. // Cleanup
  21. })
  22. }