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.

55 lines
1.0 KiB

10 years ago
  1. package main
  2. import (
  3. "fmt"
  4. "os"
  5. "github.com/tendermint/tendermint2/config"
  6. "github.com/tendermint/tendermint2/daemon"
  7. "github.com/tendermint/tendermint2/logger"
  8. )
  9. func main() {
  10. args := os.Args[1:]
  11. if len(args) == 0 {
  12. fmt.Println(`Tendermint
  13. Commands:
  14. daemon Run the tendermint node daemon
  15. gen_account Generate new account keypair
  16. gen_validator Generate new validator keypair
  17. gen_tx Generate new transaction
  18. probe_upnp Test UPnP functionality
  19. `)
  20. return
  21. }
  22. switch args[0] {
  23. case "daemon":
  24. config.ParseFlags(args[1:])
  25. logger.Reset()
  26. var deborable daemon.DeboraMode
  27. if len(args) > 1 {
  28. switch args[1] {
  29. case "debora":
  30. deborable = daemon.DeboraPeerMode
  31. case "dev":
  32. deborable = daemon.DeboraDevMode
  33. }
  34. }
  35. daemon.Daemon(deborable)
  36. case "gen_account":
  37. gen_account()
  38. case "gen_validator":
  39. gen_validator()
  40. case "gen_tx":
  41. config.ParseFlags(args[1:])
  42. logger.Reset()
  43. gen_tx()
  44. case "probe_upnp":
  45. probe_upnp()
  46. default:
  47. fmt.Printf("Unknown command %v\n", args[0])
  48. }
  49. }