|
| 1 | +--- |
| 2 | +title: "Managing Multiple Incentive Mechanisms with BTCLI" |
| 3 | +--- |
| 4 | + |
| 5 | +# Managing Multiple Incentive Mechanisms with BTCLI |
| 6 | + |
| 7 | +This tutorial shows how to configure and manage multiple incentive mechanisms in a single subnet using BTCLI. |
| 8 | + |
| 9 | +For background on the concepts, see [Understanding Multiple Incentive Mechanisms](understanding-multiple-mech-subnets). |
| 10 | + |
| 11 | +See also: [Managing Mechanisms with SDK](managing-mechanisms-with-sdk). |
| 12 | + |
| 13 | +**Prerequisites** |
| 14 | +- A local Subtensor chain running. See: [Run a Local Bittensor Blockchain Instance](../local-build/deploy) |
| 15 | +- A local subnet created (and emissions started). See: [Create a Subnet (Locally)](../local-build/create-subnet) |
| 16 | +- Wallets provisioned and funded for local development. See: [Provision Wallets](../local-build/provision-wallets) |
| 17 | +- BTCLI installed (development version required for mechanism commands) |
| 18 | + |
| 19 | +::::tip |
| 20 | +Substitute your subnet's netuid, which you can find with `btcli subnet list`. |
| 21 | +:::: |
| 22 | + |
| 23 | +:::warning Runtime limit |
| 24 | +As of the current Subtensor runtime, a subnet can have a maximum of 2 mechanisms. Attempts to set a higher count will be rejected by the chain (runtime enforces `MaxMechanismCount = 2`). |
| 25 | + |
| 26 | +::: |
| 27 | + |
| 28 | +## Check initial state |
| 29 | + |
| 30 | +The following command will check the count of your subnet's incentive mechanisms and display the emissions split among them. |
| 31 | + |
| 32 | + |
| 33 | +```bash |
| 34 | +btcli subnet mech count --netuid 6 --network local |
| 35 | +btcli subnet mech emissions --netuid 6 --network local |
| 36 | +``` |
| 37 | +``` |
| 38 | +Subnet 6 currently has 1 mechanism. |
| 39 | +(Tip: 1 mechanism means there are no mechanisms beyond the main subnet) |
| 40 | +
|
| 41 | +Subnet 6 only has the primary mechanism (mechanism 0). No emission split to display. |
| 42 | +``` |
| 43 | + |
| 44 | +## Create a second mechanism |
| 45 | + |
| 46 | +Create a second incentive mechanism by specifying the desired count as two for your subnet. |
| 47 | + |
| 48 | +```bash |
| 49 | +btcli subnet mech set --mech-count 2 --netuid 6 --network local |
| 50 | +``` |
| 51 | +``` |
| 52 | +Subnet 6 currently has 1 mechanism. Set it to 2? [y/n]: y |
| 53 | +✅ Mechanism count set to 2 for subnet 6 |
| 54 | +``` |
| 55 | + |
| 56 | + |
| 57 | +Check the state to confirm the change |
| 58 | + |
| 59 | +```bash |
| 60 | +btcli subnet mech count --netuid 6 --network local |
| 61 | +btcli subnet mech emissions --netuid 6 --network local |
| 62 | +``` |
| 63 | +``` |
| 64 | +Subnet 6 currently has 2 mechanisms. |
| 65 | +(Tip: 1 mechanism means there are no mechanisms beyond the main subnet) |
| 66 | +[13:44:15] Warning: Verify your local subtensor is running on port 9944. subtensor_interface.py:85 |
| 67 | +
|
| 68 | + Subnet 6 • Emission split |
| 69 | + Network: local |
| 70 | +
|
| 71 | + Mechanism Index Weight (u16) Share (%) |
| 72 | + ───────────────────────────────────────────── |
| 73 | + 0 32768 50.000763 |
| 74 | + 1 32767 49.999237 |
| 75 | + Total 65535 100.000000 |
| 76 | + ───────────────────────────────────────────── |
| 77 | +
|
| 78 | +
|
| 79 | +Totals are expressed as a fraction of 65535 (U16_MAX). |
| 80 | +No custom split found; displaying an even distribution. |
| 81 | +``` |
| 82 | + |
| 83 | + |
| 84 | +## Set a custom 90/10 emission split |
| 85 | + |
| 86 | +Let's allocate only 10% of our subnet's emissions to the second subnet. |
| 87 | + |
| 88 | + |
| 89 | +```bash |
| 90 | +btcli subnet mech emissions-split --netuid 6 --network local --split "90,10" --wallet-name alice |
| 91 | +``` |
| 92 | +``` |
| 93 | + Subnet 6 • Emission split |
| 94 | + Network: local |
| 95 | +
|
| 96 | + Mechanism Index Weight (u16) Share (%) |
| 97 | + ───────────────────────────────────────────── |
| 98 | + 0 32768 50.000763 |
| 99 | + 1 32767 49.999237 |
| 100 | + Total 65535 100.000000 |
| 101 | + ───────────────────────────────────────────── |
| 102 | +
|
| 103 | +
|
| 104 | +Totals are expressed as a fraction of 65535 (U16_MAX). |
| 105 | +No custom split found; displaying an even distribution. |
| 106 | +
|
| 107 | + Proposed emission split |
| 108 | + Subnet 6 |
| 109 | +
|
| 110 | + Mechanism Index Weight (u16) Share (%) |
| 111 | + ───────────────────────────────────────────── |
| 112 | + 0 58982 90.000000 |
| 113 | + 1 6553 10.000000 |
| 114 | +
|
| 115 | + Total 65535 100.000000 |
| 116 | + ───────────────────────────────────────────── |
| 117 | +
|
| 118 | +
|
| 119 | +Proceed with these emission weights? [y/n] (y): y |
| 120 | +🌍 📡 Setting emission split for subnet 6... |
| 121 | +✅ Emission split updated for subnet 6 |
| 122 | +``` |
| 123 | + |
| 124 | + |
| 125 | +We can confirm this by running the getter command again: |
| 126 | + |
| 127 | +```bash |
| 128 | +btcli subnet mech emissions --netuid 6 --network local |
| 129 | +``` |
| 130 | +``` |
| 131 | +
|
| 132 | + Subnet 6 • Emission split |
| 133 | + Network: local |
| 134 | +
|
| 135 | + Mechanism Index Weight (u16) Share (%) |
| 136 | + ───────────────────────────────────────────── |
| 137 | + 0 58982 90.000763 |
| 138 | + 1 6553 9.999237 |
| 139 | + Total 65535 100.000000 |
| 140 | + ───────────────────────────────────────────── |
| 141 | +
|
| 142 | +
|
| 143 | +Totals are expressed as a fraction of 65535 (U16_MAX). |
| 144 | +``` |
| 145 | + |
| 146 | +## Troubleshooting |
| 147 | + |
| 148 | +- Rate limiting: mechanism count changes are restricted (on mainnet) to once per ~24 hours (7200 blocks). |
| 149 | +- Permissions: emission split and count updates require the subnet owner wallet. |
| 150 | +- Local chain connectivity: ensure your local chain is running and the `network` parameter in your BTCLI config is set to `local`. |
0 commit comments