libp2p-lookup icon indicating copy to clipboard operation
libp2p-lookup copied to clipboard

Added support for loading keypair as file used in authentication in direct mode

Open andreasbros opened this issue 2 years ago • 2 comments

There is a need to have ability to load existing keypair file used for authentication with P2P nodes which only allow known PeerIds to connect (https://docs.rs/libp2p/latest/libp2p/allow_block_list/index.html#structs).

Proposed change adds additional parameter in "direct" mode to load keypair from given file path. This only applies to direct mode connecting to a given node which requires authentication with "whitelisted" PeerId. Currently it only supports base58 encoded files.

Example: libp2p-lookup direct --address /dns/node-1/tcp/55123 --keypair-path ~/path/to/key.base58

andreasbros avatar Jun 26 '23 15:06 andreasbros

There is a need to have ability to load existing keypair file used for authentication with P2P nodes which only allow known PeerIds to connect (https://docs.rs/libp2p/latest/libp2p/allow_block_list/index.html#structs).

//CC @thomaseizinger since you might be excited to see your work being used.

mxinden avatar Jun 26 '23 23:06 mxinden

Great to see libp2p-lookup used more widely and contributions flowing back. Thank you!

Overall I am in favor of this patch. I just have a couple of suggestions.

Thanks @mxinden your suggestions make sense, will get them ready.

andreasbros avatar Jun 27 '23 15:06 andreasbros