I want the list of nodes that are reachable in the network

Hey all,

I am developing an application similar to ipdr, where docker images are replicated using IPFS. I want to add additionally replication strategies. For example, I want to be able to order 25% of the nodes in the network to download a specific image.

To this aim, nodes should be aware of each other and send orders. ipfscluster does a similar thing where they have replication strategies for pinsets.

Currently I am using ipfs-lite and communicating between nodes using libp2p-pubsub. I also have a key-value store using go-ds-crdt.

How can I get the number of nodes and their addresses in the network? I want this information be available to each node in the network. I will have private (every node bootstraps another node from the network when starting) and relatively a small network.

There is the host.Peerstore() method but I am not sure if this is the right one. Is there any method where I can get all the nodes in the network?

The worst case is, when every node joins they can announce their identity to the key-value store. This way every node has a list of nodes in the network. Does that make sense?

Also is bootstrapping a node from the network the best strategy to have a private network? I could not find something similar to a swarm key in ipfs-lite.

Thank you!
akakream