package peer

import (
	"flag"
	"os"
)

func Main() {
	conf := 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.Parse()

	if conf.NetName == "" || conf.HubAddress == "" || conf.APIKey == "" {
		flag.Usage()
		os.Exit(1)
	}

	peer := newPeerMain(conf)
	peer.Run()
}
