Running a Relayer

What I want to do is run a relayer on a custom network, which would entail the following:

  1. deploy relayhub on the network
  2. run a relayer from a reachable url
  3. register relayer
  4. fund dapp

I was having some trouble with the second step,
i believe https://github.com/OpenZeppelin/openzeppelin-gsn-helpers/releases this is where i can get a downloadable binary for my OS
I’m using macOS Catalina (v10.15.1), could you guide me through the steps to installing the binary?

Also,
was wondering, if running a relayer is only about getting a reachable URL - is it independent of the network RelayHub is deployed on?
if yes, then is there a general purpose Relayer available, URL for which can be used directly?

1 Like

Hi @nglglhtr,

For me on Windows this was just a matter of running the exe once downloaded from the command line.

On Linux (based on: https://gist.github.com/spalladino/f516b46bdefb5e025c5d28daf7ad1491) I downloaded the Linux binary using curl

curl 'https://github.com/OpenZeppelin/openzeppelin-gsn-helpers/releases/download/v0.2.1/gsn-relay-linux-amd64' -o RelayHttpServer -L -s

Then ran it with default options

./RelayHttpServer 

For help:

./RelayHttpServer --help

For MacOS I assume the binary is darwin-amd64.

Each Relayer is configured for a specific network. In the GSN multiple Relayers can be running. It is a matter of running the Relayer with the appropriate options for the network you are using.

Hi @nglglhtr,

I wanted to check how you got on running a relayer?

1 Like

Hey @abcoathup,
I was able to get a running relayer on my preferred network, thanks for all the help :slight_smile:
Had to switch OS though. Wasn’t able to get one up and running on MacOS Catalina. It was a breeze on Linux and Windows

1 Like

Hi @nglglhtr,

Glad that you have the relayer running. Sorry that you had to switch OS.

Be great to hear about your experience running the GSN with Matic network.

hey @abcoathup
so i was able to successfully run my GSN enabled contract on local dev environment (thanks to you :slight_smile: )
i’m having some trouble in registering a relayer on matic’s test network
so when i run

const provider = new HDWalletProvider(mnemonic, "https://testnetv3.matic.network");
const web3 = new Web3(provider);
registerRelay(web3, {
      relayUrl: 'http://localhost:8090'
}).then(console.log)

my account is deducted of 6 ETH, 5 of which go to an address that relayer provides and 1 goes to the contract relayHub
i can see these transactions on the block explorer, but each time my console returns with the following error:

Will wait up to 30s for the relay to be ready
(node:14949) UnhandledPromiseRejectionWarning: Error: Failed to fund relay: 'Error: Relay not ready after 30s'

i tried increasing the timeout, but still face the same error

how should i go about resolving this?

1 Like

Hi @nglglhtr,

I am not sure what the issue is here. Let me come back to you.

The relayer is returning ready as false, but the relay is apparently staked with the RelayHub and the Relayer is funded.

Yes! that was indeed the issue, but I later figured the problem had less to do with the register script and more to do with TruffleHDWalletProvider - i still haven’t pinned down the exact issue, but there is some nasty way that package works - it kept making my code go into loops
anyway, fixed it using some other wallet :slight_smile:

1 Like