main.go 822 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package main
  2. import (
  3. "encoding/json"
  4. "flag"
  5. "fmt"
  6. "github.com/sirupsen/logrus"
  7. "io/ioutil"
  8. "os"
  9. )
  10. var ENV string
  11. var NET_HOST string
  12. var API_HOST string
  13. func main() {
  14. logrus.SetFormatter(&logrus.TextFormatter{
  15. FullTimestamp: true,
  16. })
  17. logrus.SetLevel(logrus.InfoLevel)
  18. logrus.SetOutput(os.Stdout)
  19. flag.StringVar(&ENV, "env", "dev", "执行环节dev|prod")
  20. flag.Parse()
  21. if ENV == "dev" {
  22. NET_HOST = "https://localnet.eosget.io:443/"
  23. API_HOST = "https://test.superstar.team/"
  24. } else {
  25. NET_HOST = "https://proxy.eosnode.tools:443/"
  26. API_HOST = "https://superstar.team/"
  27. }
  28. configPath := fmt.Sprintf("./config/bots.%s.json", ENV)
  29. f, err := ioutil.ReadFile(configPath)
  30. CheckError(err)
  31. bots := []Account{}
  32. err = json.Unmarshal(f, &bots)
  33. CheckError(err)
  34. Run(bots)
  35. //Transfer("kunbiao", 9)
  36. }