refactor-for-testability (#3)
Co-authored-by: jdl <jdl@desktop> Co-authored-by: jdl <jdl@crumpington.com> Reviewed-on: #3
This commit is contained in:
23
peer/main.go
Normal file
23
peer/main.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package peer
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
conf := peerConfig{}
|
||||
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user