openzeppelin-gsn-helpers icon indicating copy to clipboard operation
openzeppelin-gsn-helpers copied to clipboard

Running a live relay requires 10 ETH???

Open edukaded opened this issue 5 years ago • 3 comments

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!

edukaded avatar Oct 07 '19 11:10 edukaded

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

nventuro avatar Oct 07 '19 16:10 nventuro

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.

edukaded avatar Oct 07 '19 20:10 edukaded

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.

nventuro avatar Oct 07 '19 20:10 nventuro