Closed vyzo closed 7 years ago
This looks great 👍
Newly added namespaces should get picked up by the directory on the next register "heartbeat", right? So ~5mins is the max time between adding a namespace and it being listed in the directory.
I wonder if we should add some way for a peer to see its own listings from the directory; I notice that your own peer's namespaces are excluded by default, which seems correct. But it might be good for a user to be able to verify that their stuff is visible to other peers without having to spin up another testing node...
Also (only semi-related), can we use the DHT provider records to distribute namespace listings without a directory? That might be cool, but seems like a distributed cache invalidation problem we might want to avoid 😄
Newly added namespaces should get picked up by the directory on the next register "heartbeat", right?
yes
I wonder if we should add some way for a peer to see its own listings from the directory
The filtering happens in the client side, ie the concat node simply edits itself out of the list. We could change this, but it complicates some usage to have your own self mixed up with your peers.
Also (only semi-related), can we use the DHT provider records to distribute namespace listings without a directory?
It's part of the grand plan :)
Added the /dir/list/{ns}/all
variant to include self in results, which lets the user choose whether he wants to include self in results and avoids the impedance mismatch.
Adds support for namespace listing to the directory protocol; see #71
Protocol changes:
/mediachain/dir/listns
protocol for listing namespaces from registered peers/mediachain/dir/list
extensions:/dir/list/{namespace}
/dir/list/{namespace}/all
to also include self in resluts/mediachain/dir/listns
implementation:/dir/listns
Some (incidental) net refactoring:
dirConnect
doConnect
to also open a stream, similar todoDirConnect
Example: