Testnet Tensor
  • Introduction
  • Explorer
  • GPT
  • DSN Dashboard
  • Create Account
    • Wallet
    • CLI
    • Faucet
  • Hypertensor CLI
    • Hypertensor CLI
  • Run A Subnet Node
    • Getting Started
    • Wiki
      • Running on AMD GPU
      • Running on Windows Using WSL
      • Troubleshooting
    • Generate Keypair
    • Register & Stake
    • Add
    • Start Validator Node
    • Start Bootstrap Node
    • Activate
    • Update Delegate Reward Rate
    • Deactivate
    • Remove
    • Keys
  • Delegate Staking
    • Introduction
    • Add Delegate Stake
    • Transfer Delegate Stake
    • Remove Delegate Stake
    • Claim Delegate Stake
  • Node Delegate Staking
    • Introduction
    • Add Node Delegate Stake
    • Transfer Node Delegate Stake
    • Remove Node Delegate Stake
    • Claim Node Delegate Stake
  • Delegate Staking Utils
    • Introduction
    • Subnet to Node
    • Node to Subnet
  • Build a Subnet
    • Introduction
    • DSN Standard
    • Subnet Consensus Protocol (SCP)
      • Incentives
      • Accounting
      • Proposals
    • Subnet
      • Registration
      • Activation
      • Deactivation
    • Subnet Nodes
      • Registration
      • Activation
      • Deactivate
  • Contribute
Powered by GitBook
On this page
  1. Build a Subnet
  2. Subnet Nodes

Activation

Every subnet must have a way for subnet nodes to activate on-chain using the Hypertensor extrinsic:

pub fn activate_subnet_node(
    origin: OriginFor<T>, 
    subnet_id: u32, 
)

For example, in the Hypertensor DSN standard, once a node is authenticated into the subnet by other peers and has done its required computations, such as loading the model transformer blocks, the node is then expected to activate itself using the CLI within the subnet.

For example, in Python:

def activate_subnet_node(
  substrate: SubstrateInterface,
  keypair: Keypair,
  subnet_id: int,
) -> ExtrinsicReceipt:
  call = substrate.compose_call(
    call_module='Network',
    call_function='activate_subnet_node',
    call_params={
      'subnet_id': subnet_id,
    }
  )

  extrinsic = substrate.create_signed_extrinsic(call=call, keypair=keypair)

  @retry(wait=wait_exponential(multiplier=1, min=4, max=10), stop=stop_after_attempt(4))
  def submit_extrinsic():
    try:
      receipt = substrate.submit_extrinsic(extrinsic, wait_for_inclusion=True)
      return receipt
    except SubstrateRequestException as e:
      print("Failed to send: {}".format(e))

  return submit_extrinsic()
PreviousRegistrationNextDeactivate

Last updated 2 months ago