Hello, and welcome to the Tor community forum!
With the arrival of version 3 Onion Services, Tor added a protection mechanism to the Onion Services subsystem in Tor that prevents relays from enumerating which Onion Services they may be involved with providing access to.
This means there is no longer an efficient way of enumerating Onion Services by participating in the Tor network as a relay. This property of version 3 Onion Services is considered a feature – not a bug, but it makes it harder for you to achieve your goal.
You will have a bad time enumerating these addresses using brute force. The Onion Service addresses contain a 256-bit ed25519 public key encoded in the “.onion” hostname. Brute forcing thus means you must enumerate all values from 0 to 2²⁵⁶, which is an incomprehensibly large number of addresses, with only a tiny fraction being actual, available, Onion Services. Remember, IPv6 is “only” 2¹²⁸ addresses available globally, and that is already a vast number of addresses.
I would guess the way others build their Onion Services index is likely from scanning for valid “.onion” strings in various public data sets on the internet. Thus slowly building up a corpus of available Onion Services.