Skip to content

Commit

Permalink
added network version
Browse files Browse the repository at this point in the history
  • Loading branch information
ATREAY committed Nov 30, 2023
1 parent 75b4be3 commit 4903089
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nodebuilder/p2p/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ func routedHost(base HostBase, r routing.PeerRouting) hst.Host {

// host returns constructor for Host.
func host(params hostParams) (HostBase, error) {
buildInfo := node.GetBuildInfo()
userAgent := fmt.Sprintf("%s/%s", params.Net, buildInfo.SemanticVersion)
opts := []libp2p.Option{
libp2p.NoListenAddrs, // do not listen automatically
libp2p.AddrsFactory(params.AddrF),
libp2p.Identity(params.Key),
libp2p.Peerstore(params.PStore),
libp2p.ConnectionManager(params.ConnMngr),
libp2p.ConnectionGater(params.ConnGater),
libp2p.UserAgent(fmt.Sprintf("%s", params.Net)),
libp2p.UserAgent(userAgent),
libp2p.NATPortMap(), // enables upnp
libp2p.DisableRelay(),
libp2p.BandwidthReporter(params.Bandwidth),
Expand Down

0 comments on commit 4903089

Please sign in to comment.