package peer

import (
	"flag"
	"os"
)

func Main() {
	args := mainArgs{}

	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 args.NetName == "" || args.HubAddress == "" || args.APIKey == "" {
		flag.Usage()
		os.Exit(1)
	}

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