Operator Tips & Tricks
Insert key to Keystore:
This might be useful if you decided to switch domains or already have the secret phrase. Read more about switching domain in the next section.
To insert the key, use the following command:
target/production/subspace-node domain key insert \
--base-path NODE_DATA_PATH --domain-id DOMAIN_ID --keystore-suri "<Secret phrase>"
The command above will insert the keypair in the subfolder of NODE_DATA_PATH/domains/DOMAIN_ID/keystore
.
suri
is the secret phrase of the operator key.
Switch domains
Any Operator can switch domain they operate on anytime. In order to switch domain:
- Proceed to PolkadotJS
- Make sure to select the correct network at the top-left corner.
- Select the account you want to use in
using the selected account
. - Select
domains
undersubmit the following extrinsic
and chooseswitchDomain(operatorId, newDomainId)
in the dropdown. - Add your
operatorId
andnewDomainId
to the corresponding fields.
Only the account who registered Operator can swith the domain.
You need to move your keypair to a new location, if you switch domains. Follow the insert key to keystore section.
Stake of your Nominators won't be released, but will be moved to the new domain as well.
Register an operator using PolkadotJS interface (alternative way)
Alternatively, you can use PolkadotJS to register an operator on the domain. To register an operator on the domain:
- Proceed to PolkadotJS
- Make sure to select the correct network at the top-left corner.
- Navigate to Developer -> Extrinsics.
- Select the account you want to use in
using the selected account
. - Select
domains
undersubmit the following extrinsic
and chooseregisterOperator(domainID, amount, config)
in the dropdown. - Enter the
domainId
to be registered on. - Enter the desired staking amount in the
amount
field. - Put your public signing key at the
signingKey
field.
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.
Make sure to use the signing key generated on the previous Create operator key step
- Enter
minimumNominatorStake
- in the example, it's set to1 TSSC
. - Enter
nominatorTax
- in the example, it's set to5%
. - Sign and submit the transaction to register an operator.
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.
Useful commands
Running both validator (farmer) and operator nodes at the same time
To run both operator and validator at the same time, provide requrired flags for both roles when starting your node.
- 🖼️ Windows
- 🍎 macOS
- 🐧 Ubuntu
- 🐋 Docker
target/production/subspace-node run `
--chain gemini-3h `
--farmer `
--name your_node_name `
-- `
--domain-id your_domain_id `
--operator-id your_operator_id `
--listen-on /ip4/0.0.0.0/tcp/40333 `
--bootstrap-nodes /dns/bootstrap-0.nova.gemini-3h.subspace.network/tcp/30334/p2p/12D3KooWBm1PHFHAP9mA6LNd72uFimyPoo6ixjdfgajzizXDYND2 `
--bootstrap-nodes /dns/bootstrap-1.nova.gemini-3h.subspace.network/tcp/30334/p2p/12D3KooWD3Q8JpAPoXR67ZQ1H1nXfPqCgPHCvWVcGxNKbfFmuPnu `
--bootstrap-nodes /dns/bootstrap-2.nova.gemini-3h.subspace.network/tcp/30334/p2p/12D3KooWEYs5yikat5NanzN7c2Sb4ngxJoCro9vXMULM2ZYVWW9H
target/production/subspace-node run \
--chain gemini-3h \
--farmer \
--name your_node_name \
-- \
--domain-id your_domain_id \
--operator-id your_operator_id \
--listen-on /ip4/0.0.0.0/tcp/40333 \
--bootstrap-nodes /dns/bootstrap-0.nova.gemini-3h.subspace.network/tcp/30334/p2p/12D3KooWBm1PHFHAP9mA6LNd72uFimyPoo6ixjdfgajzizXDYND2 \
--bootstrap-nodes /dns/bootstrap-1.nova.gemini-3h.subspace.network/tcp/30334/p2p/12D3KooWD3Q8JpAPoXR67ZQ1H1nXfPqCgPHCvWVcGxNKbfFmuPnu \
--bootstrap-nodes /dns/bootstrap-2.nova.gemini-3h.subspace.network/tcp/30334/p2p/12D3KooWEYs5yikat5NanzN7c2Sb4ngxJoCro9vXMULM2ZYVWW9H
target/production/subspace-node run \
--chain gemini-3h \
--farmer \
--name your_node_name \
-- \
--domain-id your_domain_id \
--operator-id your_operator_id \
--listen-on /ip4/0.0.0.0/tcp/40333 \
--bootstrap-nodes /dns/bootstrap-0.nova.gemini-3h.subspace.network/tcp/30334/p2p/12D3KooWBm1PHFHAP9mA6LNd72uFimyPoo6ixjdfgajzizXDYND2 \
--bootstrap-nodes /dns/bootstrap-1.nova.gemini-3h.subspace.network/tcp/30334/p2p/12D3KooWD3Q8JpAPoXR67ZQ1H1nXfPqCgPHCvWVcGxNKbfFmuPnu \
--bootstrap-nodes /dns/bootstrap-2.nova.gemini-3h.subspace.network/tcp/30334/p2p/12D3KooWEYs5yikat5NanzN7c2Sb4ngxJoCro9vXMULM2ZYVWW9H
version: "3.7"
services:
node:
# Replace snapshot-DATE with the latest release (like snapshot-2022-apr-29)
# For running on Aarch64 add -aarch64 after DATE
image: ghcr.io/subspace/node:snapshot-DATE
volumes:
# Replace path/to/keystore with your actual path to keystore.
- /path/to/keystore:/keystore:ro
# Instead of specifying volume (which will store data in /var/lib/docker), you can
# alternatively specify path to the directory where files will be stored, just make
# sure everyone is allowed to write there
- node-data:/var/subspace:rw
# - /path/to/subspace-node:/var/subspace:rw
ports:
# If port 30333 or 30433 is already occupied by another Substrate-based node, replace all
# occurrences of 30333 or 30433 in this file with another value
- "0.0.0.0:30333:30333/tcp"
- "0.0.0.0:30433:30433/tcp"
- "0.0.0.0:40333:40333/tcp"
restart: unless-stopped
command: [
"run",
"--chain", "gemini-3h",
"--base-path", "/var/subspace",
"--listen-on", "30333",
"--dsn-listen-on", "/ip4/0.0.0.0/tcp/30433",
"--rpc-cors", "all",
"--rpc-methods", "unsafe",
"--rpc-listen-on", "0.0.0.0:9944",
"--farmer",
"--name", "INSERT_YOUR_ID",
"--",
# Replace INSERT_YOUR_DOMAIN_ID with domain ID you want to be operator on
"--domain-id", "INSERT_YOUR_DOMAIN_ID",
# Replace INSERT_YOUR_OPERATOR_ID with your operator ID
"--operator-id", "INSERT_YOUR_OPERATOR_ID",
"--listen-on", "/ip4/0.0.0.0/tcp/40333",
"--bootstrap-nodes", "/dns/bootstrap-0.nova.gemini-3h.subspace.network/tcp/30334/p2p/12D3KooWBm1PHFHAP9mA6LNd72uFimyPoo6ixjdfgajzizXDYND2",
"--bootstrap-nodes", "/dns/bootstrap-1.nova.gemini-3h.subspace.network/tcp/30334/p2p/12D3KooWD3Q8JpAPoXR67ZQ1H1nXfPqCgPHCvWVcGxNKbfFmuPnu",
"--bootstrap-nodes", "/dns/bootstrap-2.nova.gemini-3h.subspace.network/tcp/30334/p2p/12D3KooWEYs5yikat5NanzN7c2Sb4ngxJoCro9vXMULM2ZYVWW9H",
# Replace INSERT_YOUR_ID with your node ID (will be shown in telemetry)
]
healthcheck:
timeout: 5s
# If node setup takes longer than expected, you want to increase interval and retries number.
interval: 30s
retries: 60
farmer:
depends_on:
node:
condition: service_healthy
# Replace snapshot-DATE with latest release (like snapshot-2022-apr-29)
# For running on Aarch64 add -aarch64 after DATE
image: ghcr.io/subspace/farmer:snapshot-DATE
volumes:
# Instead of specifying volume (which will store data in /var/lib/docker), you can
# alternatively specify path to the directory where files will be stored, just make
# sure everyone is allowed to write there
- farmer-data:/var/subspace:rw
# - /path/to/subspace-farmer:/var/subspace:rw
ports:
# If port 30533 is already occupied by something else, replace all
# occurrences of 30533 in this file with another value
- "0.0.0.0:30533:30533/tcp"
restart: unless-stopped
command: [
"farm",
"--node-rpc-url", "ws://node:9944",
"--listen-on", "/ip4/0.0.0.0/tcp/30533",
# Replace WALLET_ADDRESS with your Polkadot.js wallet address
"--reward-address", "WALLET_ADDRESS",
# Replace PLOT_SIZE with plot size in gigabytes or terabytes, for example 100G or 2T (but leave at least 60G of disk space for node and some for OS)
"path=/var/subspace,size=PLOT_SIZE",
]
volumes:
node-data:
farmer-data:
You should see the node start successfully and begin syncing.
Switching to another server
To ensure the minimum downtime during your switch, we propose the following:
- Sync a new operator node using a throwaway key. You can generate a new key, just not insert it into your keystore.
- 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).
- Update the keystore on the new node with the original signing key.
- Restart the new operator node.