Sharing Allow/Block Lists between Nodes #4881
-
I'm trying to use the allow block list as part of my Network Behaviour and was curious about how I could potentially share this information between nodes. As far as I can tell the way that allow_block_list is implemented there is no way to tell if a Peer is present in an AllowedPeers list. How would one node query another node to see if a Peer is in its AllowedPeers list or not? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The best way to do this is to exchange messages either through floodsub, gossipsub or your own protocol. In your case, you could use |
Beta Was this translation helpful? Give feedback.
libp2p-allow-block-list
is just a module that enforces your allow/block list policy. It is not the source of truth for your allow-block list as you need to first add all the peers to it.Thus, whatever components calls the API of
libp2p-allow-block-list
is in charge of managing that state and it can also distribute it to other behaviours or answer incoming requests about it.Long-story short: It is the application's job to manage this list and update
libp2p-allow-block-list
with any changes to it.