24 lines
462 B
Go
24 lines
462 B
Go
package peer
|
|
|
|
import (
|
|
"flag"
|
|
"os"
|
|
)
|
|
|
|
func Main() {
|
|
conf := Config{}
|
|
|
|
flag.StringVar(&conf.NetName, "name", "", "[REQUIRED] The network name.")
|
|
flag.StringVar(&conf.HubAddress, "hub-address", "", "[REQUIRED] The hub address.")
|
|
flag.StringVar(&conf.APIKey, "api-key", "", "[REQUIRED] The node's API key.")
|
|
flag.Parse()
|
|
|
|
if conf.NetName == "" || conf.HubAddress == "" || conf.APIKey == "" {
|
|
flag.Usage()
|
|
os.Exit(1)
|
|
}
|
|
|
|
peer := New(conf)
|
|
peer.Run()
|
|
}
|