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.

30 lines
633 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. tmspPtr := flag.String("tmsp", "socket", "TMSP server: socket | grpc")
  11. serialPtr := flag.Bool("serial", false, "Enforce incrementing (serial) txs")
  12. flag.Parse()
  13. app := counter.NewCounterApplication(*serialPtr)
  14. // Start the listener
  15. _, err := server.NewServer(*addrPtr, *tmspPtr, app)
  16. if err != nil {
  17. Exit(err.Error())
  18. }
  19. // Wait forever
  20. TrapSignal(func() {
  21. // Cleanup
  22. })
  23. }