bittensor.extrinsics.serving#

Module Contents#

Functions#

serve_extrinsic(subtensor, wallet, ip, port, protocol, ...)

Subscribes an bittensor endpoint to the substensor chain.

serve_axon_extrinsic(subtensor, netuid, axon[, ...])

Serves the axon to the network.

bittensor.extrinsics.serving.serve_extrinsic(subtensor, wallet, ip, port, protocol, netuid, placeholder1=0, placeholder2=0, wait_for_inclusion=False, wait_for_finalization=True, prompt=False)#

Subscribes an bittensor endpoint to the substensor chain. :param wallet: bittensor wallet object. :type wallet: bittensor.wallet :param ip: endpoint host port i.e. 192.122.31.4 :type ip: str :param port: endpoint port number i.e. 9221 :type port: int :param protocol: int representation of the protocol :type protocol: int :param netuid: network uid to serve on. :type netuid: int :param placeholder1: placeholder for future use. :type placeholder1: int :param placeholder2: placeholder for future use. :type placeholder2: int :param wait_for_inclusion: 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.

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

  • wallet (bittensor.wallet) –

  • ip (str) –

  • port (int) –

  • protocol (int) –

  • netuid (int) –

  • placeholder1 (int) –

  • placeholder2 (int) –

  • wait_for_inclusion (bool) –

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.extrinsics.serving.serve_axon_extrinsic(subtensor, netuid, axon, wait_for_inclusion=False, wait_for_finalization=True, prompt=False)#

Serves the axon to the network. :param netuid: The netuid being served on. :type netuid: int :param axon: Axon to serve. :type axon: bittensor.Axon :param wait_for_inclusion: 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.

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

  • netuid (int) –

  • axon (bittensor.Axon) –

  • wait_for_inclusion (bool) –

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)