Skip to content

Conversation

@stephen-ridges
Copy link
Collaborator

@stephen-ridges stephen-ridges commented Dec 18, 2025

This is scuffed af, but it's a temp fix 😭

This was done using a separate process, since the bittensor SDK has a memory leak when creating a new connection. even if it's garbage collected. More info in this PR #263. At least in a separate process, the operating system can clean up memory.

If we try doing it with the bittensor SDK, the subtensor.get_uid_for_hotkey_on_subnet(hotkey_ss58=weight_receiving_hotkey, netuid=config.NETUID) function always times out 😭

Setting weights:
image

Hotkey registered
image

Hotkey not registered
image

Testing:

docker run --rm --name local_chain -p 9944:9944 -p 9945:9945 ghcr.io/opentensor/subtensor-localnet:devnet-ready
# new terminal
btcli wallet transfer --wallet.name owner --dest "$(jq --raw-output ".ss58Address" ~/.bittensor/wallets/miner/coldkeypub.txt)" --amount 50000 --no_prompt --json-output
btcli wallet transfer --wallet.name owner --dest "$(jq --raw-output ".ss58Address" ~/.bittensor/wallets/validator/coldkeypub.txt)" --amount 50000 --no_prompt --json-output
btcli subnet register --wallet.name miner --wallet.hotkey default --netuid 1 --subtensor.chain_endpoint ws://127.0.0.1:9944 --no_prompt
btcli subnet register --wallet.name validator --wallet.hotkey default --netuid 1 --subtensor.chain_endpoint ws://127.0.0.1:9944 --no_prompt

# run platform
NETUID=1 SUBTENSOR_ADDRESS=ws://127.0.0.1:9944 SUBTENSOR_NETWORK=local MINER_AGENT_UPLOAD_RATE_LIMIT_SECONDS=1 ENV=prod uv run -m api.src.main --no-auto-update

# run vali
RIDGES_INFERENCE_GATEWAY_URL=http://192.168.1.72:1234 NETUID=1 SUBTENSOR_NETWORK=local SUBTENSOR_ADDRESS=ws://127.0.0.1:9944 MODE=validator VALIDATOR_WALLET_NAME=validator VALIDATOR_HOTKEY_NAME=default uv run -m validator.main --no-auto-update

# try upload with registered and unregistered hotkeys 
RIDGES_COLDKEY_NAME=miner RIDGES_HOTKEY_NAME=default NETUID=1 SUBTENSOR_ADDRESS=ws://127.0.0.1:9944 SUBTENSOR_NETWORK=local ./ridges.py --url http://localhost:8000 upload --file agent.py

@stephen-ridges stephen-ridges self-assigned this Dec 18, 2025
@stephen-ridges stephen-ridges changed the title Set weights using CLI process Set weights and check hotkey registered using CLI process Dec 18, 2025
@stephen-ridges stephen-ridges force-pushed the fix-setting-weights branch 2 times, most recently from 1c44e8c to 256373f Compare December 18, 2025 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants