# set-subnet-emission-enabled (/docs/tx/set-subnet-emission-enabled)

Flips the `SubnetEmissionEnabled` storage flag for each listed subnet —
the ROOT-ONLY switch that gates whether a subnet earns its share of TAO
emission on the pool side. Distinct from the owner's one-shot
`start_call` (`subnet_is_active`): a subnet can be active — epochs
running, alpha trading — yet earn no TAO emission share until root flips
this flag on. Disabling only zeros the pool-side `alpha_in` /
`tao_in` / `excess_tao` chain-buy paths; it does not remove the
subnet from emission share calculation and does not touch `alpha_out`,
the owner cut, root proportion, or pending server/validator emission.

Requires the chain sudo key: `Executor` wraps the built call in
`Sudo.sudo` because `origin` is `root`, and when root is a multisig
that `Sudo.sudo` call is what the multisig must dispatch. Multiple
netuids batch atomically via `Utility.batch_all` inside the single sudo
call. Verify the effect afterwards with the `subnet_emission_enabled`
read.

| Signer    | Origin            | Pallet     | Wraps                                                      |
| --------- | ----------------- | ---------- | ---------------------------------------------------------- |
| `coldkey` | root (chain sudo) | AdminUtils | `AdminUtils.sudo_set_subnet_emission_enabled`, `Sudo.sudo` |

## Verify [#verify]

After inclusion, confirm the effect with the
[`subnet-emission-enabled`](/docs/query/subnet-emission-enabled) read:

```bash
btcli query subnet-emission-enabled --netuid <integer> --json
```

## Parameters [#parameters]

| Parameter | Type             | Required | Description                                                                                                                                 |
| --------- | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `netuids` | array of integer | yes      | Subnets to toggle; multiple netuids batch atomically.                                                                                       |
| `enabled` | boolean          | yes      | True to let the subnets earn their pool-side TAO emission share, false to zero the pool-side alpha\_in/tao\_in/excess\_tao chain-buy paths. |

Address parameters (`--hotkey`, `--coldkey`, `--dest`, ...) accept a raw ss58
address, an address-book or proxy-book name, or a local wallet/hotkey name.

## CLI [#cli]

Preview with `--dry-run` (shows fee, effects, and policy result without
submitting), then submit:

```bash
btcli tx set-subnet-emission-enabled \
  --netuids <a,b,c> \
  --enabled/--no-enabled --dry-run
btcli tx set-subnet-emission-enabled \
  --netuids <a,b,c> \
  --enabled/--no-enabled -w my_coldkey
```

## Python [#python]

```python
import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.SetSubnetEmissionEnabled(netuids=[...], enabled=True)

sub = bt.Subtensor()
plan = sub.plan(intent, wallet)   # fee, effects, policy — no submission
result = sub.execute(intent, wallet)
if not result.success:
    print(result.error.code, result.error.remediation)
```

(`bt.Subtensor` is also the async client — `async with bt.Subtensor() as client:`
— see [The client](/docs/concepts/client).) Or build the intent by op name, as
an agent would:

```python
result = sub.execute_tool("set_subnet_emission_enabled", {...}, wallet)
```

## On-chain implementation [#on-chain-implementation]

`AdminUtils.sudo_set_subnet_emission_enabled` — [`pallets/admin-utils/src/lib.rs#L2284`](/code/pallets/admin-utils/src/lib.rs#L2284):

```rust
#[pallet::call_index(94)]
#[pallet::weight(<T as pallet::Config>::WeightInfo::sudo_set_subnet_emission_enabled())]
pub fn sudo_set_subnet_emission_enabled(
    origin: OriginFor<T>,
    netuid: NetUid,
    enabled: bool,
) -> DispatchResult {
    ensure_root(origin)?;

    ensure!(
        pallet_subtensor::Pallet::<T>::if_subnet_exist(netuid),
        Error::<T>::SubnetDoesNotExist
    );
    ensure!(!netuid.is_root(), Error::<T>::NotPermittedOnRootSubnet);

    pallet_subtensor::SubnetEmissionEnabled::<T>::insert(netuid, enabled);
    Self::deposit_event(Event::SubnetEmissionEnabledSet { netuid, enabled });
    log::debug!("SubnetEmissionEnabledSet( netuid: {netuid:?}, enabled: {enabled:?} )");

    Ok(())
}
```

`Sudo.sudo` is implemented by Substrate's `pallet_sudo`, outside this repository's pallets.

Every file is browsable under [/code](/code) exactly as built into the runtime, or as plain text under `/code/raw/<path>` (index: [`/code/index.json`](/code/index.json)).
