mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-28 04:01:40 +00:00
first draft of network crawler
This commit is contained in:
@ -42,8 +42,11 @@ func NetInfo() (*ctypes.ResponseNetInfo, error) {
|
||||
peers := []ctypes.Peer{}
|
||||
for _, peer := range p2pSwitch.Peers().List() {
|
||||
peers = append(peers, ctypes.Peer{
|
||||
Address: peer.Connection().RemoteAddress.String(),
|
||||
//Address: peer.Connection().RemoteAddress.String(),
|
||||
Host: peer.Nodeinfo.Host,
|
||||
IsOutbound: peer.IsOutbound(),
|
||||
P2PPort: peer.Nodeinfo.P2PPort,
|
||||
RPCPort: peer.Nodeinfo.RPCPort,
|
||||
})
|
||||
}
|
||||
return &ctypes.ResponseNetInfo{
|
||||
|
@ -78,7 +78,9 @@ type ResponseNetInfo struct {
|
||||
}
|
||||
|
||||
type Peer struct {
|
||||
Address string
|
||||
Host string // ip
|
||||
P2PPort uint16
|
||||
RPCPort uint16
|
||||
IsOutbound bool
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user