Finding GSN Relayer(s)

Hello there,

I’m learning GSN on openzeppelin and even if I think I got the whole idea, at some point the documentation says

One of RelayHub’s jobs is to act as a, well, hub for all relayers: they will advertise their services on this contract, and your users will query it to find the relayer that best suits their purposes.

How exactly do get a list of all relayer for a given RelayHub contract?
I read somewhere that in fact to have an up to date list of relayers, one should listen RelayHub's events and create the list himself from it.

If my statement is true, well, perhaps updating this part of the documentation would be great.
Also, is there any analytics/monitoring website for this contract ? I only found explore.duneanalytics but it feels wrong as latest points are always old from several days.

1 Like

Hi @grog,

You can get the RelayAdded events and filter out RelayRemoved events.

Though you can just use OpenZeppelin Network.js to send relayed requests via the GSN.

Good places to start are Building a GSN powered (d)app from scratch and GSN Starter Kit

The network stats that I am aware of are what you found:

1 Like

Hi @grog,

Adding to the above:

You can manually list the relayers via the following website and setting the required network on your injected web3 provider (e.g. MetaMask)

Though the GSN Provider will find the relayer(s) automatically. The documentation for the GSN provider shows how to use if from OpenZeppelin Network.js: (edited)

We can also use the preferredRelayer option from the GSN Provider:

Many thanks for this additionnal ressources :upside_down_face:

1 Like