bittensor.extrinsics.network#

Functions#

_find_event_attributes_in_extrinsic_receipt(response, ...)

Searches for the attributes of a specified event within an extrinsic receipt.

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

Registers a new subnetwork.

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

Sets a hyperparameter for a specific subnetwork.

Module Contents#

bittensor.extrinsics.network._find_event_attributes_in_extrinsic_receipt(response, event_name)[source]#

Searches for the attributes of a specified event within an extrinsic receipt.

Parameters:
  • response (substrateinterface.base.ExtrinsicReceipt) – The receipt of the extrinsic to be searched.

  • event_name (str) – The name of the event to search for.

Returns:

A list of attributes for the specified event. Returns [-1] if the event is not found.

Return type:

list

bittensor.extrinsics.network.register_subnetwork_extrinsic(subtensor, wallet, wait_for_inclusion=False, wait_for_finalization=True, prompt=False)[source]#

Registers a new subnetwork.

Parameters:
  • wallet (bittensor.wallet) – bittensor wallet object.

  • 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.

  • prompt (bool) – If true, the call waits for confirmation from the user before proceeding.

  • subtensor (bittensor.subtensor)

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.extrinsics.network.set_hyperparameter_extrinsic(subtensor, wallet, netuid, parameter, value, wait_for_inclusion=False, wait_for_finalization=True, prompt=False)[source]#

Sets a hyperparameter for a specific subnetwork.

Parameters:
  • wallet (bittensor.wallet) – bittensor wallet object.

  • netuid (int) – Subnetwork uid.

  • parameter (str) – Hyperparameter name.

  • value (any) – New hyperparameter value.

  • 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.

  • prompt (bool) – If true, the call waits for confirmation from the user before proceeding.

  • subtensor (bittensor.subtensor)

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)