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:
2025-03-01 20:02:27 +00:00
parent a0b5058544
commit 1d3cc1f959
68 changed files with 3908 additions and 1547 deletions

23
peer/main.go Normal file
View 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()
}