package main import ( "encoding/json" "flag" "fmt" "github.com/sirupsen/logrus" "io/ioutil" "os" ) var ENV string var NET_HOST string var API_HOST string func main() { logrus.SetFormatter(&logrus.TextFormatter{ FullTimestamp: true, }) logrus.SetLevel(logrus.InfoLevel) logrus.SetOutput(os.Stdout) flag.StringVar(&ENV, "env", "dev", "执行环节dev|prod") flag.Parse() if ENV == "dev" { NET_HOST = "https://localnet.eosget.io:443/" API_HOST = "https://test.superstar.team/" } else { NET_HOST = "https://proxy.eosnode.tools:443/" API_HOST = "https://superstar.team/" } configPath := fmt.Sprintf("./config/bots.%s.json", ENV) f, err := ioutil.ReadFile(configPath) CheckError(err) bots := []Account{} err = json.Unmarshal(f, &bots) CheckError(err) Run(bots) //Transfer("kunbiao", 9) }