Closed edukaded closed 5 years ago
Ok so an update, I found that I could export the private key from the node server and import it to my local geth instance, then use oz-gsn tools as follows...
username@computer:~/relay$ npx oz-gsn withdraw --from 0x9dc7642dde1c0a0bce00ae70bb6650e23465ffda --to 0x49c34b9fC2e9888d560b9387e8510Bf24eBDe631
The problem I'm getting now appears to be
(node:3835) UnhandledPromiseRejectionWarning: Error: Returned error: no suitable peers available
at Object.ErrorResponse (/home/username/relay/node_modules/web3-core-helpers/src/errors.js:29:16)
at /home/username/relay/node_modules/web3-core-requestmanager/src/index.js:140:36
at XMLHttpRequest.request.onreadystatechange (/home/username/relay/node_modules/web3-providers-http/src/index.js:96:13)
at XMLHttpRequestEventTarget.dispatchEvent (/home/username/relay/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
at XMLHttpRequest._setReadyState (/home/username/relay/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
at XMLHttpRequest._onHttpResponseEnd (/home/username/relay/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)
at IncomingMessage.<anonymous> (/home/username/relay/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
at IncomingMessage.emit (events.js:214:15)
at endReadableNT (_stream_readable.js:1178:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
(node:3835) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3835) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Is this just because my local geth instance has no peers? Or is there like a flag or something I need to be passing in?
Ok it was just a matter of waiting
I refunded to my wallet, then used the tools to stake, the stake transaction is https://etherscan.io/tx/0x9d7a4dd09116d5ab43966c675c0d75c3f2059c0fef7465aebf1fdd206a1e11fe
However "Ready" is still false Is there something else I need to do here?
journalctl -u relay
should show you the relay log
Oct 08 22:30:59 gsnrelay.tqnext.com systemd[1]: Started GSN relayer.
-- Subject: Unit relayer.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit relayer.service has finished starting up.
--
-- The start-up result is RESULT.
Oct 08 22:30:59 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:30:59 RelayHttpServer.go:44: RelayHttpServer starting. version: 0.4.0
Oct 08 22:30:59 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:30:59 RelayHttpServer.go:217: Using RelayHub address: 0xD216153c06E85
Oct 08 22:30:59 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:30:59 RelayHttpServer.go:218: Using workdir: /app/data
Oct 08 22:30:59 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:30:59 RelayHttpServer.go:228: Constructing relay server in url https
Oct 08 22:30:59 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:30:59 utils.go:40: ks accounts len 1
Oct 08 22:30:59 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:30:59 utils.go:66: key extracted. addr: 0x9DC7642Dde1C0A0BCe00ae70Bb6
Oct 08 22:30:59 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:30:59 RelayHttpServer.go:230: relay server address: 0x9DC7642Dde1C0A
Oct 08 22:30:59 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:30:59 RelayHttpServer.go:62: RelayHttpServer started.Listening on por
Oct 08 22:31:00 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:31:00 relay_server.go:311: Got staked for the first time, setting own
Oct 08 22:31:00 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:31:00 relay_server.go:313: Owner is 0x49c34b9fC2e9888d560b9387e8510Bf
Oct 08 22:31:00 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:31:00 relay_server.go:314: Stake: 1000000000000000000
Oct 08 22:31:00 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:31:00 RelayHttpServer.go:320: Server's balance too low (9972010400000
Oct 08 22:31:00 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:31:00 RelayHttpServer.go:320: Server's balance too low (9972010400000
Oct 08 22:31:00 gsnrelay.tqnext.com RelayHttpServer[8644]: 2019/10/08 22:31:00 RelayHttpServer.go:320: Server's balance too low (9972010400000
I'm unsure what to do here, the address has ~0.01 ETH on it https://etherscan.io/address/0x9dc7642dde1c0a0bce00ae70bb6650e23465ffda
How much ETH is needed on the address itself once I've already staked 1 ETH? I mean that money should be for gas for transactions right? 0.01ETH is about 10 - 200 transactions for most actions I can think of.
Also it's still not showing up in https://gsn.openzeppelin.com/relay-hubs/0xd216153c06e857cd7f72665e0af1d7d82172f494?listRelays=true
in order to register, a relay balance has to be more than 0.1eth You should have more than that minimu,, as a relay re-registers daily, and spends some eth on that. see https://github.com/tabookey/tabookey-gasless/blob/master/contracts/RelayHub.sol#L106
Ok I got all that done and it's listed in the list of relays at https://gsn.openzeppelin.com/relay-hubs/0xd216153c06e857cd7f72665e0af1d7d82172f494?listRelays=true
Is it properly configured now? Is there anything else I need to do?
I'm guessing all is well now. I'll go ahead and close this issue. I think I might write a guide for noobs like myself that want to stand up a relay so they don't make the same mistakes I did.
Actually, there is an issue: you're using an old relay version 0.4.0 It has a bug in that it reverts only large transaction (at the relay's expense..) Currently, there isn't a way for a client to filter relay by their version, only by their URLs, so its very ugly for a client to avoid such a relay (a client use to filter relays by URL, and thus can't automatically tell when a relay installs a proper version.
Please follow issue #229 to compile a new executable relay (https://git.io/JeWNF)
@spalladino , @nventuro : that's why I disliked the idea of using precompiled executables in the first place...
Anyways I managed to figure out the build process. Mind taking a look at the node and letting me know if it looks correct now? Thanks! https://gsnrelay.tqnext.com/getaddr
I was standing up a relay node on mainnet. I followed this guide https://gist.github.com/spalladino/f516b46bdefb5e025c5d28daf7ad1491 I am using infura for my provider and the network as I said is mainnet.
When I got to the final instruction it wouldn't work, so I did the following steps. First I checked that my relay was ready to go Visting https://gsnrelay.tqnext.com/getaddr shows a "Ready" status of false
Assuming this was because the node was unfunded, I decided to try funding the node.
Using metamask I sent 0.01 ETH to my node's address which is 0x9dc7642dde1c0a0bce00ae70bb6650e23465ffda
That worked but I knew I needed to stake 1 ETH in addition to providing a little money for gas, so I went to https://gsn.openzeppelin.com/relay-hubs because my understanding is that this is the tool for managing your relay.
I input my node's address and used the tool's "Increase Ether Balance" to deposit 1.0 on behalf of my node thinking the next step would be to stake that 1.0 ETH.
The deposit went well and near as I can tell everything is good to go, so I proceed to the next step which is "Increase Stake & Update Stake Delay" and now I'm getting an insufficient balance error. Oddly this is coming from Metamask, so my assumption here is that it is trying to use my metamask balance to stake even though I just deposited.
Here is the deposit transaction https://etherscan.io/tx/0x496e968729c92f002e92cf115a78754a1d1f469f5445098a76ed3d91c1c849a3
And according to the event log that part did go well. So how do I fix this?