Bump libp2p (#3709)
This commit is contained in:
parent
a07d14cd99
commit
29297e9ce4
|
@ -80,10 +80,10 @@ type
|
|||
proc toInfo(node: BeaconNode, peerId: PeerId): RestPeerInfo =
|
||||
RestPeerInfo(
|
||||
peerId: $peerId,
|
||||
addrs: node.network.switch.peerStore.addressBook.get(peerId).toSeq().mapIt($it),
|
||||
protocols: node.network.switch.peerStore.protoBook.get(peerId).toSeq(),
|
||||
protoVersion: node.network.switch.peerStore.protoVersionBook.get(peerId),
|
||||
agentVersion: node.network.switch.peerStore.agentBook.get(peerId)
|
||||
addrs: node.network.switch.peerStore[AddressBook][peerId].mapIt($it),
|
||||
protocols: node.network.switch.peerStore[ProtoBook][peerId],
|
||||
protoVersion: node.network.switch.peerStore[ProtoVersionBook][peerId],
|
||||
agentVersion: node.network.switch.peerStore[AgentBook][peerId]
|
||||
)
|
||||
|
||||
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
|
||||
# filter such multiaddresses like `/ip4/0.0.0.0` or local addresses or
|
||||
# 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:
|
||||
$addrs[len(addrs) - 1]
|
||||
else:
|
||||
|
@ -200,8 +200,8 @@ proc installNodeApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||
state: peer.connectionState.toString(),
|
||||
direction: peer.direction.toString(),
|
||||
# Fields `agent` and `proto` are not part of specification
|
||||
agent: node.network.switch.peerStore.agentBook.get(peer.peerId),
|
||||
proto: node.network.switch.peerStore.protoVersionBook.get(peer.peerId)
|
||||
agent: node.network.switch.peerStore[AgentBook][peer.peerId],
|
||||
proto: node.network.switch.peerStore[ProtoVersionBook][peer.peerId]
|
||||
)
|
||||
res.add(peer)
|
||||
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),
|
||||
state: peer.connectionState.toString(),
|
||||
direction: peer.direction.toString(),
|
||||
agent: node.network.switch.peerStore.agentBook.get(peer.peerId), # Fields `agent` and `proto` are not
|
||||
proto: node.network.switch.peerStore.protoVersionBook.get(peer.peerId) # part of specification
|
||||
agent: node.network.switch.peerStore[AgentBook][peer.peerId], # Fields `agent` and `proto` are not
|
||||
proto: node.network.switch.peerStore[ProtoVersionBook][peer.peerId] # part of specification
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit cba3ca3c3e7bb0ffa8d91aa7c3115a90eb17712a
|
||||
Subproject commit 718374d890f3997b56bee61cb5971eb367f05b59
|
Loading…
Reference in New Issue