ceremonyclient/go-libp2p/examples/chat-with-mdns/flags.go
Cassandra Heart dbd95bd9e9
v2.1.0 (#439)
* v2.1.0 [omit consensus and adjacent] - this commit will be amended with the full release after the file copy is complete

* 2.1.0 main node rollup
2025-09-30 02:48:15 -05:00

25 lines
668 B
Go

package main
import (
"flag"
)
type config struct {
RendezvousString string
ProtocolID string
listenHost string
listenPort int
}
func parseFlags() *config {
c := &config{}
flag.StringVar(&c.RendezvousString, "rendezvous", "meetme", "Unique string to identify group of nodes. Share this with your friends to let them connect with you")
flag.StringVar(&c.listenHost, "host", "0.0.0.0", "The bootstrap node host listen address\n")
flag.StringVar(&c.ProtocolID, "pid", "/chat/1.1.0", "Sets a protocol id for stream headers")
flag.IntVar(&c.listenPort, "port", 0, "node listen port (0 pick a random unused port)")
flag.Parse()
return c
}