Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add deregister function, and clarify error message #9

Closed
unsol opened this issue Feb 22, 2019 · 2 comments
Closed

add deregister function, and clarify error message #9

unsol opened this issue Feb 22, 2019 · 2 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@unsol
Copy link

unsol commented Feb 22, 2019

I'm a dummy, and could use a little help protecting me from myself.

the backstory

The first time I went to net.goerli.ethstats.io, I registered with the Geth option. I tried running that info through the EthStats-client, and it wasn't working out right, so I installed ethstats-cli. I then registered my node, but kept getting "ERROR: Internal error" messages, with no clear description of the error.

Eventually, I realized that I never specified which network to connect to with ethstats-cli --register --account-email [email protected] --node-name SomeNodeName

Having finally realized my error, I swapped to ethstats-cli --register --account-email [email protected] --node-name SomeNodeName --net goerli
At that point, I received the following ERROR: Authentication error: ["Secret key is invalid"]

Thinking I'd be a smart (I'm not. I'm a dumb), I did the following ethstats-cli --server-url "SomeNodeName:MySecretThatWasEmailedToMe@wss://server.net.goerli.ethstats.io"
That results in the following error ERROR: Socket error: getaddrinfo EAI_AGAIN api api:80
After that, ethstats-cli seems to hang indefinitely, until you manually interrupt.

feature request

So after all that, I think a way to deregister your node would be handy. Also, clarify the "ERROR: Internal error" message to specify "Hey dummy, you're connected to the wrong network."

It might also be helpful to have a specific "how to change your secret key after registering" section under the troubleshooting on your README in GitHub. I just happened to scroll wildly, and end up on the "Config file" section, which was the solution to my self inflicted, dummy-made, issue (replace the key there with the one emailed to me). Along with that, specifying how to run multiple nodes with the one registered email might be helpful (I'm assuming you reuse the same key, with different node names?).

@baxy
Copy link
Contributor

baxy commented Feb 25, 2019

First of all thank you for your feedback, we are working on improving and make the experience as easy as possible. In the following lines I will try to give some more details and context about the client application, which will be also added to the readme file.

In this this new version every node MUST have its own secret key.

Registering a node through https://net.goerli.ethstats.io, its secret key is valid only on this platform/deployment. It doesn't work with other deployments or the older EthStats client aka Ethereum Network Intelligence API.

The registration of a node through the Geth option is ONLY for Geth (https://github.com/ethereum/go-ethereum) nodes because it supports sending stats data directly through the --ethstats flag. To make the process easier we added this option, which in the end will send you an email with the secret key and also the entire value for the --ethstats flag, that contains also the server url e.q. --ethstats nodeName:secretKey@wss://server.net.goerli.ethstats.io.

To register other types of nodes (Parity, Pantheon, Nethermind...) we recommend using ethstats-cli, it's the new version of the former known Ethereum Network Intelligence API.
In this case the registration is done automatically, please see https://github.com/Alethio/ethstats-cli#register-node.

By default ethstats-cli connects to the server deployed for the Ethereum mainnet. For sending stats for a different network there is the --net flag, more details here https://github.com/Alethio/ethstats-cli#cli-options. Based on the network you specified at registration time the stats will be sent to a different server. Each server has its own nodes/secretKeys.

So it seems that you first registered your node for the mainnet network. At this point a config file was created https://github.com/Alethio/ethstats-cli#config-file so every time you restart the client app it will try to send data for the mainnet network. To switch correctly to a different network like goerli, you need to register the node again for the correct network. In your case you just needed to delete the config file and register again.
That is the reason of the error: ERROR: Authentication error: ["Secret key is invalid"]. You tried to connect to goerli network with a mainnet secretKey.

As requested I'll add a check when trying to switch the network and the node is already registered to a different one and notify with a specific error message.

As for the other request deregistering/changing the secret key, there is a "Node recovery process" available ONLY in interactive mode. This helps in cases like yours or for example when you lost your config file and want to use the same node name previously registered.
To do that you need to delete your config file if any and start ethstats-cli. On startup by not having a config file it will try to register by asking you:

? Do you wish to install as a new node or as an existing one ?
  New node
> Existing node

Using arrow keys select "Existing node", then you need to enter your email account which was used to register your node.

? Please enter account email: 

After typing that in, next an email will be sent to that account with a list of all nodes registered with that email account. Every node name in the list will have attached a recovery hash.
Select the recovery hash of the node you want to recover and type it in at the following step.

? Please enter node recovery hash:

This should end with a successful registration of an existing node name.
Keep in mind that the list of recovery hashes sent in the email expires in 30 minutes.

Now regarding the other errors:
"ERROR: Internal error" - This could be an error response from a json rpc call that web3.js could not identify. I've noticed that every Ethereum node does different error handling regarding the json rpc response errors. For example lately Parity sends directly the json result for errors.
So to identify which json rpc call it is or a different cause, it would be great if you can list some logs. This error could be the reason why ethstats-cli installed for you node can't receive latest blocks.

"ERROR: Socket error: getaddrinfo EAI_AGAIN api api:80" - Here you tried to connect to the goerli server by also specifying the nodeName and secretKey. The --server-url should not include nodeName/secretKey. They are acquired from the config file. This flag is useful when needed to connect to servers (https://github.com/Alethio/ethstats-network-server) deployed for private/custom ethereum networks. The --net flag comes in handy here, because just specifying the network name it will connect to the correct server. Currently available networks are mainnet, rinkeby and goerli. In the near future we'll add also kovan and ropsten.

@baxy baxy added bug Something isn't working enhancement New feature or request labels Feb 27, 2019
@baxy baxy self-assigned this Feb 28, 2019
@baxy
Copy link
Contributor

baxy commented Feb 28, 2019

Released v2.4.19

  • Nethermind support for the latest blocks filter
  • Added details for the authentication error if trying to change the network/server
  • Updated Readme file with more details

@baxy baxy closed this as completed Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants