OK, so my original question was "how do I get kind 0 metadata for an arbitrary user?".... One interesting idea I tried was to subscribe to BOTH kind 0 (metadata) and kind 10002 (nip-65) events, with the idea that, if I was not able to get the kind 0 (metadata) event, but WAS able to to get the 10002 event, then I could use query the suggested relays from the 10002 events in a subsequent attempt to get the metadata.
So far this has not worked at all for me. For some reason, the number of pubkeys where I have 10002 events but NOT 0 (zero) events, is NONE... put another way... "For every users where I have 10002 events, I already have 0 (zero) events".... So the 10002 events don't seems to be useful for getting metadata.
The way I have been able to get 0 (zero) metadata events for users is like this .... start with an array of big relays, like....
["wss://purplepag.es",
"wss://relay.nostr.band",
"wss://nostr-01.yakihonne.com",
"wss://relay.damus.io",
"wss://nos.lol"]
.... and then, iterate through these, setting up a subscription like this .....
filter: Nostr::Filter.new(
kinds: [
0, 10002
]
authors: agent_pubkeys
)
... where the authors is a random slice of the array of pubkeys I am looking for. I did this for not more than 30 minutes, and found that my "yield" for events went down over time... and then finally I stopped getting any new events..
I interpret this decreased yield over time as: "You've successfully got all the metdata events for the users who have published metadata events, and now your yield has gone down since all you have left are users who have NOT published metadata events, so it's time to quit now".
So far thus the shotgun approach -- just subscribe to a bunch of big relays, try pubkeys a few times, and then give up if you try a few times and still no Kind 0 (metadata) events are produced.