Search…
Troubleshooting
This page contains a handful of tips for solving problems with your validator node

Session keys

Having session keys in your keystore is crucial to being a successful validator. Without them your node won't be producing blocks and won't be taking part in the consensus. Read on to find out how to check if you actually have your session keys and how to restore them in case something went wrong.

Is my node running with session keys?

First, you need to go to https://test.azero.dev/#/chainstate and run the session::nextKeys command to find your keys (for Aura and for AlephBFT, which are used for block production and finalization, respectively).
This particular query is submitted using the green 'plus' sign to the right of the text fields.
The output should look like this:
{
aura: 0x32...
aleph: 0x51...
}
Now, you need to construct your public session key by gluing the two together: the aura key needs to be pasted in its entirety (including 0x) and the aleph key without the leading 0x. Copy the result, as we'll need it in the next step.
Example For the following output: {
aura: 0x11111111111111111111111111111111 aleph: 0x22222222222222222222222222222222 } The resulting public session key would be: 0x1111111111111111111111111111111122222222222222222222222222222222
Now we need to issue an RPC call to check if there exists a private session key matching this public key. Important: this needs to be run against your local node. If you are using the wallet, you need to make sure you switch to your local node as described in the section about generating your keys.

Using the wallet

You need to go to Developer -> RPC Calls and choose the author::hasSessionKeys call. In the sessionKeys argument, you need to paste the previously constructed public key, like below:
If the output you get is true, you are all set. If you get false, you'll need to follow the next section on generating your session keys again.

Using the command line

You will need to run this command on your machine:
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_hasSessionKeys", "params":["<YOUR NODE'S SESSION KEY>"]}' localhost:9933
Remember to replace <YOUR NODE'S SESSION KEY> with the value you copied in the previous step
πŸ™‚
​
If you see true in this output, everything is okay. If you see false, you'll need to follow the next section.

Generating your session keys

As this is described in the "Making your node validate" section, we will only provide a brief reminder:
  1. 1.
    You need to go to Developer -> RPC Calls section, call (on your local node!) the author::rotateKeys method and copy the result.
  2. 2.
    You need to go the Network -> Staking -> Accounts, click on the "Set session keys" button and, in the modal, paste the key you got from rotateKeys.
And, just like that, you have your session keys again!

Accepting inbound connections

In order to successfully take part in the consensus, your node not only needs to be able to make outgoing connections to its peers but also accept incoming ones. As this process is a little more cumbersome, we created a handy Python script to do it for you. You will need Python >= 3.2 and the requests package (pip3 install requests).
import requests
​
LOCAL_RPC = "http://localhost:9933"
​
​
def analyze_peers(status):
out_peers = 0
in_peers = 0
unknown = 0
connected = status['result']['connectedPeers']
​
for peer_id, peer in connected.items():
try:
endpoint = peer['endpoint']
if 'dialing' in endpoint:
out_peers += 1
elif 'listening' in endpoint:
in_peers += 1
else:
unknown += 1
except Exception as e:
unknown += 1
print(f"out_peers: {out_peers}, in_peers: {in_peers}, unknown: {unknown}")
​
​
def network_status(addr):
r = requests.post(addr, json={"jsonrpc":"2.0","id":"1","method":"system_unstable_networkState","params":[]})
res_json = r.json()
return res_json
​
​
if __name__ == '__main__':​
analyze_peers(network_status(LOCAL_RPC))
You can copy it, save it to a file like check_peers.py and run it:
python3 check_peers.py
If in the output you see in_peers with a value greater than zero, you're good to go.
Otherwise, you can try the following:
  1. 1.
    Make sure your port 30333 is open: this means making sure that it's not blocked by any firewall and also making sure that it's not hidden behind NAT (which probably comes down to getting a public, fixed IP). You can check out our example guide for setting up Ngrok to make the port accessible publicly.
  2. 2.
    If you are sure you've done the above and the in_peers value is still 0, don't panic!. It may be the inherent non-determinism of peer-to-peer communication. Waiting some time (say, 24h) for the network state to stabilize might help.
Copy link
Outline
Session keys
Is my node running with session keys?
Generating your session keys
Accepting inbound connections