Can I hardcode a set of multiaddresses for a given nodeId in the peerstore ? #3060
-
Hi, I'd like to make sure that a couple of peers are always resolved to a set of very specific multiaddrs for api users of the peerstore. The use-case here is for static relays used by autorelay: I would like to make sure that whatever other calls to AddAddrs/SetAddrs, the addresses seen by the addrsplosion.go code are the ones I have hardcoded. Is there a better way to do this than to re-implement a peerstore with the desired semantics ? Mathieu |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can use
method on the peerstore. |
Beta Was this translation helpful? Give feedback.
-
I don't think libp2p offers a way to do that, but maybe it should? What you can do though is wrap the libp2p-provided |
Beta Was this translation helpful? Give feedback.
I don't think libp2p offers a way to do that, but maybe it should?
What you can do though is wrap the libp2p-provided
PeerStore
interface, and implement special logic for those couple of peers.