mirror of https://github.com/status-im/go-waku.git
chore: add `agent-string` flag
This commit is contained in:
parent
77df9a2224
commit
a60213b14b
6
waku.go
6
waku.go
|
@ -187,6 +187,12 @@ func main() {
|
||||||
Value: &options.LogEncoding,
|
Value: &options.LogEncoding,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "agent-string",
|
||||||
|
Value: "go-waku",
|
||||||
|
Usage: "client id to advertise",
|
||||||
|
Destination: &options.UserAgent,
|
||||||
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "relay",
|
Name: "relay",
|
||||||
Value: true,
|
Value: true,
|
||||||
|
|
|
@ -152,6 +152,10 @@ func Execute(options Options) {
|
||||||
libp2pOpts = append(libp2pOpts, libp2p.NATPortMap()) // Attempt to open ports using uPNP for NATed hosts.)
|
libp2pOpts = append(libp2pOpts, libp2p.NATPortMap()) // Attempt to open ports using uPNP for NATed hosts.)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if options.UserAgent != "" {
|
||||||
|
libp2pOpts = append(libp2pOpts, libp2p.UserAgent(options.UserAgent))
|
||||||
|
}
|
||||||
|
|
||||||
if options.Websocket.Enable {
|
if options.Websocket.Enable {
|
||||||
nodeOpts = append(nodeOpts, node.WithWebsockets(options.Websocket.Address, options.Websocket.WSPort))
|
nodeOpts = append(nodeOpts, node.WithWebsockets(options.Websocket.Address, options.Websocket.WSPort))
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,6 +152,7 @@ type Options struct {
|
||||||
LogEncoding string
|
LogEncoding string
|
||||||
NAT string
|
NAT string
|
||||||
PersistPeers bool
|
PersistPeers bool
|
||||||
|
UserAgent string
|
||||||
|
|
||||||
Websocket WSOptions
|
Websocket WSOptions
|
||||||
Relay RelayOptions
|
Relay RelayOptions
|
||||||
|
|
|
@ -405,7 +405,8 @@ var DefaultLibP2POptions = []libp2p.Option{
|
||||||
libp2p.ChainOptions(
|
libp2p.ChainOptions(
|
||||||
libp2p.Transport(tcp.NewTCPTransport),
|
libp2p.Transport(tcp.NewTCPTransport),
|
||||||
libp2p.Transport(quic.NewTransport),
|
libp2p.Transport(quic.NewTransport),
|
||||||
), libp2p.UserAgent(userAgent),
|
),
|
||||||
|
libp2p.UserAgent(userAgent),
|
||||||
libp2p.ChainOptions(
|
libp2p.ChainOptions(
|
||||||
libp2p.Muxer("/yamux/1.0.0", yamux.DefaultTransport),
|
libp2p.Muxer("/yamux/1.0.0", yamux.DefaultTransport),
|
||||||
libp2p.Muxer("/mplex/6.7.0", mplex.DefaultTransport),
|
libp2p.Muxer("/mplex/6.7.0", mplex.DefaultTransport),
|
||||||
|
|
Loading…
Reference in New Issue