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
720 B

  1. package main
  2. import (
  3. "flag"
  4. "fmt"
  5. "os"
  6. cmn "github.com/tendermint/tmlibs/common"
  7. "github.com/tendermint/tmlibs/log"
  8. priv_val "github.com/tendermint/tendermint/types/priv_validator"
  9. )
  10. var chainID = flag.String("chain-id", "mychain", "chain id")
  11. var privValPath = flag.String("priv", "", "priv val file path")
  12. func main() {
  13. flag.Parse()
  14. logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)).With("module", "priv_val")
  15. socketAddr := "localhost:46659"
  16. fmt.Println(*chainID)
  17. fmt.Println(*privValPath)
  18. privVal := priv_val.LoadPrivValidatorJSON(*privValPath)
  19. pvss := priv_val.NewPrivValidatorSocketServer(logger, socketAddr, *chainID, privVal)
  20. pvss.Start()
  21. cmn.TrapSignal(func() {
  22. pvss.Stop()
  23. })
  24. }