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.

32 lines
666 B

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