# Instant (SN46): full docs > Instant is Bittensor subnet 46 (SN46), an OpenAI-compatible inference network: miners serve customers' requests through provider API keys sealed in attested Phala enclaves, and validators turn each epoch's settled work into an audited weight row. --- Source: https://docs.instantnetwork.ai/ # SN46 docs Instant is Bittensor subnet 46 (SN46), an inference network with an OpenAI-compatible API. Customers send their requests to the SN46 router at `https://router.instantnetwork.ai/v1`. The router passes each request to a miner, who serves it with an API key from a supported provider. That key is sealed inside an attested enclave that nobody can read, not even the miner. Miners are paid their provider's cost for every token they serve, plus a speed bonus. Validators close each epoch's settled work into a weight row, have it checked by an independent audit, and set the weights on chain. ## Miners Serve customers through your provider keys and earn SN46 emission. [Start with the overview](https://docs.instantnetwork.ai/miners), or go straight to [installing the CLI](https://docs.instantnetwork.ai/miners/install). ## Validators Run the SN46 validator with one curl install. [See how validation works](https://docs.instantnetwork.ai/validators), then [install the validator](https://docs.instantnetwork.ai/validators/install). ## For AI agents These docs are also available as plain text: [llms.txt](https://instantnetwork.ai/llms.txt) lists every page, and [llms-full.txt](https://instantnetwork.ai/llms-full.txt) holds all of them in one file. Each page's markdown is linked from llms.txt. --- Source: https://docs.instantnetwork.ai/miners # Mine on SN46 Turn your inference API keys into Bittensor earnings. You bring a funded API key from a supported provider, and we bring the customers. Your key runs inside a secure enclave that nobody can look into, not even us, and every token it serves earns you a share of SN46 emission. ## How it works 1. **You deploy our proxy** to a confidential VM on Phala Cloud, with your provider keys sealed inside. 2. **Customers send requests** to the SN46 router, which verifies your enclave and routes them through your proxy. 3. **Your provider answers**, and the response streams straight back to the customer. 4. **You get paid** for every token served, through Bittensor weights every 6 hours. ## Requirements - **A Bittensor wallet** with enough TAO to register a hotkey on SN46. - **A funded API key** from at least one [supported provider](https://docs.instantnetwork.ai/miners/providers). - **A Phala Cloud account** to run one small confidential VM. - **A computer with Node.js 18+**, `btcli` and the `sn46-miner` CLI (Linux, x86_64 or aarch64). ## Quick start Already have a funded provider key and a registered hotkey? You can be live in minutes. ```sh # 1. Install the sn46-miner CLI curl -fsSL https://raw.githubusercontent.com/Subnet46/v2-sn46-miner-proxy/dev/install.sh | sh # 2. Log in to Phala npx phala@1.2.8 auth login # 3. Put your hotkey and provider keys in a private env file cat > proxy.env <<'ENV' SN46_HOTKEY= SN46_KEYS_DEEPINFRA= ENV chmod 600 proxy.env # 4. Deploy the proxy with the compose file the installer put in ~/.local/share/sn46 npx phala@1.2.8 deploy -n sn46-proxy -t tdx.small -c ~/.local/share/sn46/compose.yml -e proxy.env --wait # 5. Register your proxy and check that it's live sn46-miner register --endpoint --wallet ~/.bittensor/wallets//hotkeys/ sn46-miner status --wallet ~/.bittensor/wallets//hotkeys/ ``` Once `status` shows your proxy as live, traffic starts flowing your way. Then set up [automatic updates](https://docs.instantnetwork.ai/miners/auto-update) so your proxy stays on the current release. ## Step by step 1. [Install](https://docs.instantnetwork.ai/miners/install) the `sn46-miner` CLI. 2. [Deploy on Phala](https://docs.instantnetwork.ai/miners/deploy): the compose file, your env file and the deploy. 3. [Register](https://docs.instantnetwork.ai/miners/register) your proxy with your hotkey. 4. [Add your providers](https://docs.instantnetwork.ai/miners/providers), up to 8 keys each. 5. [Turn on auto-update](https://docs.instantnetwork.ai/miners/auto-update). Then read how [earnings](https://docs.instantnetwork.ai/miners/earnings) work, what to do when something goes wrong in [troubleshooting](https://docs.instantnetwork.ai/miners/troubleshooting), and the [provider terms](https://docs.instantnetwork.ai/miners/provider-terms). --- Source: https://docs.instantnetwork.ai/miners/install # Install the miner CLI `sn46-miner` is the CLI you run on your own machine. It registers your proxy, checks its status and keeps it up to date. The current release is **v0.1.1**. ## Install ```sh curl -fsSL https://raw.githubusercontent.com/Subnet46/v2-sn46-miner-proxy/dev/install.sh | sh ``` This puts `sn46-miner` in `~/.local/bin`, and the proxy's `compose.yml` in `~/.local/share/sn46/`. It runs on Linux, x86_64 or aarch64, and checks the download against the release's `SHA256SUMS`. - **Install for all users:** add `| sh -s -- --system` to install into `/usr/local/bin`, with sudo. - **Pick a release:** set `SN46_VERSION`, for example `curl -fsSL ... | SN46_VERSION=v0.1.1 sh`. The default is the latest release. - **Upgrade:** run the same command again. It replaces what changed and says what it did. Check that it works: ```sh sn46-miner ``` With no arguments, `sn46-miner` prints every command, its flags and the defaults. ## What it talks to `sn46-miner` talks to the SN46 control plane at `https://control.instantnetwork.ai` (SN46 on mainnet, netuid 46). It checks proxy releases against the SN46 fleet root, whose public key is built in: ```text 2b9ddb2b5b3627edb3eda35d18c7296c1170be1d88af001c576f30c88e412e32 ``` `--control ` and `--root ` override these, for testing only. ## Other tools you need - **The Phala CLI**, through Node.js 18+: `npx phala@1.2.8`. For [auto-update](https://docs.instantnetwork.ai/miners/auto-update), install it globally instead: `npm install -g phala@1.2.8`. - **`btcli`**, to create a wallet and register a hotkey on SN46. ## Build from source You need Rust 1.98 or later: ```sh git clone https://github.com/Subnet46/v2-sn46-miner-proxy && cd v2-sn46-miner-proxy # the libraries are pinned by ssh URL; without GitHub ssh keys, read them over https: export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=url.https://github.com/.insteadOf \ GIT_CONFIG_VALUE_0=ssh://git@github.com/ cargo build --release --locked -p sn46-miner # target/release/sn46-miner ``` Next: [deploy your proxy on Phala](https://docs.instantnetwork.ai/miners/deploy). --- Source: https://docs.instantnetwork.ai/miners/deploy # Deploy on Phala Your proxy runs our published image inside an Intel TDX enclave on Phala Cloud. The enclave proves to our router exactly what code is running. It keeps your keys sealed away from everyone, including Phala and us. ## The compose file The installer puts this file in `~/.local/share/sn46/compose.yml`. You can also save it yourself as `compose.yml`: ```yaml services: sn46-proxy: image: ghcr.io/subnet46/sn46-proxy@sha256:daf8bbf6b7d705f21f3603214d5e184b1235913231838d1ea54cc0d808a8c6ac restart: always ports: - '8443:8443' volumes: - /var/run/dstack.sock:/var/run/dstack.sock environment: - SN46_HOTKEY - SN46_KEYS_DEEPINFRA - SN46_KEYS_CHEAPERINFERENCE - SN46_KEYS_SURPLUS - SN46_KEYS_OPENSCALE - SN46_KEYS_ENGY - SN46_KEYS_REDPILL ``` It pins the current release image by digest: ```text ghcr.io/subnet46/sn46-proxy@sha256:daf8bbf6b7d705f21f3603214d5e184b1235913231838d1ea54cc0d808a8c6ac ``` Every published digest is listed on [GitHub](https://github.com/orgs/Subnet46/packages/container/package/sn46-proxy). Use the published digest exactly: our control plane only accepts enclaves running a released image. ## Your env file Write a private env file with your hotkey's ss58 address and your provider keys. Leave out the providers you don't use. For several keys from one provider, separate them with commas. ```sh cat > proxy.env <<'ENV' SN46_HOTKEY= SN46_KEYS_DEEPINFRA=, SN46_KEYS_SURPLUS= ENV chmod 600 proxy.env ``` These are the only variables the enclave accepts. Phala encrypts them to your enclave on deploy, so they never travel in the clear and are never sent anywhere else. The full list of providers and their variables is on the [providers page](https://docs.instantnetwork.ai/miners/providers). ## Deploy ```sh npx phala@1.2.8 auth login npx phala@1.2.8 deploy -n sn46-proxy -t tdx.small -c compose.yml -e proxy.env --wait ``` The proxy listens on port 8443 with its own TLS. Its public address is the CVM's `-8443s` passthrough address: ```text https://-8443s. ``` `npx phala@1.2.8 cvms get` shows it. Note your **CVM id** and this **proxy address**: you need the address to [register](https://docs.instantnetwork.ai/miners/register), and the CVM id for [auto-update](https://docs.instantnetwork.ai/miners/auto-update). ## Keep a template for auto-update Auto-update fills in each new release's digest. Keep a copy of your compose file with the digest replaced by a placeholder: ```sh sed 's/@sha256:[0-9a-f]*/@{{image_digest}}/' compose.yml > compose.template.yml ``` ## Check the image yourself The proxy image is built reproducibly from [the source](https://github.com/Subnet46/v2-sn46-miner-proxy): `images/build.sh release ` builds it, and `images/check-release.sh` compares two builds of one commit. Anyone can check that a digest comes from that source. Next: [register your proxy](https://docs.instantnetwork.ai/miners/register). --- Source: https://docs.instantnetwork.ai/miners/register # Register Registering links your proxy to your SN46 hotkey, so the router can start sending you traffic. ## Get a hotkey on SN46 Use a hotkey you already have registered on SN46, or register a new one with `btcli` on netuid 46. The same hotkey's ss58 address goes in your proxy's env file as `SN46_HOTKEY`. ## Link your proxy ```sh sn46-miner register --endpoint --wallet ~/.bittensor/wallets//hotkeys/ ``` You sign with your hotkey, and the enclave must name the same hotkey, so nobody else can claim your proxy. The hotkey file signs the registration: it is read, never sent or printed. `sn46-miner` registers with the SN46 control plane at `https://control.instantnetwork.ai`. ## Check where you stand ```sh sn46-miner status --wallet ~/.bittensor/wallets//hotkeys/ ``` Before sending real traffic, we verify your enclave and test each provider key. Once `status` shows your proxy as live, traffic starts flowing your way. If `register` or `status` returns an error, see [troubleshooting](https://docs.instantnetwork.ai/miners/troubleshooting). ## Leave ```sh sn46-miner deregister --wallet ~/.bittensor/wallets//hotkeys/ ``` `deregister` takes your proxy out of rotation at any time. --- Source: https://docs.instantnetwork.ai/miners/providers # Providers At launch, SN46 serves **DeepSeek V4.1 Flash**. Bring a key from any of these providers: | Provider | Env variable | | -------------------- | ---------------------------- | | DeepInfra | `SN46_KEYS_DEEPINFRA` | | Surplus Intelligence | `SN46_KEYS_SURPLUS` | | OpenScale | `SN46_KEYS_OPENSCALE` | | Engy | `SN46_KEYS_ENGY` | | Cheaper Inference | `SN46_KEYS_CHEAPERINFERENCE` | | RedPill | `SN46_KEYS_REDPILL` | Set the variables for the providers you use in your proxy's env file, and leave out the rest. ## Several keys per provider You can add up to 8 keys per provider, separated by commas: ```sh SN46_KEYS_DEEPINFRA=,, ``` Your proxy learns how much each account can handle and spreads traffic across them. ## More providers are coming We test every provider before adding it, and several more are in testing now. When a new one is added, [auto-update](https://docs.instantnetwork.ai/miners/auto-update) brings it to your proxy and you simply add your key. Your provider account stays yours: see the [provider terms](https://docs.instantnetwork.ai/miners/provider-terms). --- Source: https://docs.instantnetwork.ai/miners/earnings # Earnings ## Your provider's cost, plus a bonus You are paid what your provider charges for every token you serve, plus **10% to 20% on top**, depending on how fast you answer. The fastest miners earn the full 20%: our canaries measure time to first token and tokens per second. New miners start at 10%. No bidding, no race to the bottom. Rates follow your provider's own pricing, so check its price list for DeepSeek V4.1 Flash. Cached input tokens are paid the same way, on your provider's cached price. ## Paid for the work you do Every request you serve is recorded. If a customer cancels mid-answer, you're paid for what you delivered. If something breaks on our side, you're still paid. Refunds and free credits are on us and never come out of your earnings. ## More capacity, more traffic Traffic is shared by how much your keys can handle and how fast they answer. Conversations stay with the miner they started on, so your provider's cache keeps working for you. No single miner takes more than 40% of the traffic while others have room. ## Paid every 6 hours SN46 settles in 6-hour epochs. At the end of each epoch, the validators build the weight row from every recorded request. An independent audit then checks that row before it goes on chain. If the audit fails, the burn row goes on chain instead: nobody is paid for that round, and what you earned carries over to the next one. Validators can read how this works in [how validation works](https://docs.instantnetwork.ai/validators). --- Source: https://docs.instantnetwork.ai/miners/auto-update # Auto-update `sn46-miner autoupdate` keeps your proxy on the current release. It checks for new releases signed by the SN46 fleet root every 5 minutes. When one is due, it updates your CVM in place to the new image, and your keys stay sealed in the enclave. ## The 48-hour grace window After each release, the previous version keeps working for 48 hours, so you never drop out mid-update. After that window, only the new release is accepted: a proxy that hasn't updated stops getting traffic. ## Set it up You need three things. First, your compose **template**, with the digest replaced by a placeholder: ```sh sed 's/@sha256:[0-9a-f]*/@{{image_digest}}/' compose.yml > compose.template.yml ``` Second, your **CVM id**, from `npx phala@1.2.8 cvms get`. Third, the **Phala CLI installed and logged in** on the machine that runs `autoupdate`: ```sh npm install -g phala@1.2.8 phala auth login ``` Try one round by hand first: ```sh sn46-miner autoupdate --cvm --compose compose.template.yml \ --state ~/.sn46-miner/autoupdate.state --phala "$(command -v phala)" --once ``` ## Run it as a service Run `autoupdate` on any always-on machine. With systemd, as your own user, save this as `~/.config/systemd/user/sn46-autoupdate.service`, with your CVM id, your template's path and the path from `command -v phala`: ```ini [Unit] Description=SN46 miner proxy auto-update Wants=network-online.target After=network-online.target [Service] ExecStart=%h/.local/bin/sn46-miner autoupdate --cvm --compose %h/sn46/compose.template.yml --state %h/.sn46-miner/autoupdate.state --phala Restart=always RestartSec=60 [Install] WantedBy=default.target ``` Then start it, and keep it running after you log out: ```sh mkdir -p ~/.sn46-miner systemctl --user daemon-reload systemctl --user enable --now sn46-autoupdate loginctl enable-linger "$USER" journalctl --user -u sn46-autoupdate -f ``` `--every ` changes how often it checks (300 by default). A cron job running `autoupdate --once` works too. --- Source: https://docs.instantnetwork.ai/miners/troubleshooting # Troubleshooting The errors you are most likely to see from `sn46-miner register` or `status`, and what to do about them. ## 403 "hotkey is not registered on the subnet" The control plane doesn't see your hotkey on SN46 yet. - Check that the hotkey is registered on netuid 46 on mainnet, and that it is the same hotkey as `SN46_HOTKEY` in your proxy's env file. - If you just registered it, or the control plane just restarted, wait for its first pass over the chain: **about 2.5 minutes after a control restart**. Then try again. ## 422 "attestation: quote did not verify" or "policy refused the image" The control plane couldn't verify your enclave, or your enclave isn't running a released image. - Deploy with the **published image digest**, exactly as in the [compose file](https://docs.instantnetwork.ai/miners/deploy): `ghcr.io/subnet46/sn46-proxy@sha256:daf8bbf6b7d705f21f3603214d5e184b1235913231838d1ea54cc0d808a8c6ac`. - Don't rebuild or retag the image, and don't add variables or services to the compose file: any change alters what the enclave reports. - After a new release, the previous one is accepted for 48 hours. [Auto-update](https://docs.instantnetwork.ai/miners/auto-update) keeps you current. ## 503 "upstream capacity unavailable" There is no capacity to serve the request right now, or your miner is on probation. - Check that your provider account is funded and that its keys work. - A new miner is on probation until our canaries have measured its speed. `sn46-miner status` shows where you stand. --- Source: https://docs.instantnetwork.ai/miners/provider-terms # Provider terms Your provider account stays fully yours: you choose the plan, top up the balance and set the limits. That also means you are responsible for complying with your provider's terms and for all usage under your keys. Please review those terms before connecting a key. Your keys stay sealed in your enclave. Nobody can read them out of it, including Phala, SN46 and you. --- Source: https://docs.instantnetwork.ai/validators # How validation works SN46 validators pay miners for the work they served. Every epoch, a validator closes the settled work into a signed summary, builds a weight row from it, has an independent auditor check that row, and submits it to the chain. When anything is in doubt, it submits the burn row instead. ## Epochs Every request a miner serves is settled in the SN46 ledger, with what the customer was charged and what the miner is owed: their provider's cost for the tokens, plus their speed bonus of 10% to 20%. At each epoch boundary, the validator closes the epoch: it reads the settled work, writes a summary signed with its signer key, and turns it into a weight row, each miner's share of the epoch's emission. ## The independent audit Before the row may pay, `sn46-audit` checks it against the epoch's summary. The auditor is a separate program with its own key and its own read-only access to the ledger; the signer runs it once per epoch and submits the row only when the audit's signed verdict passes. ## The burn row The burn row sends the whole pool to the burn UID. The validator submits it whenever the audit fails or a check is in doubt: nobody is paid for that round, and what miners earned carries over to the next one. The chain keeps paying the last row a validator set until a new one replaces it. So each validator runs a **watchdog** on a second machine: when the validator has written nothing by near the end of an epoch, the watchdog writes the burn row with the same hotkey. See [run](https://docs.instantnetwork.ai/validators/run). ## Run a validator 1. [Install](https://docs.instantnetwork.ai/validators/install) `sn46-signer` and `sn46-audit` with one curl command. 2. [Set up keys and config](https://docs.instantnetwork.ai/validators/configure). 3. [Run](https://docs.instantnetwork.ai/validators/run) the signer, and the watchdog on a second host. 4. [Update](https://docs.instantnetwork.ai/validators/update) when a new release is out. Not running a validator? You can [stake with one](https://docs.instantnetwork.ai/validators/stake). --- Source: https://docs.instantnetwork.ai/validators/install # Install the validator The validator is two programs: `sn46-signer`, which closes, audits, submits and settles every epoch, and `sn46-audit`, the independent auditor the signer runs once per epoch. The current release is **v0.1.7**. ## What you need - **A hotkey with a validator permit on SN46.** The hotkey must be registered on netuid 46 and hold a validator permit (enough stake to be among the subnet's permitted validators). The signer checks this when it starts and refuses to run otherwise, before it writes anything to the chain. - **A host.** Linux on x86_64 or aarch64 with systemd and glibc 2.35 or newer (Ubuntu 22.04 and 24.04 are tested), with outbound access to a subtensor node and to the ledger. It serves nothing: no port needs to be open. - **A second host for the watchdog** (recommended): see [run](https://docs.instantnetwork.ai/validators/run). - **Access to the SN46 ledger, from the SN46 team.** The settlements a validator pays for live in the SN46 ledger, a Postgres database run by the SN46 team. You get two connection URLs from the team, one for `sn46-signer` and one for `sn46-audit`, each with its own Postgres role. Use them only over the private link set up with you, never across the open internet: this release connects to Postgres without TLS. ## Install ```sh curl -fsSL https://raw.githubusercontent.com/Subnet46/v2-sn46-validator/dev/install.sh | sh -s -- --system ``` The installer downloads the latest release and checks it against the release's `SHA256SUMS`. With `--system` (using sudo) it: - installs `sn46-signer` and `sn46-audit` in `/usr/local/bin`; - creates the `sn46` system user the services run as (no login, no home); - creates `/etc/sn46` as `root:sn46`, mode `0750`, with `signer.example.toml` and `audit.example.toml` in it; - installs the units `sn46-signer.service` and `sn46-watchdog.service` in `/etc/systemd/system`. It never enables or starts a unit, and never writes a real config or key. Running it again is safe: it changes only what differs and says so. To install a given release, set `SN46_VERSION`: ```sh curl -fsSL https://raw.githubusercontent.com/Subnet46/v2-sn46-validator/dev/install.sh | SN46_VERSION=v0.1.7 sh -s -- --system ``` Check what is installed: ```sh sn46-signer --version ``` ## Build from source You need Rust 1.98 or later: ```sh git clone https://github.com/Subnet46/v2-sn46-validator && cd v2-sn46-validator # the libraries are pinned by ssh URL; without GitHub ssh keys, read them over https: export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=url.https://github.com/.insteadOf \ GIT_CONFIG_VALUE_0=ssh://git@github.com/ cargo build --release --locked -p sn46-signer -p sn46-audit # target/release/ ``` Next: [keys and config](https://docs.instantnetwork.ai/validators/configure). --- Source: https://docs.instantnetwork.ai/validators/configure # Keys and config Everything lives in `/etc/sn46`. Each key is in its own file, owned by `sn46`, mode `0600`. No key is ever read from a config file or printed. ## Keys ```sh sudo sn46-signer --new-key /etc/sn46/signer.key # prints the public key: signer_public_key sudo sn46-signer --new-key /etc/sn46/auditor.key # prints the public key: auditor_public_key sudo install -o sn46 -g sn46 -m 600 /dev/null /etc/sn46/hotkey.uri sudoedit /etc/sn46/hotkey.uri # the validator hotkey's secret, see below sudo chown sn46:sn46 /etc/sn46/signer.key /etc/sn46/auditor.key ``` - `signer.key` signs the epoch summaries, and `auditor.key` signs the audit verdicts. Each is a fresh ed25519 seed (64 hex). `sn46-signer --public-key ` prints a seed's public key again. - `hotkey.uri` is your validator hotkey as a secret URI, on one line: either its mnemonic phrase or its seed as `0x` followed by 64 hex. In a btcli wallet these are the `secretPhrase` and `secretSeed` fields of `~/.bittensor/wallets//hotkeys/`. The coldkey is never needed. ## Config files Write the two deployment files from the examples, readable by `sn46` and not by other users: ```sh sudo cp /etc/sn46/signer.example.toml /etc/sn46/signer.toml sudo cp /etc/sn46/audit.example.toml /etc/sn46/audit.toml sudo chown root:sn46 /etc/sn46/signer.toml /etc/sn46/audit.toml sudo chmod 640 /etc/sn46/signer.toml /etc/sn46/audit.toml sudoedit /etc/sn46/signer.toml /etc/sn46/audit.toml ``` `signer.toml` looks like this: ```toml ledger_url = "" chain_url = "wss://entrypoint-finney.opentensor.ai:443" network = "finney" netuid = 46 burn_uid = 0 units_per_alpha = 1000000000 validator_hotkey = "" signer_public_key = "" auditor_public_key = "" key_file = "/etc/sn46/signer.key" hotkey_uri_file = "/etc/sn46/hotkey.uri" audit_bin = "/usr/local/bin/sn46-audit" audit_config = "/etc/sn46/audit.toml" chain_checks = "strict" ``` Both files have the same fields; `audit.toml` leaves out the last four (`hotkey_uri_file`, `audit_bin`, `audit_config`, `chain_checks`). An unknown field is an error. | Field | Value | | -------------------- | ------------------------------------------------------------------------------------------------------------------ | | `ledger_url` | the ledger URL from the SN46 team: the `sn46_validator` one in `signer.toml`, the `sn46_audit` one in `audit.toml` | | `chain_url` | a subtensor node: `wss://entrypoint-finney.opentensor.ai:443`, or your own finney node | | `network` | `finney` (mainnet) | | `netuid` | `46` | | `burn_uid` | `0`: the UID that receives the weight the burn row gives | | `units_per_alpha` | `1000000000` (ledger units per alpha); keep the example's value unless the SN46 team tells you otherwise | | `validator_hotkey` | your validator hotkey's ss58 address; it must be the hotkey in `hotkey.uri` | | `signer_public_key` | what `--new-key signer.key` printed | | `auditor_public_key` | what `--new-key auditor.key` printed | | `key_file` | `/etc/sn46/signer.key` in `signer.toml`, `/etc/sn46/auditor.key` in `audit.toml` | | `hotkey_uri_file` | `/etc/sn46/hotkey.uri` | | `audit_bin` | `/usr/local/bin/sn46-audit`: the auditor the signer runs once per epoch | | `audit_config` | `/etc/sn46/audit.toml` | | `chain_checks` | `strict`: the node's metadata must match what this release was built for. Leave it as it is | Use absolute paths, as above. The ledger URLs, with their host, port and passwords, come from the SN46 team. Next: [run the validator](https://docs.instantnetwork.ai/validators/run). --- Source: https://docs.instantnetwork.ai/validators/run # Run the validator ## Start the signer On the main host: ```sh sudo systemctl enable --now sn46-signer journalctl -u sn46-signer -f systemctl status sn46-signer ``` At start, the signer reads its files, logs whether it reaches the ledger, connects to the node and checks your hotkey on netuid 46. Then it ticks every two seconds: at each epoch boundary it closes the epoch, runs the auditor and submits the row. ## Logs | Line | Meaning | | ----------------------------------- | ----------------------------------------------------------------------------------------------------- | | `chain checks mode ... mode=strict` | connecting to the node | | `epoch closed`, `weights set` | the normal epoch | | `burn row restored`, `dead man row` | the burn row went out (a failure, or the watchdog) | | `chain unavailable detail=...` | a tick failed; the detail names what failed (the node, the ledger, the auditor). It retries by itself | | `sn46-signer: ledger_url: ...` | the ledger can't be reached at start; the signer keeps running and retries | Healthy means `systemctl is-active sn46-signer` answers `active`, and the journal shows `weights set` once per epoch. ## Exit code 78: a config error The unit restarts the signer after a crash or an unreachable node. It does **not** restart it when the exit status is `78`: that means something only you can fix, and the last journal line says what. Fix it, then run `sudo systemctl restart sn46-signer`. The usual ones: - `cannot read the deployment file`, `key_file ...`, `hotkey_uri_file ...`: a missing file, or wrong permissions (the files must be readable by `sn46`); - `hotkey_uri_file holds the hotkey X, but validator_hotkey is Y`: the two don't match; - `is not registered on netuid 46`, `has no validator permit`: register or stake, then restart; - `runtime is spec N ...`: the chain upgraded; [update the validator](https://docs.instantnetwork.ai/validators/update). ## The watchdog, on a second host The chain keeps paying the last row a validator set until a new one replaces it, so a dead signer would leave its last real row paying. The watchdog guards against that. On a second machine, it watches the chain, and when your signer has written nothing by near the end of an epoch, it writes the burn row with your hotkey. It can only ever write the burn row, and it needs no ledger access. On the second machine: 1. [Install](https://docs.instantnetwork.ai/validators/install) with `--system`. 2. Copy `hotkey.uri` (owner `sn46`, mode `0600`), and `signer.toml` saved as `/etc/sn46/watchdog.toml` (`root:sn46`, mode `0640`). The ledger, auditor and key fields are read but not used; the hotkey must be the same. 3. Start it and watch it: ```sh sudo systemctl enable --now sn46-watchdog journalctl -u sn46-watchdog -f ``` A heartbeat line every few seconds says how many blocks ago it last saw your signer write. Never run a second signer with the same hotkey: one signer per hotkey, plus its watchdog. --- Source: https://docs.instantnetwork.ai/validators/update # Update the validator There is no automatic update for the validator yet. To update, run the installer again: ```sh curl -fsSL https://raw.githubusercontent.com/Subnet46/v2-sn46-validator/dev/install.sh | sh -s -- --system sudo systemctl restart sn46-signer ``` The installer names each running unit to restart; on the watchdog host, that is `sn46-watchdog`. To install a given release, set `SN46_VERSION` to one from the [releases page](https://github.com/Subnet46/v2-sn46-validator/releases): ```sh curl -fsSL https://raw.githubusercontent.com/Subnet46/v2-sn46-validator/dev/install.sh | SN46_VERSION=v0.1.7 sh -s -- --system ``` The same command with an older version rolls back. Your configs and keys are never touched; new example files in `/etc/sn46` show any new field. Check the installed release with `sn46-signer --version`. --- Source: https://docs.instantnetwork.ai/validators/stake # Stake with a validator Not running a validator yourself? Stake with one on netuid 46 to earn as a staker. For example, UID 238's hotkey is `5CDnZ6oeCrXKoL2VJQuQFxSfr49yQWz2DvdaYx47hr9QdM6D`. ```sh btcli stake add --netuid 46 --hotkey \ --amount --network finney --wallet.name ``` To move stake you already have on SN46 to another validator: ```sh btcli stake move --netuid 46 \ --origin-hotkey --dest-hotkey \ --network finney --wallet.name ``` Moving within netuid 46 keeps your alpha position. --- Source: https://docs.instantnetwork.ai/validators/faq # Validator FAQ ## What do I need to run a validator? A hotkey registered on netuid 46 with a validator permit, a Linux host with systemd, ledger access from the SN46 team, and ideally a second host for the watchdog. See [install](https://docs.instantnetwork.ai/validators/install). ## Does the validator need open ports? No. It serves nothing; it only connects out to a subtensor node and to the ledger. ## What happens if my validator goes down? The chain keeps paying the last row you set. Your [watchdog](https://docs.instantnetwork.ai/validators/run) on a second host writes the burn row when your signer has written nothing by near the end of an epoch. ## How do I know the weights are right? Every weight row passes an independent audit before it goes on chain, and the burn row goes out when a check fails. See [how validation works](https://docs.instantnetwork.ai/validators). ## How do I update? Run the installer again, or pin a release with `SN46_VERSION`. See [update](https://docs.instantnetwork.ai/validators/update). ## Can I stake instead of running a validator? Yes: [stake with a validator](https://docs.instantnetwork.ai/validators/stake). ## Can I mine instead? Yes. Follow the [miner docs](https://docs.instantnetwork.ai/miners).