You can use getpeerinfo to retrieve the address used by each of a node's peers for handshaking. You can use listpermissions to get a list of all addresses which have had permissions assigned.
But there is no way to get a list of all addresses of all nodes on the blockchain, because this is not information that is visible on the chain. Nodes can create as many addresses as they want without letting other nodes know about them.
If you want to make sure all addresses are visible, you should use a stream to have each node publish their addresses as they create them. This might also be a sensible use for the root stream.