This commit is contained in:
jdl
2025-09-01 18:09:24 +02:00
parent e91cbfe957
commit 5f0b00ff46
6 changed files with 102 additions and 196 deletions

View File

@@ -6,18 +6,18 @@ import (
)
func Main() {
conf := mainArgs{}
args := mainArgs{}
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.StringVar(&args.NetName, "name", "", "[REQUIRED] The network name.")
flag.StringVar(&args.HubAddress, "hub-address", "", "[REQUIRED] The hub address.")
flag.StringVar(&args.APIKey, "api-key", "", "[REQUIRED] The node's API key.")
flag.Parse()
if conf.NetName == "" || conf.HubAddress == "" || conf.APIKey == "" {
if args.NetName == "" || args.HubAddress == "" || args.APIKey == "" {
flag.Usage()
os.Exit(1)
}
peer := newPeerMain(conf)
peer := newPeerMain(args)
peer.Run()
}