bittensor.subnets#

Classes#

SubnetsAPI

Helper class that provides a standard way to create an ABC using

Module Contents#

class bittensor.subnets.SubnetsAPI(wallet)[source]#

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

Parameters:

wallet (bittensor.wallet)

wallet#
dendrite#
async __call__(*args, **kwargs)[source]#
abstract prepare_synapse(*args, **kwargs)[source]#

Prepare the synapse-specific payload.

Return type:

Any

abstract process_responses(responses)[source]#

Process the responses from the network.

Parameters:

responses (List[Union[bittensor.Synapse, Any]])

Return type:

Any

async query_api(axons, deserialize=False, timeout=12, **kwargs)[source]#

Queries the API nodes of a subnet using the given synapse and bespoke query function.

Parameters:
  • axons (Union[bt.axon, List[bt.axon]]) – The list of axon(s) to query.

  • deserialize (bool, optional) – Whether to deserialize the responses. Defaults to False.

  • timeout (int, optional) – The timeout in seconds for the query. Defaults to 12.

  • **kwargs – Keyword arguments for the prepare_synapse_fn.

Returns:

The result of the process_responses_fn.

Return type:

Any