Replies: 1 comment 1 reply
-
You might also want to look into the request-response protocol for direct 1:1 messages between two nodes.
In the chat example, we use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to gracefully close a swarm and recreate it with a provided
PeerId
? Starting from the chat example, this is what I understand I'd need to do:swarm.listeners()
swarm.remove_listener()
I'm curious if there's any cleaner way to do this, though.
My use case is that a peer may need to send/receive a Gossipsub message that informs it what its keypair/
PeerId
should be (during a login, for example), and the peer will need to switch to using its existing keypair andPeerId
afterwards so the other nodes have some stable way of identifying accounts. Let me know if this model of how to usePeerId
s is incorrect or could be improved.Thanks in advance for any help!
Beta Was this translation helpful? Give feedback.
All reactions