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.

41 lines
934 B

  1. package main
  2. import (
  3. "flag"
  4. "os"
  5. cmn "github.com/tendermint/tmlibs/common"
  6. "github.com/tendermint/tmlibs/log"
  7. priv_val "github.com/tendermint/tendermint/types/priv_validator"
  8. )
  9. func main() {
  10. var (
  11. chainID = flag.String("chain-id", "mychain", "chain id")
  12. numClients = flag.Int("clients", 1, "number of concurrently connected clients")
  13. privValPath = flag.String("priv", "", "priv val file path")
  14. socketAddr = flag.String("socket.addr", ":46659", "socket bind addr")
  15. logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout)).With("module", "priv_val")
  16. )
  17. flag.Parse()
  18. logger.Info("Reading args privValidatorSocketServer", "chainID", *chainID, "privPath", *privValPath)
  19. privVal := priv_val.LoadPrivValidatorJSON(*privValPath)
  20. pvss := priv_val.NewPrivValidatorSocketServer(
  21. logger,
  22. *chainID,
  23. *socketAddr,
  24. *numClients,
  25. privVal,
  26. nil,
  27. )
  28. pvss.Start()
  29. cmn.TrapSignal(func() {
  30. pvss.Stop()
  31. })
  32. }