Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
2d9ac81
Update metagraph.py
leopardracer Jan 16, 2025
313521d
Release/8.5.2 (#2584)
ibraheem-abe Jan 17, 2025
a38c4bd
fix typos
Dimitrolito Jan 17, 2025
60370c9
fix spelling error
Dimitrolito Jan 17, 2025
2619478
Merge branch 'staging' into fix/spelling
thewhaleking Jan 18, 2025
6fa036f
Merge branch 'staging' into master
thewhaleking Jan 18, 2025
72dd8ad
Merge pull request #2580 from leopardracer/master
thewhaleking Jan 18, 2025
e398254
Merge branch 'staging' into fix/spelling
thewhaleking Jan 19, 2025
8d6afd8
Update synapse.py
crStiv Jan 19, 2025
900d66e
fix(2337): btlogging setLevel
zyzniewski-reef Jan 20, 2025
2a148ab
Merge branch 'staging' into fix/2337-btlogging_setLevel
basfroman Jan 21, 2025
7ccb07d
Merge pull request #2588 from zyzniewski-reef/fix/2337-btlogging_setL…
zyzniewski-reef Jan 21, 2025
569d4be
fix(2188): don't allow uvicorn to reconfigure event_loop_policy
zyzniewski-reef Jan 21, 2025
733895c
perf: don't use 2 threads to start FastAPI server
zyzniewski-reef Jan 21, 2025
1b6c0e8
Merge pull request #2592 from zyzniewski-reef/perf/creating_fastapi_s…
thewhaleking Jan 21, 2025
20a8cdd
Merge branch 'staging' into fix
thewhaleking Jan 21, 2025
771bdcc
Merge branch 'staging' into fix/spelling
thewhaleking Jan 21, 2025
bc78bd6
Merge branch 'staging' into fix/2188-configure_uvicorn_event_loop
thewhaleking Jan 21, 2025
8db8d5a
Merge pull request #2591 from zyzniewski-reef/fix/2188-configure_uvic…
zyzniewski-reef Jan 21, 2025
48047c1
Merge branch 'staging' into fix/spelling
thewhaleking Jan 22, 2025
3562530
Merge branch 'staging' into fix
thewhaleking Jan 22, 2025
94749d2
Merge pull request #2586 from Dimitrolito/fix/spelling
thewhaleking Jan 22, 2025
12a7284
fix typo async_commit_reveal.py
Marcofann Jan 31, 2025
b8b8055
fix typo commit_reveal.py
Marcofann Jan 31, 2025
25259e9
fix typos weight_utils.py
Marcofann Jan 31, 2025
9b3d608
Update wallet creation commands
HudsonGraeme Jan 31, 2025
27eef20
Comment out invalid cli arguments
HudsonGraeme Jan 31, 2025
4d59acd
Update weight_utils.py
Marcofann Feb 1, 2025
4383a19
Merge branch 'staging' into fix/typos
Marcofann Feb 1, 2025
557219d
Bumps torch version
ibraheem-abe Feb 4, 2025
a4b3d5e
Updates artifacts version
ibraheem-abe Feb 4, 2025
a7819d1
Merge pull request #2623 from opentensor/bump/updates-torch
ibraheem-abe Feb 4, 2025
1a96aa9
Merge branch 'staging' into fix/typos
thewhaleking Feb 4, 2025
9919f6a
Merge pull request #2620 from Marcofann/fix/typos
thewhaleking Feb 4, 2025
c07ce1b
Merge branch 'staging' into master
HudsonGraeme Feb 4, 2025
229a11e
Merge pull request #2621 from inference-labs-inc/master
thewhaleking Feb 5, 2025
42032bc
Merge branch 'staging' into fix
basfroman Feb 6, 2025
0337f08
tests: fix e2e
zyzniewski-reef Feb 6, 2025
f424ef2
revert fast-blocks
zyzniewski-reef Feb 6, 2025
ca82491
revert timeout
zyzniewski-reef Feb 6, 2025
a327ac5
install lib in noneditable mode
zyzniewski-reef Feb 6, 2025
9138b6d
give more time to Validator to process
zyzniewski-reef Feb 6, 2025
f00dd0d
fix incentive e2e test
zyzniewski-reef Feb 6, 2025
b65f04c
update weights_set_rate_limit for fast-blocks
zyzniewski-reef Feb 7, 2025
9ba20f0
don't mess with cwd
zyzniewski-reef Feb 7, 2025
1f92ff0
Revert "don't mess with cwd"
zyzniewski-reef Feb 7, 2025
35f45d0
remove unneeded chain calls
zyzniewski-reef Feb 7, 2025
251e4e1
adjust wait_interval for fast-blocks
zyzniewski-reef Feb 7, 2025
584615f
Increase subnet tempo so we have enought time to commit and reveal we…
zyzniewski-reef Feb 7, 2025
fac0c66
improve test_dendrite
zyzniewski-reef Feb 7, 2025
990453d
fix integration tests
Feb 8, 2025
d9275ed
Merge pull request #2651 from opentensor/fix/roman/integration-tests
basfroman Feb 8, 2025
1e17e11
Moves the closing of the new event loop in Dendrite.query to the clos…
thewhaleking Feb 10, 2025
a4f3d12
Add logging.
thewhaleking Feb 10, 2025
c944235
Ruff
thewhaleking Feb 10, 2025
f16ebee
Merge pull request #2587 from crStiv/fix
thewhaleking Feb 10, 2025
9661a37
Merge pull request #2654 from opentensor/fix/thewhaleking/dendrite-lo…
thewhaleking Feb 10, 2025
2c7548d
Updates CRV3 e2e test
ibraheem-abe Feb 10, 2025
bb54c81
Trigger CI
zyzniewski-reef Feb 10, 2025
42755fb
style: ruff formatting
zyzniewski-reef Feb 10, 2025
83d483d
add type hint
zyzniewski-reef Feb 10, 2025
0a46cbd
Merge pull request #2639 from opentensor/tests/zyzniewski/fix_e2e
basfroman Feb 10, 2025
4d90b4b
move torch deps via setup.py
Feb 10, 2025
356c712
bumping version in prod
Feb 10, 2025
6d17860
Merge pull request #2655 from opentensor/feat/roman/deps
basfroman Feb 10, 2025
642c4ec
Merge branch 'staging-pre-merge-new-async' into merge/roman/async-pre…
Feb 10, 2025
098484f
update test_axon.py
Feb 10, 2025
50ea4ab
update subtensor branch
Feb 10, 2025
a13fed2
update subtensor branch
Feb 10, 2025
9cc5ce5
Merge remote-tracking branch 'origin/merge/roman/async-pre-merge-new-…
Feb 10, 2025
479ab0d
fix test
Feb 11, 2025
82e3734
increase waiting time
Feb 11, 2025
bc0a478
add name and symbol fields to metagraph
Feb 11, 2025
82ca010
Moves shared features to the Mixin, fixes AsyncSubtensor, changes `sy…
thewhaleking Feb 11, 2025
f58aad6
brings all fields from get_metagraph_info fields to the metagraph cla…
Feb 11, 2025
942f2b4
Add 0.018 as a constant
thewhaleking Feb 11, 2025
4f2b7f7
Merge pull request #2659 from opentensor/fix/thewhaleking/fix-async-t…
basfroman Feb 11, 2025
6f69f4a
tests: separate templates fixture
zyzniewski-reef Feb 11, 2025
ebac12e
Merge pull request #2658 from opentensor/feat/roman/add-a-few-fields-…
basfroman Feb 11, 2025
bbc30a0
Merge branch 'staging-pre-merge-new-async' into merge/roman/async-pre…
Feb 11, 2025
bd0f540
style: ruff formating
zyzniewski-reef Feb 11, 2025
90433a0
tests: use 9944 as a default port
zyzniewski-reef Feb 11, 2025
7d65400
using one determine_chain_endpoint_and_network
Feb 11, 2025
d8b7d70
remove unused import
Feb 11, 2025
bd52816
fix test
Feb 11, 2025
2983257
Merge pull request #2661 from opentensor/feat/roman/using-one-determi…
basfroman Feb 11, 2025
3d632d1
improve `install_templates` logic
Feb 11, 2025
fa2b9a8
Removes ownership check in stake_move
ibraheem-abe Feb 11, 2025
93b7b25
Merge branch 'staging-pre-merge-new-async' into tests/zyzniewski/e2e_…
Feb 11, 2025
9e4ce58
Remove ownership check from move_stake for async
ibraheem-abe Feb 11, 2025
0392627
Merge pull request #2660 from opentensor/tests/zyzniewski/e2e_templat…
basfroman Feb 11, 2025
5a203bb
Merge branch 'staging-pre-merge-new-async' into merge/roman/async-pre…
Feb 11, 2025
f4f84ad
not enough time to update chain state. increase time sleep
Feb 11, 2025
820b1e2
Merge pull request #2656 from opentensor/merge/roman/async-pre-merge-…
basfroman Feb 11, 2025
de42873
add sync extrinsic
Feb 12, 2025
e0b8f36
add sync subtensor extrinsic method
Feb 12, 2025
fc62baf
update easy imports (add chain_data classes)
Feb 12, 2025
58c2bc7
fix bugs with using `format_error_message`
Feb 12, 2025
9f907b6
remove redundant call
Feb 12, 2025
7105038
update sync extrinsic
Feb 12, 2025
6ee34dd
add async extrinsic
Feb 12, 2025
bc2a97d
fix docsting's complaince in IDE
Feb 12, 2025
63a9a0f
update import
Feb 12, 2025
386b19c
update docstring
Feb 12, 2025
19f53f0
ruff
Feb 12, 2025
50db030
add async subtensor extrinsic method
Feb 12, 2025
2b4714a
add sync subtensor extrinsic unit test
Feb 12, 2025
3aa0d78
add async subtensor extrinsic unit test
Feb 12, 2025
70b653d
add sync extrinsic unit test
Feb 12, 2025
8086324
add async extrinsic unit test
Feb 12, 2025
1fab7b0
add e2e test (happy pass, failed)
Feb 12, 2025
d244791
Merge pull request #2662 from opentensor/feat/roman/add-subnet-identi…
ibraheem-abe Feb 12, 2025
6c81621
Bumps version and updates changelog
ibraheem-abe Feb 12, 2025
f3099e6
Updates bittensor-cli version
ibraheem-abe Feb 12, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/e2e-subtensor-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:

- name: Setup subtensor repo
working-directory: ${{ github.workspace }}/subtensor
run: git checkout main
run: git checkout devnet-ready

- name: Run tests
run: |
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 9.0.0rc6 /2025-02-11
* Using one determine_chain_endpoint_and_network by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2661
* Tests: separate templates fixture by @zyzniewski-reef in https://github.com/opentensor/bittensor/pull/2660
* add name and symbol fields to metagraph by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2658
* Metagraph Improvements by @thewhaleking in https://github.com/opentensor/bittensor/pull/2659
* feat/roman/add-subnet-identity-with-subnet-creation by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2662

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v9.0.0rc5...v9.0.0rc6

## 9.0.0rc5 /2025-02-07
* Fix InfoBase + dataclasses @roman-opentensor in https://github.com/opentensor/bittensor/pull/2649

Expand Down Expand Up @@ -38,6 +47,25 @@

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v8.5.1...v9.0.0rc1

## 8.5.2 /2025-01-17

## What's Changed
* Feat/use tx pool for set weights by @camfairchild in https://github.com/opentensor/bittensor/pull/2534
* fix get_delegates result decoding by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2551
* [SDK] Handle server connection limit by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2553
* Backmerge master to staging post 851 by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/2557
* [SDK] Improve InvalidStatus handler by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2558
* [SDK] Add async version of commit reveal v3 by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2560
* Use apt-get instead of apt for scripts by @camfairchild in https://github.com/opentensor/bittensor/pull/2571
* fix _do_stake incorrect arguments error in staking.py by @Assh-codes in https://github.com/opentensor/bittensor/pull/2574
* Updates tests for btwallet 3.0.0 by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/2540
* Bumps cr3 FFI by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/2583

## New Contributors
* @Assh-codes made their first contribution in https://github.com/opentensor/bittensor/pull/2574

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v8.5.1...v8.5.2

## 8.5.1 /2024-12-16

## What's Changed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.0rc5
9.0.0rc6
44 changes: 42 additions & 2 deletions bittensor/core/async_subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
NeuronInfo,
ProposalVoteData,
SubnetHyperparameters,
SubnetIdentity,
SubnetInfo,
WeightCommitInfo,
decode_account_id,
Expand All @@ -34,6 +35,7 @@
burned_register_extrinsic,
register_extrinsic,
register_subnet_extrinsic,
set_subnet_identity_extrinsic,
)
from bittensor.core.extrinsics.asyncex.move_stake import (
transfer_stake_extrinsic,
Expand Down Expand Up @@ -2581,8 +2583,8 @@ async def wait_for_block(self, block: Optional[int] = None):
bool: True if the target block was reached, False if timeout occurred.

Example:
>>> await subtensor.wait_for_block() # Waits for next block
>>> await subtensor.wait_for_block(block=1234) # Waits for specific block
await subtensor.wait_for_block() # Waits for next block
await subtensor.wait_for_block(block=1234) # Waits for specific block
"""

async def handler(block_data: dict):
Expand Down Expand Up @@ -3188,6 +3190,44 @@ async def root_set_weights(
wait_for_inclusion=wait_for_inclusion,
)

async def set_subnet_identity(
self,
wallet: "Wallet",
netuid: int,
subnet_identity: SubnetIdentity,
wait_for_inclusion: bool = False,
wait_for_finalization: bool = True,
) -> tuple[bool, str]:
"""
Sets the identity of a subnet for a specific wallet and network.

Arguments:
wallet (Wallet): The wallet instance that will authorize the transaction.
netuid (int): The unique ID of the network on which the operation takes place.
subnet_identity (SubnetIdentity): The identity data of the subnet including attributes like name, GitHub
repository, contact, URL, discord, description, and any additional metadata.
wait_for_inclusion (bool): Indicates if the function should wait for the transaction to be included in the block.
wait_for_finalization (bool): Indicates if the function should wait for the transaction to reach finalization.

Returns:
tuple[bool, str]: A tuple where the first element is a boolean indicating success or failure of the
operation, and the second element is a message providing additional information.
"""
return await set_subnet_identity_extrinsic(
subtensor=self,
wallet=wallet,
netuid=netuid,
subnet_name=subnet_identity.subnet_name,
github_repo=subnet_identity.github_repo,
subnet_contact=subnet_identity.subnet_contact,
subnet_url=subnet_identity.subnet_url,
discord=subnet_identity.discord,
description=subnet_identity.description,
additional=subnet_identity.additional,
wait_for_inclusion=wait_for_inclusion,
wait_for_finalization=wait_for_finalization,
)

async def set_weights(
self,
wallet: "Wallet",
Expand Down
18 changes: 14 additions & 4 deletions bittensor/core/dendrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,18 @@ async def session(self) -> aiohttp.ClientSession:
self._session = aiohttp.ClientSession()
return self._session

def close_session(self):
def close_session(self, using_new_loop: bool = False):
"""
Closes the internal `aiohttp <https://github.com/aio-libs/aiohttp>`_ client session synchronously.

This method ensures the proper closure and cleanup of the aiohttp client session, releasing any
resources like open connections and internal buffers. It is crucial for preventing resource leakage
and should be called when the dendrite instance is no longer in use, especially in synchronous contexts.

Arguments:
using_new_loop: A flag to determine whether this has been called with a new event loop rather than
the default. This will indicate whether to close this event loop at the end of this call.

Note:
This method utilizes asyncio's event loop to close the session asynchronously from a synchronous context.
It is advisable to use this method only when asynchronous context management is not feasible.
Expand All @@ -188,6 +192,8 @@ def close_session(self):
if self._session:
loop = asyncio.get_event_loop()
loop.run_until_complete(self._session.close())
if using_new_loop:
loop.close()
self._session = None

async def aclose_session(self):
Expand Down Expand Up @@ -374,16 +380,20 @@ def query(
category=DeprecationWarning,
)
result = None
use_new_loop = False
try:
loop = asyncio.get_event_loop()
result = loop.run_until_complete(self.forward(*args, **kwargs))
except Exception:
except Exception as e:
logging.debug(
f"Exception encountered while running Dendrite.query initially: {e}"
)
new_loop = asyncio.new_event_loop()
asyncio.set_event_loop(new_loop)
result = new_loop.run_until_complete(self.forward(*args, **kwargs))
new_loop.close()
use_new_loop = True
finally:
self.close_session()
self.close_session(using_new_loop=use_new_loop)
return result # type: ignore

async def forward(
Expand Down
8 changes: 0 additions & 8 deletions bittensor/core/extrinsics/asyncex/move_stake.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,6 @@ async def move_stake_extrinsic(
bool: True if the move was successful, False otherwise.
"""
amount.set_unit(netuid=origin_netuid)
# Verify ownership of origin hotkey
origin_owner = await subtensor.get_hotkey_owner(origin_hotkey)
if origin_owner != wallet.coldkeypub.ss58_address:
logging.error(
f":cross_mark: [red]Failed[/red]: Origin hotkey: {origin_hotkey} does not belong to the coldkey owner: "
f"{wallet.coldkeypub.ss58_address}"
)
return False

# Check sufficient stake
stake_in_origin, stake_in_destination = await _get_stake_in_origin_and_dest(
Expand Down
82 changes: 80 additions & 2 deletions bittensor/core/extrinsics/asyncex/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,92 @@ async def register_subnet_extrinsic(
if not wait_for_finalization and not wait_for_inclusion:
return True

await response.process_events()
if not await response.is_success:
logging.error(
f"Failed to register subnet: {format_error_message(await response.error_message, subtensor.substrate)}"
f"Failed to register subnet: {format_error_message(await response.error_message)}"
)
return False

logging.success(
":white_heavy_check_mark: [green]Successfully registered subnet[/green]"
)
return True


async def set_subnet_identity_extrinsic(
subtensor: "AsyncSubtensor",
wallet: "Wallet",
netuid: int,
subnet_name: str,
github_repo: str,
subnet_contact: str,
subnet_url: str,
discord: str,
description: str,
additional: str,
wait_for_inclusion: bool = False,
wait_for_finalization: bool = True,
) -> tuple[bool, str]:
"""
Set the identity information for a given subnet.

Arguments:
subtensor (AsyncSubtensor): An instance of the Subtensor class to interact with the blockchain.
wallet (Wallet): A wallet instance used to sign and submit the extrinsic.
netuid (int): The unique ID for the subnet.
subnet_name (str): The name of the subnet to assign the identity information.
github_repo (str): URL of the GitHub repository related to the subnet.
subnet_contact (str): Subnet's contact information, e.g., email or contact link.
subnet_url (str): The URL of the subnet's primary web portal.
discord (str): Discord server or contact for the subnet.
description (str): A textual description of the subnet.
additional (str): Any additional metadata or information related to the subnet.
wait_for_inclusion (bool): Whether to wait for the extrinsic inclusion in a block (default: False).
wait_for_finalization (bool): Whether to wait for the extrinsic finalization in a block (default: True).

Returns:
tuple[bool, str]: A tuple where the first element indicates success or failure (True/False), and the second
element contains a descriptive message.
"""

if not (unlock := unlock_key(wallet)).success:
logging.error(unlock.message)
return False, unlock.message

call = await subtensor.substrate.compose_call(
call_module="SubtensorModule",
call_function="set_subnet_identity",
call_params={
"hotkey": wallet.hotkey.ss58_address,
"netuid": netuid,
"subnet_name": subnet_name,
"github_repo": github_repo,
"subnet_contact": subnet_contact,
"subnet_url": subnet_url,
"discord": discord,
"description": description,
"additional": additional,
},
)

response = await subtensor.substrate.submit_extrinsic(
call=call,
wallet=wallet,
wait_for_inclusion=wait_for_inclusion,
wait_for_finalization=wait_for_finalization,
)

if not wait_for_finalization and not wait_for_inclusion:
return True, f"Identities for subnet {netuid} are sent to the chain."

if await response.is_success:
logging.success(
f":white_heavy_check_mark: [green]Identities for subnet[/green] [blue]{netuid}[/blue] [green]are set.[/green]"
)
return True, f"Identities for subnet {netuid} are set."
else:
error_message = await response.error_message
logging.error(
f":cross_mark: Failed to set identity for subnet [blue]{netuid}[/blue]: {error_message}"
)
return False, f"Failed to set identity for subnet {netuid}: {error_message}"
7 changes: 0 additions & 7 deletions bittensor/core/extrinsics/move_stake.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,6 @@ def move_stake_extrinsic(
"""

amount.set_unit(netuid=origin_netuid)
# Verify ownership of origin hotkey
origin_owner = subtensor.get_hotkey_owner(origin_hotkey)
if origin_owner != wallet.coldkeypub.ss58_address:
logging.error(
f":cross_mark: [red]Failed[/red]: Origin hotkey: {origin_hotkey} does not belong to the coldkey owner: {wallet.coldkeypub.ss58_address}"
)
return False

# Check sufficient stake
stake_in_origin, stake_in_destination = _get_stake_in_origin_and_dest(
Expand Down
78 changes: 78 additions & 0 deletions bittensor/core/extrinsics/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,81 @@ def register_extrinsic(
# Failed to register after max attempts.
logging.error("[red]No more attempts.[/red]")
return False


def set_subnet_identity_extrinsic(
subtensor: "Subtensor",
wallet: "Wallet",
netuid: int,
subnet_name: str,
github_repo: str,
subnet_contact: str,
subnet_url: str,
discord: str,
description: str,
additional: str,
wait_for_inclusion: bool = False,
wait_for_finalization: bool = True,
) -> tuple[bool, str]:
"""
Set the identity information for a given subnet.

Arguments:
subtensor (Subtensor): An instance of the Subtensor class to interact with the blockchain.
wallet (Wallet): A wallet instance used to sign and submit the extrinsic.
netuid (int): The unique ID for the subnet.
subnet_name (str): The name of the subnet to assign the identity information.
github_repo (str): URL of the GitHub repository related to the subnet.
subnet_contact (str): Subnet's contact information, e.g., email or contact link.
subnet_url (str): The URL of the subnet's primary web portal.
discord (str): Discord server or contact for the subnet.
description (str): A textual description of the subnet.
additional (str): Any additional metadata or information related to the subnet.
wait_for_inclusion (bool): Whether to wait for the extrinsic inclusion in a block (default: False).
wait_for_finalization (bool): Whether to wait for the extrinsic finalization in a block (default: True).

Returns:
tuple[bool, str]: A tuple where the first element indicates success or failure (True/False), and the second
element contains a descriptive message.
"""

if not (unlock := unlock_key(wallet)).success:
logging.error(unlock.message)
return False, unlock.message

call = subtensor.substrate.compose_call(
call_module="SubtensorModule",
call_function="set_subnet_identity",
call_params={
"hotkey": wallet.hotkey.ss58_address,
"netuid": netuid,
"subnet_name": subnet_name,
"github_repo": github_repo,
"subnet_contact": subnet_contact,
"subnet_url": subnet_url,
"discord": discord,
"description": description,
"additional": additional,
},
)

success, message = subtensor.sign_and_send_extrinsic(
call=call,
wallet=wallet,
wait_for_inclusion=wait_for_inclusion,
wait_for_finalization=wait_for_finalization,
)

if not wait_for_finalization and not wait_for_inclusion:
return True, f"Identities for subnet {netuid} are sent to the chain."

if success:
logging.success(
f":white_heavy_check_mark: [green]Identities for subnet[/green] [blue]{netuid}[/blue] [green]are set.[/green]"
)
return True, f"Identities for subnet {netuid} are set."
else:
logging.error(
f":cross_mark: Failed to set identity for subnet [blue]{netuid}[/blue]: {message}"
)
return False, f"Failed to set identity for subnet {netuid}: {message}"
Loading
Loading