স্কিপ করে মূল কন্টেন্ট এ যান
Version: Pre-Release

Operators guide

note

Currently, the domain chain does not support syncing from other operator nodes; it needs to be deterministically derived from the consensus chain block by block.

Check the list of the available domains:

In order to participate in block production, operator needs to register on a specific domain.

note

Any account with the minimum operator stake can become an operator.

To check the list of available domains:

  1. Proceed to PolkadotJS
  2. Make sure to select the correct network at the top-left corner.
  3. Go to Developer -> Chain state Staking-1
  4. Select domains under selected state query and choose domainRegistry
  5. Exclude option
  6. Click on + to query the chain state. Staking-2
  7. Review the list of available domains Staking-3
    tip

    In the example above the number 3 corresponds to the domainId. The example is not Stake Wars specific, the operator is responsible for finding out the correct domain ID they want to operate on. Stake Wars are using the domain with ID 1.

An operator needs a key pair to participate in bundle production.

  1. Start a node on a developer chain by running ./target/release/subspace-node --chain dev -- --domain-id 0 --keystore-path tmp/keystore --rpc-cors all
tip

You can use any chain to generate a keypair, we recommend using a dev chain for simplicity. You can adjust the --keystore-path if you prefer to generate the keys in a different location.

  1. Open another terminal and use the curl command to make an RPC call to your node. This will generate a new key in the --keystore-path location you specified earlier.
curl.exe -X POST http://127.0.0.1:9945 `
-H "Content-Type: application/json;charset=utf-8" `
-d '{
"jsonrpc":"2.0",
"id":1,
"method":"author_rotateKeys",
"params": []
}'

You have successfully generated an operator key, congratulations!

Start the domain operator node

The domain operator node is running with an embedded consensus node, thus you need to specify the args for both the consensus node and the domain operator node:

subspace-node [consensus-chain-args] -- [domain-args]

Example: Start a node as operator on gemini-3g chain:

info

You need to wipe (purge-chain) and sync your node from genesis block, since you need to sync both consensus and domain chains. You do not need to wipe any existing plots.

note

Ensure you replace your_domain_id with your domain identifier in the command and your_operator_id with your operator_id. If your keystore is located in a different folder, adjust the --keystore-path accordingly. Setting --base-path is optional.

tip

You can ignore setting up your_operator_id while you're syncing your node. Make sure to set it after syncing and registration.

tip

Stake Wars are using the domain Nova with ID 1.

target/production/subspace-node `
--chain gemini-3g `
--name your_node_name `
--base-path your_path_to_node_data `
-- `
--domain-id your_domain_id `
--chain gemini-3g `
--operator-id your_operator_id `
--bootnodes /ip4/3.87.28.170/tcp/40333/p2p/12D3KooWGHtULvhdKMZtzigSK1438uWXPj9rBQHVzTaKMWv1WRXp `
--bootnodes /ip4/140.82.45.36/tcp/40333/p2p/12D3KooWJxB2PVzyNqZywoCWAMLGhKr2LCbFMXbAPzUPQZon7yt1 `
--bootnodes /ip4/167.179.116.135/tcp/40333/p2p/12D3KooWHsRae3ip2uQAUPtpMcStHGGw777SJT3nu9maFmtsGry7 `
--listen-addr /ip4/0.0.0.0/tcp/40333 `
--keystore-path /keystore

You should see the node start successfully and begin syncing.

Staking-13

To view the stored node information navigate to:

FOLDERID_LocalAppData e.g.

C:\Users\Alice\AppData\Local

Register an operator on domain

info

It's crucial to fully sync your node before registering as an operator. Please follow the commands in the Start the domain operator node section and only register as an operator once your node is fully synced. If many operators are registered but their nodes are still syncing or offline, it can adversely affect the speed of block production in the domain.

Prefer a video? Expand for our installation video using PolkadotJS interface.
  1. Proceed to the Subspace Staking portal and connect your wallet.

NStaking-1

  1. Select the wallet you would like to connect. Both Subwallet and PolkadotJS wallets are supported.

NStaking-2

  1. Enter your password to give an access to your wallet.

NStaking-3

  1. Select the account you'd like to use form the dropdown menu. You will see both available and locked (staked) token balances for each account.

NStaking-4 5. Proceed to the Stake as a pool operator tab.

NStaking-5 6. Select the domainId you would like to be registered on. Enter the Minimum Operator Stake, Amount to Stake, Nomination Tax and Signing key and then click Next.

NStaking-6

info

Make sure to use the signing key generated on the previous Create operator key step.

  1. Approve the request in the pop-up window.

NStaking-8 8. Congratulations, you're now registered as an operator!

NStaking-8

info

It can take up to 10 minutes for the operator to be registered and appear on the page. You can check if the operator was created successfully by following the steps.

tip

You can view some additional actions by clicking on action next to your operator. You can increase your stake, withdraw some stake and de-register your operator from there.

Register an operator using PolkadotJS interface

Alternatively, you can use PolkadotJS to register an operator on the domain. To register an operator on the domain:

  1. Proceed to PolkadotJS
  2. Make sure to select the correct network at the top-left corner.
  3. Navigate to Developer -> Extrinsics.
  4. Select the account you want to use in using the selected account.
  5. Select domains under submit the following extrinsic and choose registerOperator(domainID, amount, config) in the dropdown.
  6. Enter the domainId to be registered on.
  7. Enter the desired staking amount in the amount field.
  8. Put your public signing key at the signingKey field.
note

In the example below, 1 TSSC is selected for staking. 18 zeros are added because of the u128 type, so make sure to put 1000000000000000000 instead.

Staking-5

info

Make sure to use the signing key generated on the previous Create operator key step

  1. Enter minimumNominatorStake - in the example, it's set to 1 TSSC.
  2. Enter nominatorTax - in the example, it's set to 5%.
  3. Sign and submit the transaction to register an operator.

Staking-6

info

Make sure to select Submit Transaction since the transaction needs to be signed.

Once registered, the operator has to wait until the domain epoch is complete to start operating for the domain, participate in bundle production, and receive rewards.

Once the domain epoch is finished, the operator can produce bundles from the new epoch.

Any operator can add more stake by using the same functionality.

Checking your operatorId

There are two ways to check your operatorId:

  1. You can use PolkadotJS Network Explorer.

Staking-7 2. Browse the recent events and you should see domains.OperatorRegistered event.

Staking-8 3. Click on the dropdown arrow to view the domainId and operatorId.


Alternatively, you can use Subscan which is a little easier to navigate for this job.

  1. Navigate to Subspace Subscan portal.
  2. Click on Blockchain -> Extrinsics.

Staking-9

  1. Scroll to the bottom of the page to view all recent events, search for register_operator event.

Staking-10

  1. Click on Extrinsic ID for the desired event.

  2. Scroll to Parameters and ensure that signing_key corresponds to your signing key.

Staking-11

  1. Scroll to Events and click on dropdown arrow for domains(OperatorRegistered).

Staking-12

  1. Inspect and remember your domain_id.

Embedded Docs

The following command can be used to explore all parameters and subcommands:

target/production/subspace-node --help

Build from source

If you prefer to build from the source rather using existing builds, the domain operator node is embedded within the subspace-node binary, please refer to Subspace node for how to build from source.

Operator deregistration

To deregister an operator on the domain and have your tokens released:

info

Only account who registered an operator can deregister it. Make sure to use the same wallet / account to sign the transaction for deregistration.

  1. Proceed to the Subspace Staking portal and connect your wallet.

NStaking-1

  1. Select the wallet you would like to connect. Make sure to select the wallet you registered your operator with. Both Subwallet and PolkadotJS wallets are supported.

NStaking-2

  1. Enter your password to give an access to your wallet.

NStaking-3

  1. Click on Manage your stake.

NStaking-9

  1. Click on Action button next to an operator you would like to deregister and select deregister.

NStaking-10

  1. Approve the request in the pop-up window.

NStaking-8

  1. Congratulations, your operator was deregistered.
info

It can take up to 10 minutes for the operator to be deregistered and disappeared from the page. You can check if the operator was deregistered successfully on the Subspace Subscan portal.

Operator deregistration using PolkadotJS

Alternatively, you can use the PolkadotJS portal to deregister operator.

  1. Proceed to PolkadotJS
  2. Make sure to select the correct network at the top-left corner.
  3. Select the account you want to use in using the selected account.
  4. Select domains under submit the following extrinsic and choose deregisterOperator(operatorId) in the dropdown.

Staking-14

  1. Your tokens and tokens of operator Nominators will be released after the lockingPeriod.
  2. To check the locking period you can go to Developer -> Chain state -> Constants.
  3. Select domains under selected contant query and choose stakeWithdrawalLockingPeriod.
  4. Click on + to run the query.

Staking-15

info

Number 256 above corresponds to the number of the domain blocks, and not the consensus chain blocks.

Operator Stake Withdrawal

Operator stake withdrawal works similarly to Nominator stake withdrawal. Refer to this section to withdraw your stake.

Create operator key (alternative, less secure way):

An operator needs a key pair to participate in bundle production. You can create a key using the following command:

target/production/subspace-node key generate --scheme sr25519

Staking-4

Back up the key. Take the public key (hex) of the Keypair. The public key is part of the operator config we will be using later on Staking portal or PolkadotJS portal.

Insert key to Keystore:

The key generated above needs to be added to the Keystore so that the operator node can use it to participate in bundle production.

To insert the key, use the following command:

target/production/subspace-node key insert \
--suri "<Secret phrase>" --key-type oper --scheme sr25519 --keystore-path /keystore

The command above assumes /keystore as the keystore location. suri is the secret phrase of the operator key.

tip

tmp folder on linux based systems will be emptied upon the system reboot. Make sure to store the keypair in a secure and permanent location.

Switch domains

Any Operator can switch domain they operate on anytime. In order to switch domain:

  1. Proceed to PolkadotJS
  2. Make sure to select the correct network at the top-left corner.
  3. Select the account you want to use in using the selected account.
  4. Select domains under submit the following extrinsic and choose switchDomain(operatorId, newDomainId) in the dropdown.
  5. Add your operatorId and newDomainId to the corresponding fields.

Staking-24

note

Only the account who registered Operator can swith the domain.

note

Stake of your Nominators won't be released, but will be moved to the new domain as well.

Useful commands

Running both validator (farmer) and operator nodes at the same time

tip

To run both operator and validator at the same time, provide requrired flags for both roles when starting your node.

target/production/subspace-node `
--chain gemini-3g `
--blocks-pruning 256 `
--state-pruning archive `
--no-private-ipv4 `
--validator `
--name your_node_name `
-- `
--domain-id your_domain_id `
--operator-id your_operator_id `
--keystore-path /keystore `
--listen-addr /ip4/0.0.0.0/tcp/40333 `
--bootnodes /ip4/3.87.28.170/tcp/40333/p2p/12D3KooWGHtULvhdKMZtzigSK1438uWXPj9rBQHVzTaKMWv1WRXp `
--bootnodes /ip4/140.82.45.36/tcp/40333/p2p/12D3KooWJxB2PVzyNqZywoCWAMLGhKr2LCbFMXbAPzUPQZon7yt1 `
--bootnodes /ip4/167.179.116.135/tcp/40333/p2p/12D3KooWHsRae3ip2uQAUPtpMcStHGGw777SJT3nu9maFmtsGry7

You should see the node start successfully and begin syncing.

Staking-28

Switching to another server

To ensure the minimum downtime during your switch, we propose the following:

  1. Sync a new operator node using a throwaway key. You can generate a new key, just not insert it into your keystore.
  2. Stop the original node and rename the keystore (or whatever you feel comfortable doing to prevent you accidentally starting the original node up with the original signing key).
  3. Update the keystore on the new node with the original signing key.
  4. Restart the new operator node.