12345678910111213141516171819202122232425262728293031323334353637 |
- package main
- import (
- "encoding/json"
- "flag"
- "fmt"
- "github.com/sirupsen/logrus"
- "io/ioutil"
- )
- var ENV string
- var NET_HOST string
- func main() {
- logrus.SetFormatter(&logrus.TextFormatter{
- DisableColors: true,
- FullTimestamp: true,
- })
- flag.StringVar(&ENV, "env", "dev", "执行环节dev|prod")
- flag.Parse()
- if ENV == "dev" {
- NET_HOST = "https://localnet.eosget.io:443/"
- } else {
- NET_HOST = "https://proxy.eosnode.tools:443/"
- }
- 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)
- }
|