mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-23 11:48:33 +00:00
Bump libp2p (#3709)
This commit is contained in:
parent
a07d14cd99
commit
29297e9ce4
@ -80,10 +80,10 @@ type
|
|||||||
proc toInfo(node: BeaconNode, peerId: PeerId): RestPeerInfo =
|
proc toInfo(node: BeaconNode, peerId: PeerId): RestPeerInfo =
|
||||||
RestPeerInfo(
|
RestPeerInfo(
|
||||||
peerId: $peerId,
|
peerId: $peerId,
|
||||||
addrs: node.network.switch.peerStore.addressBook.get(peerId).toSeq().mapIt($it),
|
addrs: node.network.switch.peerStore[AddressBook][peerId].mapIt($it),
|
||||||
protocols: node.network.switch.peerStore.protoBook.get(peerId).toSeq(),
|
protocols: node.network.switch.peerStore[ProtoBook][peerId],
|
||||||
protoVersion: node.network.switch.peerStore.protoVersionBook.get(peerId),
|
protoVersion: node.network.switch.peerStore[ProtoVersionBook][peerId],
|
||||||
agentVersion: node.network.switch.peerStore.agentBook.get(peerId)
|
agentVersion: node.network.switch.peerStore[AgentBook][peerId]
|
||||||
)
|
)
|
||||||
|
|
||||||
proc toNode(v: PubSubPeer, backoff: Moment): RestPubSubPeer =
|
proc toNode(v: PubSubPeer, backoff: Moment): RestPubSubPeer =
|
||||||
|
@ -90,7 +90,7 @@ proc getLastSeenAddress(node: BeaconNode, id: PeerId): string =
|
|||||||
# TODO (cheatfate): We need to provide filter here, which will be able to
|
# TODO (cheatfate): We need to provide filter here, which will be able to
|
||||||
# filter such multiaddresses like `/ip4/0.0.0.0` or local addresses or
|
# filter such multiaddresses like `/ip4/0.0.0.0` or local addresses or
|
||||||
# addresses with peer ids.
|
# addresses with peer ids.
|
||||||
let addrs = node.network.switch.peerStore.addressBook.get(id).toSeq()
|
let addrs = node.network.switch.peerStore[AddressBook][id]
|
||||||
if len(addrs) > 0:
|
if len(addrs) > 0:
|
||||||
$addrs[len(addrs) - 1]
|
$addrs[len(addrs) - 1]
|
||||||
else:
|
else:
|
||||||
@ -200,8 +200,8 @@ proc installNodeApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||||||
state: peer.connectionState.toString(),
|
state: peer.connectionState.toString(),
|
||||||
direction: peer.direction.toString(),
|
direction: peer.direction.toString(),
|
||||||
# Fields `agent` and `proto` are not part of specification
|
# Fields `agent` and `proto` are not part of specification
|
||||||
agent: node.network.switch.peerStore.agentBook.get(peer.peerId),
|
agent: node.network.switch.peerStore[AgentBook][peer.peerId],
|
||||||
proto: node.network.switch.peerStore.protoVersionBook.get(peer.peerId)
|
proto: node.network.switch.peerStore[ProtoVersionBook][peer.peerId]
|
||||||
)
|
)
|
||||||
res.add(peer)
|
res.add(peer)
|
||||||
return RestApiResponse.jsonResponseWMeta(res, (count: uint64(len(res))))
|
return RestApiResponse.jsonResponseWMeta(res, (count: uint64(len(res))))
|
||||||
@ -242,8 +242,8 @@ proc installNodeApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||||||
last_seen_p2p_address: getLastSeenAddress(node, peer.peerId),
|
last_seen_p2p_address: getLastSeenAddress(node, peer.peerId),
|
||||||
state: peer.connectionState.toString(),
|
state: peer.connectionState.toString(),
|
||||||
direction: peer.direction.toString(),
|
direction: peer.direction.toString(),
|
||||||
agent: node.network.switch.peerStore.agentBook.get(peer.peerId), # Fields `agent` and `proto` are not
|
agent: node.network.switch.peerStore[AgentBook][peer.peerId], # Fields `agent` and `proto` are not
|
||||||
proto: node.network.switch.peerStore.protoVersionBook.get(peer.peerId) # part of specification
|
proto: node.network.switch.peerStore[ProtoVersionBook][peer.peerId] # part of specification
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
2
vendor/nim-libp2p
vendored
2
vendor/nim-libp2p
vendored
@ -1 +1 @@
|
|||||||
Subproject commit cba3ca3c3e7bb0ffa8d91aa7c3115a90eb17712a
|
Subproject commit 718374d890f3997b56bee61cb5971eb367f05b59
|
Loading…
x
Reference in New Issue
Block a user