bittensor.core.extrinsics.registration#

This module provides functionalities for registering a wallet with the subtensor network using Proof-of-Work (PoW).

Extrinsics: - register_extrinsic: Registers the wallet to the subnet. - burned_register_extrinsic: Registers the wallet to chain by recycling TAO.

Functions#

burned_register_extrinsic(subtensor, wallet, netuid[, ...])

Registers the wallet to chain by recycling TAO.

register_extrinsic(subtensor, wallet, netuid[, ...])

Registers the wallet to the chain.

register_subnet_extrinsic(subtensor, wallet[, ...])

Registers a new subnetwork on the Bittensor blockchain.

set_subnet_identity_extrinsic(subtensor, wallet, ...)

Set the identity information for a given subnet.

Module Contents#

bittensor.core.extrinsics.registration.burned_register_extrinsic(subtensor, wallet, netuid, wait_for_inclusion=False, wait_for_finalization=True)#

Registers the wallet to chain by recycling TAO.

Parameters:
  • subtensor (bittensor.core.subtensor.Subtensor) – Subtensor instance.

  • wallet (bittensor.wallet) – Bittensor wallet object.

  • netuid (int) – The netuid of the subnet to register on.

  • wait_for_inclusion (bool) – If set, waits for the extrinsic to enter a block before returning True, or returns False if the extrinsic fails to enter the block within the timeout.

  • wait_for_finalization (bool) – If set, waits for the extrinsic to be finalized on the chain before returning True, or returns False if the extrinsic fails to be finalized within the timeout.

Returns:

Flag is True if extrinsic was finalized or included in the block. If we did not wait for

finalization / inclusion, the response is True.

Return type:

success (bool)

bittensor.core.extrinsics.registration.register_extrinsic(subtensor, wallet, netuid, wait_for_inclusion=False, wait_for_finalization=True, max_allowed_attempts=3, output_in_place=True, cuda=False, dev_id=0, tpb=256, num_processes=None, update_interval=None, log_verbose=False)#

Registers the wallet to the chain.

Parameters:
  • subtensor (bittensor.core.subtensor.Subtensor) – Subtensor object to use for chain interactions

  • wallet (bittensor_wallet.Wallet) – Bittensor wallet object.

  • netuid (int) – The netuid of the subnet to register on.

  • wait_for_inclusion (bool) – If set, waits for the extrinsic to enter a block before returning True, or returns False if the extrinsic fails to enter the block within the timeout.

  • wait_for_finalization (bool) – If set, waits for the extrinsic to be finalized on the chain before returning True, or returns False if the extrinsic fails to be finalized within the timeout.

  • max_allowed_attempts (int) – Maximum number of attempts to register the wallet.

  • output_in_place (bool) – Whether the POW solving should be outputted to the console as it goes along.

  • cuda (bool) – If True, the wallet should be registered using CUDA device(s).

  • dev_id (Union[list[int], int]) – The CUDA device id to use, or a list of device ids.

  • tpb (int) – The number of threads per block (CUDA).

  • num_processes (Optional[int]) – The number of processes to use to register.

  • update_interval (Optional[int]) – The number of nonces to solve between updates.

  • log_verbose (bool) – If True, the registration process will log more information.

Returns:

True if extrinsic was finalized or included in the block. If we did not wait for finalization/inclusion, the

response is True.

Return type:

bool

bittensor.core.extrinsics.registration.register_subnet_extrinsic(subtensor, wallet, wait_for_inclusion=False, wait_for_finalization=True)#

Registers a new subnetwork on the Bittensor blockchain.

Parameters:
  • subtensor (Subtensor) – The subtensor interface to send the extrinsic.

  • wallet (Wallet) – The wallet to be used for subnet registration.

  • wait_for_inclusion (bool) – If set, waits for the extrinsic to enter a block before returning true.

  • wait_for_finalization (bool) – If set, waits for the extrinsic to be finalized on the chain before returning true.

Returns:

True if the subnet registration was successful, False otherwise.

Return type:

bool

bittensor.core.extrinsics.registration.set_subnet_identity_extrinsic(subtensor, wallet, netuid, subnet_name, github_repo, subnet_contact, subnet_url, discord, description, additional, wait_for_inclusion=False, wait_for_finalization=True)#

Set the identity information for a given subnet.

Parameters:
  • 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:

A tuple where the first element indicates success or failure (True/False), and the second

element contains a descriptive message.

Return type:

tuple[bool, str]