Skip to content
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
804bc23
mvp v0 base of issues
LandynDev Jan 31, 2026
ea08b78
Cleaning up some errors and events unused by v0
LandynDev Feb 2, 2026
9a95745
Removed last stake delta accounting from harvest and alpha pool calcu…
LandynDev Feb 2, 2026
dbbb3a3
Payout logic clean ups and runtime_calls reorganized
LandynDev Feb 2, 2026
3055a0e
removed v0 tagged comments
LandynDev Feb 2, 2026
ab91a30
Renamed files for successful imports
LandynDev Feb 2, 2026
b1cb25c
Syntax corrections from bt upgrade
LandynDev Feb 2, 2026
7492f2c
cli cleanups
LandynDev Feb 3, 2026
531f4b9
hardcoded rewards for contract emissions
LandynDev Feb 3, 2026
04596d0
CLI and harvest function fixes - removed gittensor vali stake move ca…
LandynDev Feb 3, 2026
1f0cb7d
add unit tests, remove e2e dependency
anderdc Feb 3, 2026
c339399
cli upgrades, vali stake consensus mvp fixes, store bounty payout hot…
LandynDev Feb 4, 2026
daaa04b
CLI Quality of life upgrades - new reference doc (for testing)
LandynDev Feb 4, 2026
f49bf10
overhauled reference table
LandynDev Feb 4, 2026
ff8652e
cli reference testing updates
LandynDev Feb 4, 2026
ab3d8e1
Fixed bounty pool and pending harvest queries - updated testing ref
LandynDev Feb 4, 2026
3225192
change order of wallet for config
Feb 4, 2026
4340f43
gitt cli admin implementations - removed stubs. Contract treasury cha…
LandynDev Feb 4, 2026
e01a5dd
Cleaning up old work and ref docs
LandynDev Feb 4, 2026
512b5fd
start vali integration + cleanup
Feb 5, 2026
64e3850
Fixed harvest function to fill in FIFO order
LandynDev Feb 5, 2026
b019e7a
cleanup + productionizing
Feb 9, 2026
4bfb6e1
cleanup+vali now needs pat
Feb 10, 2026
675d195
simplify contract client
anderdc Feb 11, 2026
261d461
remove unused runtime call
anderdc Feb 11, 2026
54a7677
Merge branch 'test' into issues-v0
anderdc Feb 12, 2026
b052fdb
refactor cli
Feb 12, 2026
b40c08c
validate token on start for miner
Feb 12, 2026
be27244
Merge branch 'test' into issues-v0
Feb 12, 2026
81bf7b0
Merge branch 'test' into issues-v0
Feb 12, 2026
58caaa2
issues v0 is gittensor 4.0
Feb 12, 2026
200f63f
Merge branch 'test' into issues-v0
Feb 12, 2026
09bd67c
update issue bounties logging
Feb 13, 2026
866b548
more logging
Feb 13, 2026
de8484a
Merge branch 'test' into issues-v0
Feb 13, 2026
3316f1c
update smartcontract for vali voting
Feb 13, 2026
0f02f24
TmuxNavigateUp
anderdc Feb 13, 2026
1e4084b
update contract client to properly read list validators
anderdc Feb 13, 2026
39ce9ff
update get coldkey
anderdc Feb 14, 2026
b2ac990
harden functions for issue solver
anderdc Feb 15, 2026
1a0471e
tune and boost unique pr bonus for pioneer miners
anderdc Feb 15, 2026
77c0744
add fallback for finding pr solver
anderdc Feb 16, 2026
378b558
use graphql
anderdc Feb 16, 2026
978d6df
update metadata
anderdc Feb 16, 2026
1670c5c
tighten up pr solve detection
anderdc Feb 16, 2026
b710a89
CLeaning up stake accounting - unused
LandynDev Feb 16, 2026
b729e95
Fixed failed bounty payout accounting
LandynDev Feb 16, 2026
a844014
update issues constants for mainnet
anderdc Feb 16, 2026
183709a
lower default required tao in wallet for contract transactions
anderdc Feb 16, 2026
b4fb151
do not enforce vali pat's
anderdc Feb 16, 2026
a9973ae
fix ruff errors
anderdc Feb 16, 2026
46bce80
style: auto-format with ruff
anderdc Feb 16, 2026
ef602d2
Removed cli reference table
LandynDev Feb 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ WALLET_PATH=~/.bittensor/wallets
WALLET_NAME=default
HOTKEY_NAME=default

# For validators: Weights & Biases API key for logging
# ******* VALIDATOR VARIABLES *******
# Weights & Biases API key for logging
# Signup https://wandb.ai/site for a key
WANDB_API_KEY=
# Optional custom name for wandb logging
# for issue bounties api calls
GITTENSOR_VALIDATOR_PAT=
# Optional custom name for wandb logging
WANDB_VALIDATOR_NAME=vali

# For miners: GitHub Personal Access Token
# ******* MINER VARIABLES *******
# GitHub Personal Access Token
# https://github.com/settings/personal-access-tokens
GITTENSOR_MINER_PAT=

Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ wandb
CLAUDE.md
.claude/
.vscode/

# Rust/Cargo build artifacts
target/
**/*.rs.bk
*.lock
2 changes: 1 addition & 1 deletion gittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
# DEALINGS IN THE SOFTWARE.

# NOTE: bump this value when updating the codebase
__version__ = '3.2.0'
__version__ = '4.0.0'
version_split = __version__.split('.')
__spec_version__ = (1000 * int(version_split[0])) + (10 * int(version_split[1])) + (1 * int(version_split[2]))
8 changes: 8 additions & 0 deletions gittensor/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# The MIT License (MIT)
# Copyright © 2025 Entrius

"""Gittensor CLI package"""

from .main import cli, main

__all__ = ['main', 'cli']
42 changes: 42 additions & 0 deletions gittensor/cli/cli_reference_table.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Gittensor CLI Reference Table (issues-v0)

## Global Options

All commands that interact with the network support:
- `--network` / `-n` : Network name (`finney`, `test`, `local`). Default: `finney`
- `--rpc-url` : Custom RPC endpoint (overrides `--network`)
- `--wallet-name` / `--wallet.name` / `--wallet` : Wallet name
- `--wallet-hotkey` / `--wallet.hotkey` / `--hotkey` : Hotkey name

## Command Reference

| CLI Command | Access | Tested | Testing Command | Notes |
|-------------|--------|--------|-----------------|-------|
| **Config (`gitt config`)** | | | | |
| `gitt config` | Read | [x] | `gitt config` | Show current config |
| `gitt config set <key> <value>` | Read | [x] | `gitt config set wallet alice` | Set config value |
| **Issues (`gitt issues` / `gitt i`)** | | | | |
| `gitt issues list` | Read | [x] | `gitt i list --network local --contract <ADDR>` | List all issues |
| `gitt issues list --id <ID>` | Read | [x] | `gitt i list --id 0 --network local --contract <ADDR>` | View specific issue detail |
| `gitt issues register` | Owner | [x] | `gitt i register --repo test/repo --issue 1 --bounty 10 --network local --contract <ADDR> --wallet alice` | Also tested non-permitted wallets cannot register. |
| `gitt issues bounty-pool` | Read | [x] | `gitt i bounty-pool --network local --contract <ADDR>` | Sum of all issue bounty amounts |
| `gitt issues pending-harvest` | Read | [x] | `gitt i pending-harvest --network local --contract <ADDR>` | Treasury stake minus allocated bounties |
| **Harvest (`gitt harvest`)** | | | | |
| `gitt harvest` | Permissionless | [x] | `gitt harvest --network local --contract <ADDR> --wallet alice --verbose` | Fixed: now fills in FIFO order |
| **Vote (`gitt vote`)** | | | | |
| `gitt vote solution <ID> <HOTKEY> <COLDKEY> <PR>` | Validator | [x] | `gitt vote solution 0 <HOTKEY> <COLDKEY> 1 --network local --contract <ADDR> --wallet validator1` | Triggers auto-payout on consensus |
| `gitt vote cancel <ID> <REASON>` | Validator | [x] | `gitt vote cancel 0 "reason" --network local --contract <ADDR> --wallet validator1` | Tested: works for Registered/Active, fails for Completed/Cancelled. |
| **Admin (`gitt admin` / `gitt a`)** | | | | |
| `gitt admin info` | Read | [x] | `gitt a info --network local --contract <ADDR>` | View contract config (owner, treasury, netuid) |
| `gitt admin cancel-issue <ID>` | Owner | [x] | `gitt a cancel-issue 0 --network local --contract <ADDR> --wallet alice` | Not implemented |
| `gitt admin payout-issue <ID>` | Owner | [x] | `gitt a payout-issue 0 --network local --contract <ADDR> --wallet alice` | Not implemented - solver determined by validator consensus |
| `gitt admin set-owner <NEW_OWNER>` | Owner | [x] | `gitt a set-owner <ADDR> --network local --contract <ADDR> --wallet alice` | |
| `gitt admin set-treasury <NEW_TREASURY>` | Owner | [x] | `gitt a set-treasury <ADDR> --network local --contract <ADDR> --wallet alice` | |

## Network Shortcuts

| `--network` | RPC Endpoint |
|-------------|-------------|
| `finney` (default) | `wss://entrypoint-finney.opentensor.ai:443` |
| `test` | `wss://test.finney.opentensor.ai:443` |
| `local` | `ws://127.0.0.1:9944` |
102 changes: 102 additions & 0 deletions gittensor/cli/issue_commands/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# The MIT License (MIT)
# Copyright © 2025 Entrius

"""
CLI commands for managing issue bounties

Command structure:
gitt issues (alias: i) - Issue management commands
list [--id <ID>] List issues or view a specific issue
register Register a new issue bounty
bounty-pool View total bounty pool
pending-harvest View pending emissions
gitt harvest - Harvest emissions (top-level)
gitt vote - Validator consensus commands
gitt admin (alias: a) - Owner-only commands
info View contract configuration
cancel-issue Cancel an issue
payout-issue Manual payout fallback
set-owner Transfer ownership
set-treasury Change treasury hotkey
"""

import click

from .admin import admin

# Re-export helpers
from .helpers import (
CONFIG_FILE,
GITTENSOR_DIR,
NETWORK_MAP,
console,
get_contract_address,
load_config,
read_issues_from_contract,
resolve_network,
)
from .mutations import (
issue_harvest,
issue_register,
)
from .view import admin_info, issues_bounty_pool, issues_list, issues_pending_harvest
from .vote import vote


@click.group(name='issues')
def issues_group():
"""Issue management commands.

\b
Commands:
list List issues or view a specific issue
register Register a new issue bounty
bounty-pool View total bounty pool
pending-harvest View pending emissions
"""
pass


issues_group.add_command(issues_list, name='list')
issues_group.add_command(issue_register, name='register')
issues_group.add_command(issues_bounty_pool, name='bounty-pool')
issues_group.add_command(issues_pending_harvest, name='pending-harvest')

# Add info to admin group
admin.add_command(admin_info, name='info')


def register_commands(cli):
"""Register all issue-related commands with the root CLI group."""
# Issues group with alias
cli.add_command(issues_group, name='issues')
cli.add_alias('issues', 'i')

# Harvest as top-level command
cli.add_command(issue_harvest, name='harvest')

# Validator vote group
cli.add_command(vote, name='vote')

# Admin group with alias
cli.add_command(admin)
cli.add_alias('admin', 'a')


__all__ = [
'register_commands',
'issues_group',
'vote',
'admin',
'issue_register',
'issue_harvest',
# Helpers
'console',
'load_config',
'get_contract_address',
'resolve_network',
'read_issues_from_contract',
'GITTENSOR_DIR',
'CONFIG_FILE',
'NETWORK_MAP',
]
Loading