Skip to content

Commit c16d9c0

Browse files
authored
Merge pull request #694 from opentensor/release/9.15.0
Release/9.15.0
2 parents d417363 + 53822cb commit c16d9c0

File tree

9 files changed

+1249
-44
lines changed

9 files changed

+1249
-44
lines changed

.github/workflows/e2e-subtensor-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
find-tests:
2929
runs-on: ubuntu-latest
30-
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
30+
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.draft == false && !startsWith(github.head_ref, 'changelog/')) }}
3131
outputs:
3232
test-files: ${{ steps.get-tests.outputs.test-files }}
3333
steps:
@@ -43,6 +43,7 @@ jobs:
4343

4444
pull-docker-image:
4545
runs-on: ubuntu-latest
46+
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.draft == false && !startsWith(github.head_ref, 'changelog/')) }}
4647
steps:
4748
- name: Log in to GitHub Container Registry
4849
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# Changelog
2+
3+
## 9.15.0 /2025-11-04
4+
5+
* Stop running e2e tests on changelog branches by @thewhaleking in https://github.com/opentensor/btcli/pull/691
6+
* Feat/root claim by @ibraheem-abe in https://github.com/opentensor/btcli/pull/692
7+
8+
**Full Changelog**: https://github.com/opentensor/btcli/compare/v9.14.3...v9.15.0
9+
210
## 9.14.3 /2025-10-30
311
* Allows for installing on Py 3.14 by @thewhaleking in https://github.com/opentensor/btcli/pull/688
412
* corrects `--name` param in `wallet set-identity` and `subnets set-identity` which was a duplicate param alias of `--wallet-name`

bittensor_cli/cli.py

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
move as move_stake,
8888
add as add_stake,
8989
remove as remove_stake,
90+
claim as claim_stake,
9091
)
9192
from bittensor_cli.src.commands.subnets import (
9293
price,
@@ -970,6 +971,12 @@ def __init__(self):
970971
self.stake_app.command(
971972
"swap", rich_help_panel=HELP_PANELS["STAKE"]["MOVEMENT"]
972973
)(self.stake_swap)
974+
self.stake_app.command(
975+
"set-claim", rich_help_panel=HELP_PANELS["STAKE"]["CLAIM"]
976+
)(self.stake_set_claim_type)
977+
self.stake_app.command(
978+
"process-claim", rich_help_panel=HELP_PANELS["STAKE"]["CLAIM"]
979+
)(self.stake_process_claim)
973980

974981
# stake-children commands
975982
children_app = typer.Typer()
@@ -1144,6 +1151,16 @@ def __init__(self):
11441151
self.sudo_app.command("get_take", hidden=True)(self.sudo_get_take)
11451152
self.sudo_app.command("set_take", hidden=True)(self.sudo_set_take)
11461153

1154+
# Stake
1155+
self.stake_app.command(
1156+
"claim",
1157+
hidden=True,
1158+
)(self.stake_set_claim_type)
1159+
self.stake_app.command(
1160+
"unclaim",
1161+
hidden=True,
1162+
)(self.stake_set_claim_type)
1163+
11471164
# Crowdloan
11481165
self.app.add_typer(
11491166
self.crowd_app,
@@ -7066,6 +7083,115 @@ def view_dashboard(
70667083
)
70677084
)
70687085

7086+
def stake_set_claim_type(
7087+
self,
7088+
wallet_name: Optional[str] = Options.wallet_name,
7089+
wallet_path: Optional[str] = Options.wallet_path,
7090+
wallet_hotkey: Optional[str] = Options.wallet_hotkey,
7091+
network: Optional[list[str]] = Options.network,
7092+
prompt: bool = Options.prompt,
7093+
quiet: bool = Options.quiet,
7094+
verbose: bool = Options.verbose,
7095+
json_output: bool = Options.json_output,
7096+
):
7097+
"""
7098+
Set the root claim type for your coldkey.
7099+
7100+
Root claim types control how staking emissions are handled on the ROOT network (subnet 0):
7101+
7102+
[bold]Claim Types:[/bold]
7103+
• [green]Swap[/green]: Future Root Alpha Emissions are swapped to TAO and added to root stake (default)
7104+
• [yellow]Keep[/yellow]: Future Root Alpha Emissions are kept as Alpha tokens
7105+
7106+
USAGE:
7107+
7108+
[green]$[/green] btcli root set-claim-type
7109+
7110+
With specific wallet:
7111+
7112+
[green]$[/green] btcli root set-claim-type --wallet-name my_wallet
7113+
"""
7114+
self.verbosity_handler(quiet, verbose, json_output)
7115+
wallet = self.wallet_ask(
7116+
wallet_name,
7117+
wallet_path,
7118+
wallet_hotkey,
7119+
ask_for=[WO.NAME],
7120+
)
7121+
return self._run_command(
7122+
claim_stake.set_claim_type(
7123+
wallet=wallet,
7124+
subtensor=self.initialize_chain(network),
7125+
prompt=prompt,
7126+
json_output=json_output,
7127+
)
7128+
)
7129+
7130+
def stake_process_claim(
7131+
self,
7132+
netuids: Optional[str] = Options.netuids,
7133+
wallet_name: Optional[str] = Options.wallet_name,
7134+
wallet_path: Optional[str] = Options.wallet_path,
7135+
wallet_hotkey: Optional[str] = Options.wallet_hotkey,
7136+
network: Optional[list[str]] = Options.network,
7137+
prompt: bool = Options.prompt,
7138+
quiet: bool = Options.quiet,
7139+
verbose: bool = Options.verbose,
7140+
json_output: bool = Options.json_output,
7141+
):
7142+
"""
7143+
Manually claim accumulated root network emissions for your coldkey.
7144+
7145+
[bold]Note:[/bold] The network will eventually process your pending emissions automatically.
7146+
However, you can choose to manually claim your emissions with a small extrinsic fee.
7147+
7148+
A maximum of 5 netuids can be processed in one call.
7149+
7150+
USAGE:
7151+
7152+
[green]$[/green] btcli stake process-claim
7153+
7154+
Claim from specific netuids:
7155+
7156+
[green]$[/green] btcli stake process-claim --netuids 1,2,3
7157+
7158+
Claim with specific wallet:
7159+
7160+
[green]$[/green] btcli stake process-claim --netuids 1,2 --wallet-name my_wallet
7161+
7162+
"""
7163+
self.verbosity_handler(quiet, verbose, json_output)
7164+
7165+
parsed_netuids = None
7166+
if netuids:
7167+
parsed_netuids = parse_to_list(
7168+
netuids,
7169+
int,
7170+
"Netuids must be a comma-separated list of ints, e.g., `--netuids 1,2,3`.",
7171+
)
7172+
7173+
if len(parsed_netuids) > 5:
7174+
print_error("Maximum 5 netuids allowed per claim")
7175+
return
7176+
7177+
wallet = self.wallet_ask(
7178+
wallet_name,
7179+
wallet_path,
7180+
wallet_hotkey,
7181+
ask_for=[WO.NAME],
7182+
)
7183+
7184+
return self._run_command(
7185+
claim_stake.process_pending_claims(
7186+
wallet=wallet,
7187+
subtensor=self.initialize_chain(network),
7188+
netuids=parsed_netuids,
7189+
prompt=prompt,
7190+
json_output=json_output,
7191+
verbose=verbose,
7192+
)
7193+
)
7194+
70697195
def liquidity_add(
70707196
self,
70717197
network: Optional[list[str]] = Options.network,

bittensor_cli/src/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ class RootSudoOnly(Enum):
709709
"STAKE_MGMT": "Stake Management",
710710
"CHILD": "Child Hotkeys",
711711
"MOVEMENT": "Stake Movement",
712+
"CLAIM": "Root Claim Management",
712713
},
713714
"SUDO": {
714715
"CONFIG": "Subnet Configuration",

0 commit comments

Comments
 (0)