Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(p2putil): print remote address #2331

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/p2putil/pex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestRPCPeers(t *testing.T) {
})
require.NoError(t, err)

for _, network := range []netconf.ID{netconf.Staging, netconf.Omega} {
for _, network := range []netconf.ID{netconf.Mainnet, netconf.Omega, netconf.Staging} {
t.Run(network.String(), func(t *testing.T) {
rpcServer := network.Static().ConsensusRPC()
t.Logf("Fetching RPC peers from %s", rpcServer)
Expand All @@ -84,10 +84,8 @@ func TestRPCPeers(t *testing.T) {

t.Logf("Fetched %d peers", info.NPeers)
for i, peer := range info.Peers {
addr, err := p2p.NewNetAddressString(p2p.IDAddressString(peer.NodeInfo.ID(), peer.NodeInfo.ListenAddr))
require.NoError(t, err)

t.Logf("Peer %d: %s, %s", i, peer.NodeInfo.Moniker, addr)
t.Logf("Peer %d: %s, %s", i, peer.NodeInfo.Moniker, peer.RemoteIP)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also print peer.NodeInfo.ID() so we can find them in the logs by their ID

}
})
}
Expand Down
Loading