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.

Attributes#

Functions#

_do_burned_register(self, netuid, wallet[, ...])

Performs a burned register extrinsic call to the Subtensor chain.

_do_pow_register(self, netuid, wallet, pow_result[, ...])

Sends a (POW) register extrinsic to the chain.

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.

Module Contents#

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

Performs a burned register extrinsic call to the Subtensor chain.

This method sends a registration transaction to the Subtensor blockchain using the burned register mechanism.

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

  • netuid (int) – The network unique identifier to register on.

  • wallet (bittensor_wallet.Wallet) – The wallet to be registered.

  • wait_for_inclusion (bool) – Whether to wait for the transaction to be included in a block. Default is False.

  • wait_for_finalization (bool) – Whether to wait for the transaction to be finalized. Default is True.

Returns:

A tuple containing a boolean indicating success or failure, and an optional error message.

Return type:

Tuple[bool, Optional[str]]

bittensor.core.extrinsics.registration._do_pow_register(self, netuid, wallet, pow_result, wait_for_inclusion=False, wait_for_finalization=True)#

Sends a (POW) register extrinsic to the chain.

Parameters:
  • self (bittensor.core.subtensor.Subtensor) – The subtensor to send the extrinsic to.

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

  • wallet (bittensor.wallet) – The wallet to register.

  • pow_result (POWSolution) – The PoW result to register.

  • wait_for_inclusion (bool) – If True, waits for the extrinsic to be included in a block. Default to False.

  • wait_for_finalization (bool) – If True, waits for the extrinsic to be finalized. Default to True.

Returns:

True if the extrinsic was included in a block. error (Optional[str]): None on success or not waiting for inclusion/finalization, otherwise the error message.

Return type:

success (bool)

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 uncluded 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 interface.

  • 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) – If true, prints the progress of the proof of work to the console in-place. Meaning the progress is printed on the same lines. Defaults to True.

  • 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 (int) – The number of processes to use to register.

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

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

Returns:

Flag is true if extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is true.

Return type:

success (bool)

bittensor.core.extrinsics.registration.torch#