Smith operations in polkadotjs
Here we detail the smith operations in polkadotjs. Some like rotateKeys
require that your are connected to your smith node for example with a ssh tunnel.
Rotate and set session keys
How to manage session keys in polkadotjs.
- be sure to have your smith key available in your browser (see duniter-connect for example).
- connect PolkadotJs to your smith node (add
?rpc=ws://localhost:9944
to your url or use the left menu). - go to [Dev > RPC Call > author > rotateKeys()], and copy the returned concatenated keys.
- split the concatenated keys it in 4 equal parts corresponding to [grandpa, babe, imonline, autority discovery] protocols.
- go to [Dev > Extrinsics > authorityMembers > setSessionKeys(keys)], and paste the 4 hex keys as argument.
Check that session keys are present
If you are not sure that the session keys you published are present on your node, you can check manually like so.
- Go to [developer > chain state > session > key owner], uncheck
include option
and execute the query.
- In the response, you will have to retrieve 4 parts that correspond to your (Smith) identity key (
5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz
in this example)
[
...
[
[
[
imon
0x9a78f3f2fa073495929493b577f86a6aefce669b2addcc9aae5be6c359015857
]
]
5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz
]
...
[
[
[
gran
0xd26d1c17b3416cf572d94cd14eb7972cb622b3dc1a1932c2128f5a968918e04b
]
]
5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz
]
...
[
[
[
audi
0x7c9117ece1a4eac34d7996c8c42765ba88f1167f5174da3aa2edd51d1a33bd69
]
]
5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz
]
...
[
[
[
babe
0x68c31363f71533ab1480e8667a68fdd17be17ec1d54c1ac7c185b8ce4bd33866
]
]
5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz
]
- Go to [developer > rpc calls > author > has session keys] and verify that your node actually has the correct session keys
The hexadecimal for the session keys is simply the concatenation of the [grandpa, babe, imOnline, authorityDiscovery] keys in this order.
0xd26d1c17b3416cf572d94cd14eb7972cb622b3dc1a1932c2128f5a968918e04b68c31363f71533ab1480e8667a68fdd17be17ec1d54c1ac7c185b8ce4bd338669a78f3f2fa073495929493b577f86a6aefce669b2addcc9aae5be6c3590158577c9117ece1a4eac34d7996c8c42765ba88f1167f5174da3aa2edd51d1a33bd69
If the answer is "true", it is ok, else it is not and you should not go online.