Skip to content

Commit

Permalink
Merge pull request #1107 from moonbeam-foundation/themacexpert/account
Browse files Browse the repository at this point in the history
Update Collator Account Management Snippets
  • Loading branch information
eshaben authored Feb 27, 2025
2 parents 76f30e4 + efc51ba commit 0a388d8
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div id="termynal" data-termynal>
<span data-ty="input"><span class="file-path"></span>curl http://127.0.0.1:9933 -H "Content-Type:application/json;char set=utf-8" -d '{</span>
<span data-ty>"jsonrpc":"2.0"</span>
<span data-ty>"id" :1,</span>
<span data-ty>"method": "author_hasKey",</span>
<span data-ty>"params": ["72c7ca7ef07941a3caeb520806576b52cb085f7577c12c36c2d64dbf73757a", "nmbs"]</span>
<span data-ty>}'</span>
<span data-ty>{"jsonrpc":"2.0", "result" :true, "id" :1}</span>
<span data-ty="input"><span class="file-path"></span></span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div id="termynal" data-termynal>
<span data-ty>2025-02-25 20:00:52 [Relaychain] 💤 Idle (6 peers), best: #12706 (0x1d51.3042), finalized #12704 (0xf74b.aa44), 1 0.4kiB/s 1 0.6kiB/s</span>
<span data-ty>2025-02-25 20:00:52 💤 Idle (6 peers), best: #5751 (Oxc5alesb5), finalized #5750 (0x9dc..e bad), 1 9.6kiB/s 1 3.5kiB/s</span>
<span data-ty>2025-02-25 20:00:53 [Relaychain] ✨ Imported #12707 (0x77ea.4299)</span>
<span data-ty>2025-02-25 20:00:57 [Relaychain] 💤 Idle (6 peers), best: #12707 (0x77ea..4299), finalized #12704 (0xf74b..aa44), | 16.4kiB/s 1 12.2kiB/s</span>
<span data-ty>2025-02-25 20:00:57 💤 Idle (6 peers), best: #5751 (0xc5a1e8b5), finalized #5750 (0x9fdc...e bad), 1 1.6kiB/s 1 0.4kiB/s</span>
<span data-ty>2025-02-25 20:00:59 [Relaychain] ✨ Imported #12708 (0x009f...3bbf)</span>
<span data-ty>2025-02-25 20:01:00 ✨ Imported #5753 (0x8981.6c81)</span>
<span data-ty>2025-02-25 20:01:00 ✨ Imported #5753 (0x33a...b5e3)</span>
<span data-ty>2025-02-25 20:01:02 [Relaychain] 💤 Idle (6 peers), best: #12708 (0x009f...3bbf), finalized #12706 (0x1d51.3042), 1 1.5kiB/s 1 1.3kiB/s</span>
<span data-ty>2025-02-25 20:01:02 💤 Idle (6 peers), best: #5752 (0x7036.569e), finalized #5751 (0xc5a1..e8b5), 1 3.3kiB/s 1 5.8kiB/s</span>
<span data-ty>2025-02-25 20:01:05 [Relaychain] ✨ Imported #12709 (0x76b9...bf65)</span>
<span data-ty>2025-02-25 20:01:07 [Relaychain] 💤 Idle (6 peers), best: #12709 (0x76b9..bf65), finalized #12706 (0x1d51.3042), | 2.0kiB/s | 0.9kiB/s</span>
<span data-ty>2025-02-25 20:01:07 💤 Idle (6 peers), best: #5752 (0x7036.569e), finalized #5751 (0xc5a1..e8b5), 1 0 1 0</span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div id="termynal" data-termynal>
<span data-ty="input"><span class="file-path"></span>curl http://127.0.0.1:9933-H\ "Content-Type: application/json;charset=utf-8" -d \</span>
<span data-ty>'{</span>
<span data-ty>"jsonrpc": "2.0",</span>
<span data-ty>"id" :1,</span>
<span data-ty>"method": "author_rotatekeys",</span>
<span data-ty>"params": []</span>
<span data-ty>}'</span>
<span data-ty>{"jsonrpc": "2.0", "result":"0x72c7ca7ef0794103caeb520806576b52cb085f7577cc12cd36c2d64dbf73757a789407ec0f401a8792ac57c4fb7dabd4da6cc74d9ac9b8dd8c4faf770255403f", "id" :1}</span>
<span data-ty="input"><span class="file-path"></span></span>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ To match the Substrate standard, Moonbeam collator's session keys are [SR25519](

First, make sure you're [running a collator node](/node-operators/networks/run-a-node/overview/){target=\_blank}. Once you have your collator node running, your terminal should print similar logs:

![Collator Terminal Logs](/images/node-operators/networks/collators/account-management/account-1.webp)
--8<-- 'code/node-operators/networks/collators/account-management/log-output.md'

Next, session keys can be created/rotated by sending an RPC call to the HTTP endpoint with the `author_rotateKeys` method. When you call `author_rotateKeys`, the result is the size of two keys. The response will contain a concatenated Nimbus ID and VRF key. The Nimbus ID will be used to sign blocks and the [VRF](https://wiki.polkadot.network/docs/learn-randomness#vrf){target=\_blank} key is required for block production. The concatenated keys will be used to create an association to your H160 account for block rewards to be paid out.

Expand All @@ -21,7 +21,7 @@ curl http://127.0.0.1:9944 -H \

The collator node should respond with the concatenated public keys of your new session keys. The first 64 hexadecimal characters after the `0x` prefix represent your Nimbus ID and the last 64 hexadecimal characters are the public key of your VRF session key. You'll use the concatenated public keys when mapping your Nimbus ID and setting the session keys in the next section.

![Collator Terminal Logs RPC Rotate Keys](/images/node-operators/networks/collators/account-management/account-2.webp)
--8<-- 'code/node-operators/networks/collators/account-management/rotate-keys.md'

Make sure you write down the concatenated public keys. Each of your servers, your primary and backup, should have their own unique keys. Since the keys never leave your servers, you can consider them a unique ID for that server.

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
27 changes: 18 additions & 9 deletions llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60530,7 +60530,7 @@ To match the Substrate standard, Moonbeam collator's session keys are [SR25519](

First, make sure you're [running a collator node](/node-operators/networks/run-a-node/overview/){target=\_blank}. Once you have your collator node running, your terminal should print similar logs:

![Collator Terminal Logs](/images/node-operators/networks/collators/account-management/account-1.webp)
--8<-- 'code/node-operators/networks/collators/account-management/log-output.md'

Next, session keys can be created/rotated by sending an RPC call to the HTTP endpoint with the `author_rotateKeys` method. When you call `author_rotateKeys`, the result is the size of two keys. The response will contain a concatenated Nimbus ID and VRF key. The Nimbus ID will be used to sign blocks and the [VRF](https://wiki.polkadot.network/docs/learn-randomness#vrf){target=\_blank} key is required for block production. The concatenated keys will be used to create an association to your H160 account for block rewards to be paid out.

Expand All @@ -60549,7 +60549,7 @@ curl http://127.0.0.1:9944 -H \

The collator node should respond with the concatenated public keys of your new session keys. The first 64 hexadecimal characters after the `0x` prefix represent your Nimbus ID and the last 64 hexadecimal characters are the public key of your VRF session key. You'll use the concatenated public keys when mapping your Nimbus ID and setting the session keys in the next section.

![Collator Terminal Logs RPC Rotate Keys](/images/node-operators/networks/collators/account-management/account-2.webp)
--8<-- 'code/node-operators/networks/collators/account-management/rotate-keys.md'

Make sure you write down the concatenated public keys. Each of your servers, your primary and backup, should have their own unique keys. Since the keys never leave your servers, you can consider them a unique ID for that server.

Expand Down Expand Up @@ -60611,7 +60611,7 @@ To create the mapping from [Polkadot.js Apps](https://polkadot.js.org/apps/?rpc=
4. Enter the **keys**. It is the response obtained via the RPC call `author_rotateKeys` in the previous section, which is the concatenated public keys of your Nimbus ID and VRF key
5. Click on **Submit Transaction**

![Author ID Mapping to Account Extrinsic](/images/node-operators/networks/collators/account-management/account-3.webp)
![Author ID Mapping to Account Extrinsic](/images/node-operators/networks/collators/account-management/account-1.webp)

!!! note
If you receive the following error, you may need to try rotating and mapping your keys again: `VRF PreDigest was not included in the digests (check rand key is in keystore)`.
Expand Down Expand Up @@ -60639,7 +60639,16 @@ curl {{ networks.development.rpc_url }} -H "Content-Type:application/json;charse

If it's correct the response should return `"result": true`.

![Check Nimbus Key](/images/node-operators/networks/collators/account-management/account-4.webp)
<div id="termynal" data-termynal>
<span data-ty="input"><span class="file-path"></span>curl http://127.0.0.1:9933 -H "Content-Type:application/json;char set=utf-8" -d '{</span>
<span data-ty>"jsonrpc":"2.0"</span>
<span data-ty>"id" :1,</span>
<span data-ty>"method": "author_hasKey",</span>
<span data-ty>"params": ["72c7ca7ef07941a3caeb520806576b52cb085f7577c12c36c2d64dbf73757a", "nmbs"]</span>
<span data-ty>}'</span>
<span data-ty>{"jsonrpc":"2.0", "result" :true, "id" :1}</span>
<span data-ty="input"><span class="file-path"></span></span>
</div>

From [Polkadot.js Apps](https://polkadot.js.org/apps/?rpc=wss://wss.api.moonbase.moonbeam.network#/assets){target=\_blank}, click on **Developer** at the top of the page, then choose **Chain State** from the dropdown, and take the following steps:

Expand All @@ -60648,7 +60657,7 @@ From [Polkadot.js Apps](https://polkadot.js.org/apps/?rpc=wss://wss.api.moonbase
3. Provide a Nimbus ID to query. Optionally, you can disable the slider to retrieve all mappings
4. Click on the **+** button to send the RPC call

![Nimbus ID Mapping Chain State](/images/node-operators/networks/collators/account-management/account-5.webp)
![Nimbus ID Mapping Chain State](/images/node-operators/networks/collators/account-management/account-2.webp)

You should be able to see the H160 account associated with the Nimbus ID provided and the deposit paid. If no Nimbus ID was included, this would return all the mappings stored on-chain.

Expand All @@ -60663,7 +60672,7 @@ From [Polkadot.js Apps](https://polkadot.js.org/apps/?rpc=wss://wss.api.moonbase
3. Provide a collator's address to query. Optionally, you can disable the slider to retrieve all mappings
4. Click on the **+** button to send the RPC call

![Nimbus ID Mapping Chain State](/images/node-operators/networks/collators/account-management/account-6.webp)
![Nimbus ID Mapping Chain State](/images/node-operators/networks/collators/account-management/account-3.webp)

You should be able to see the nimbus ID associated with the H160 account provided. If no account was provided, this would return all the mappings stored on-chain.

Expand All @@ -60679,7 +60688,7 @@ From [Polkadot.js Apps](https://polkadot.js.org/apps/?rpc=wss://wss.api.moonbase
2. Choose the **authorMapping** pallet and the **removeKeys** extrinsic
3. Click **Submit Transaction**

![Remove session keys on Polkadot.js Apps](/images/node-operators/networks/collators/account-management/account-7.webp)
![Remove session keys on Polkadot.js Apps](/images/node-operators/networks/collators/account-management/account-4.webp)

Once the transaction goes through, the mapping bond will be returned to you. To make sure that the keys were removed, you can follow the steps in the [Check Mappings](#checking-the-mappings) section.

Expand Down Expand Up @@ -61065,7 +61074,7 @@ To match the Substrate standard, Moonbeam collator's session keys are [SR25519](

First, make sure you're [running a collator node](/node-operators/networks/run-a-node/overview/){target=\_blank}. Once you have your collator node running, your terminal should print similar logs:

![Collator Terminal Logs](/images/node-operators/networks/collators/account-management/account-1.webp)
--8<-- 'code/node-operators/networks/collators/account-management/log-output.md'

Next, session keys can be created/rotated by sending an RPC call to the HTTP endpoint with the `author_rotateKeys` method. When you call `author_rotateKeys`, the result is the size of two keys. The response will contain a concatenated Nimbus ID and VRF key. The Nimbus ID will be used to sign blocks and the [VRF](https://wiki.polkadot.network/docs/learn-randomness#vrf){target=\_blank} key is required for block production. The concatenated keys will be used to create an association to your H160 account for block rewards to be paid out.

Expand All @@ -61084,7 +61093,7 @@ curl http://127.0.0.1:9944 -H \

The collator node should respond with the concatenated public keys of your new session keys. The first 64 hexadecimal characters after the `0x` prefix represent your Nimbus ID and the last 64 hexadecimal characters are the public key of your VRF session key. You'll use the concatenated public keys when mapping your Nimbus ID and setting the session keys in the next section.

![Collator Terminal Logs RPC Rotate Keys](/images/node-operators/networks/collators/account-management/account-2.webp)
--8<-- 'code/node-operators/networks/collators/account-management/rotate-keys.md'

Make sure you write down the concatenated public keys. Each of your servers, your primary and backup, should have their own unique keys. Since the keys never leave your servers, you can consider them a unique ID for that server.

Expand Down
10 changes: 5 additions & 5 deletions node-operators/networks/collators/account-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ To create the mapping from [Polkadot.js Apps](https://polkadot.js.org/apps/?rpc=
4. Enter the **keys**. It is the response obtained via the RPC call `author_rotateKeys` in the previous section, which is the concatenated public keys of your Nimbus ID and VRF key
5. Click on **Submit Transaction**

![Author ID Mapping to Account Extrinsic](/images/node-operators/networks/collators/account-management/account-3.webp)
![Author ID Mapping to Account Extrinsic](/images/node-operators/networks/collators/account-management/account-1.webp)

!!! note
If you receive the following error, you may need to try rotating and mapping your keys again: `VRF PreDigest was not included in the digests (check rand key is in keystore)`.
Expand Down Expand Up @@ -111,7 +111,7 @@ curl {{ networks.development.rpc_url }} -H "Content-Type:application/json;charse

If it's correct the response should return `"result": true`.

![Check Nimbus Key](/images/node-operators/networks/collators/account-management/account-4.webp)
--8<-- 'code/node-operators/networks/collators/account-management/check-nimbus-key.md'

From [Polkadot.js Apps](https://polkadot.js.org/apps/?rpc=wss://wss.api.moonbase.moonbeam.network#/assets){target=\_blank}, click on **Developer** at the top of the page, then choose **Chain State** from the dropdown, and take the following steps:

Expand All @@ -120,7 +120,7 @@ From [Polkadot.js Apps](https://polkadot.js.org/apps/?rpc=wss://wss.api.moonbase
3. Provide a Nimbus ID to query. Optionally, you can disable the slider to retrieve all mappings
4. Click on the **+** button to send the RPC call

![Nimbus ID Mapping Chain State](/images/node-operators/networks/collators/account-management/account-5.webp)
![Nimbus ID Mapping Chain State](/images/node-operators/networks/collators/account-management/account-2.webp)

You should be able to see the H160 account associated with the Nimbus ID provided and the deposit paid. If no Nimbus ID was included, this would return all the mappings stored on-chain.

Expand All @@ -135,7 +135,7 @@ From [Polkadot.js Apps](https://polkadot.js.org/apps/?rpc=wss://wss.api.moonbase
3. Provide a collator's address to query. Optionally, you can disable the slider to retrieve all mappings
4. Click on the **+** button to send the RPC call

![Nimbus ID Mapping Chain State](/images/node-operators/networks/collators/account-management/account-6.webp)
![Nimbus ID Mapping Chain State](/images/node-operators/networks/collators/account-management/account-3.webp)

You should be able to see the nimbus ID associated with the H160 account provided. If no account was provided, this would return all the mappings stored on-chain.

Expand All @@ -151,7 +151,7 @@ From [Polkadot.js Apps](https://polkadot.js.org/apps/?rpc=wss://wss.api.moonbase
2. Choose the **authorMapping** pallet and the **removeKeys** extrinsic
3. Click **Submit Transaction**

![Remove session keys on Polkadot.js Apps](/images/node-operators/networks/collators/account-management/account-7.webp)
![Remove session keys on Polkadot.js Apps](/images/node-operators/networks/collators/account-management/account-4.webp)

Once the transaction goes through, the mapping bond will be returned to you. To make sure that the keys were removed, you can follow the steps in the [Check Mappings](#checking-the-mappings) section.

Expand Down

0 comments on commit 0a388d8

Please sign in to comment.