Skip to main content

4. hexNodeID and Session Keys

hexNodeID vs. cMixx Node ID

To associate a cMixx node with a blockchain validator, the extrinsic requires the ID be in hexadecimal notation. Under most circumstances users will refer to the validator address and/or the cMixx Node ID, not the hexNodeID. This is likely the one time you will need this ID.

About Session Keys

warning

Session Keys are not to be confused with the session-keys.json file or the cMixx TLS Credentials.

Session keys sign messages related to consensus on the xx network blockchain. They are generated via RPC call and stored on the node computer in the /opt/xxnetwork/db/chains/xxnetwork/keystore/ directory. Session keys are replaceable and can be regenerated. However, you must submit an extrinsic to the blockchain if you rotate session keys.

Generate Session Key JSON

The following command will output a JSON file to the /opt/xxnetwork/cred/ directory. This file contains the hexadecimal representation of the validator's session keys. The 'result' will be used to set the session keys via the Web Wallet in a later step.

curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:9933 -o /opt/xxnetwork/cred/session-keys.json

Get the cMixx Node's hexNodeID

python3 -m json.tool /opt/xxnetwork/cred/cmix-IDF.json | grep -w "id\|hexNodeID"

Get the Session Key Hash

python3 -m json.tool /opt/xxnetwork/cred/session-keys.json | grep -w "result"