ipfs-webui icon indicating copy to clipboard operation
ipfs-webui copied to clipboard

Peers: assigning nicknames / pet names

Open sehejkaw opened this issue 6 years ago • 8 comments

A peer nickname can be added next to peer ID.

sehejkaw avatar Apr 23 '19 16:04 sehejkaw

@lidel @olizilla and others -- thoughts on feasibility/desirability here? Marking as an issue for discussion for now.

jessicaschilling avatar Apr 02 '20 22:04 jessicaschilling

The idea of "pet names" was part of https://github.com/ipfs-shipyard/ipfs-webui/issues/891 but only "Add connection" button was added to the Peers screen. Labeling peers was descoped because while we could implement it in userland (store names in local storage of webui Origin), the names would show only in webui.

I believe a better way is to add support for this to ipfs swarm * commands and persist them as additional metadata in peerstore that could be read on-demand, similar to existing --direction:

$ ipfs swarm connect --petname PeeryMcPeer /p2p/QmPeerId
connect QmPeerId success

$ ipfs swarm peers --petname

/ipv4/somethingelse  OtherNick
/ipv4/no-petname  
/ipv4/something      PeeryMcPeer

That way we can not only support them in webui, but also CLI, RPC API and other tools.

cc @vasco-santos (from libp2p) if libp2p project discussed adding this type of metadata before

lidel avatar Apr 07 '20 21:04 lidel

Hey folks!

I am currently working on improving libp2p's PeerStore on JS land and this is one of the things that I intend to support. By the end of the PeerStore improvements, we should support adding metadata to a peer.

Regarding API for libp2p and IPFS, we did not start discussing this yet, since my main focus has been the AddressBook, ProtoBook and KeyBook. As soon as we have the former books, I will be working on the MetadataBook, which should be used for this use case. I will keep you posted and we can discuss further this API

vasco-santos avatar Apr 08 '20 07:04 vasco-santos

PSA: I wrote my initial thoughts on the MetadataBook for js-libp2p. Depending on the feedback, this might get into the next js-libp2p release work: https://github.com/libp2p/js-libp2p/issues/627

vasco-santos avatar May 04 '20 09:05 vasco-santos

@vasco-santos - what's the latest status of this? Thanks!

jessicaschilling avatar Aug 20 '20 18:08 jessicaschilling

Hey! @jessicaschilling well, it is shipped in libp2p, you can add data to the metadatabook as described in the API doc. There is no friendly API in the IPFS side of things so far, like the examples @lidel wrote above. For now you can use that feature by doing ipfs.libp2p.peerStore* through the API (no CLI support). You can use .peers to access all the peers if you want to do a "filter" per a specific metadata key later on. This is supported from [email protected] IIRC

vasco-santos avatar Aug 21 '20 07:08 vasco-santos

Thanks, @vasco-santos!

@lidel - given the current status, do you think this is something that's worth putting out for bounty right now?

jessicaschilling avatar Aug 21 '20 19:08 jessicaschilling

This is blocked until high level API support for peerstore metadata is present in both js-ipfs and go-ipfs (like https://github.com/ipfs-shipyard/ipfs-webui/issues/1018#issuecomment-610623276 or even more generic kv approach).

lidel avatar Aug 25 '20 20:08 lidel