openzeppelin-gsn-helpers
openzeppelin-gsn-helpers copied to clipboard
Running a live relay requires 10 ETH???
username@computer:~/servers$ npx oz-gsn run-relayer
Could not connect to node at http://localhost:8545 (Error: Found no accounts with sufficient balance (10000000000000000000 wei)).
Is there a way to bring that down a bit? 10000000000000000000 wei is 10 ETH and that's like $1800 USD pushing it out of the reach of a lot of people that would like to join up. That's the same cash outlay as a good quality mining rig. Why do we gotta be so rich to help out?
Thanx!
The helpers look for an account with 10 eth because you did not specify --from
, so the library has to pick one of your unlocked accounts, and it does so by looking for enough balance that it knows transactions won't fail. It is true however that this number could be lower, but the selecting of a default account feature was intended for testing environments: you'd probably want to make explicit which account transactions will come from.
That said, running a relayer does require a deposit on the RelayHub
contract of 1 ETH: this is to protect users of the GSN from malicious relayers. You can read more about attack vectors and how they are mitigated (partly using this deposit) on the relevant EIP section: https://eips.ethereum.org/EIPS/eip-1613#attacks-and-mitigations
Thank you, this is helpful information. Wouldn't it be better to have the program either require a "from" field or present the user with a list of accounts it found?
Also according to this... https://gist.github.com/spalladino/f516b46bdefb5e025c5d28daf7ad1491 it is possible to use infura as the provider and keep a local wallet seperately. But I can't figure out that option with oz-gsn.
Ah, yes - if your intent is to run a relayer on a real testnet (or mainnet!), then I'd suggest following the guide on that gist. While more involved, you'll achieve a more robust result than simply running a process from JavaScript. run-relayer
was originally intended to easily run a relayer locally on a testnet for testing purposes, not production, which is why e.g. it has a default from
value.