mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 11:11:20 +00:00
p2p: Added log for --p2p-host-ip (#4553)
* added log for external addr * Merge branch 'master' into log-p2p-address * Merge branch 'master' into log-p2p-address * Merge branch 'master' into log-p2p-address
This commit is contained in:
parent
dab87ba252
commit
0605118686
@ -3,6 +3,7 @@ package p2p
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"crypto/ecdsa"
|
"crypto/ecdsa"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -213,6 +214,10 @@ func (s *Service) Start() {
|
|||||||
|
|
||||||
multiAddrs := s.host.Network().ListenAddresses()
|
multiAddrs := s.host.Network().ListenAddresses()
|
||||||
logIP4Addr(s.host.ID(), multiAddrs...)
|
logIP4Addr(s.host.ID(), multiAddrs...)
|
||||||
|
|
||||||
|
p2pHostAddress := s.cfg.HostAddress
|
||||||
|
p2pTCPPort := s.cfg.TCPPort
|
||||||
|
logExternalIP4Addr(s.host.ID(), p2pHostAddress, p2pTCPPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop the p2p service and terminate all peer connections.
|
// Stop the p2p service and terminate all peer connections.
|
||||||
@ -364,3 +369,14 @@ func logIP4Addr(id peer.ID, addrs ...ma.Multiaddr) {
|
|||||||
).Info("Node started p2p server")
|
).Info("Node started p2p server")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func logExternalIP4Addr(id peer.ID, addr string, port uint) {
|
||||||
|
if addr != "" {
|
||||||
|
p := strconv.FormatUint(uint64(port), 10)
|
||||||
|
|
||||||
|
log.WithField(
|
||||||
|
"multiAddr",
|
||||||
|
"/ip4/"+addr+"/tcp/"+p+"/p2p/"+id.String(),
|
||||||
|
).Info("Node started external p2p server")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user