serve_axon

Call v101 → v277, v290 → current #4

Registers axon server endpoint for a neuron .

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: minersvalidatorsdevelopers

The Big Picture

Your axon is your miner's public API. Validators need to know where to send queries, and this call publishes that address on-chain. Without a served axon, validators can't reach you, and you can't earn.

Why This Matters

Registration gets you a UID. Serving your axon tells the network where to find you. Both are required to actually receive queries and earn emissions.

Example Scenario

Your miner runs at 203.0.113.50:8091. After registering on subnet 1, call serve_axon(netuid=1, ip=203.0.113.50, port=8091). Now validators can discover and query your miner.

Common Questions

Do I need to update my axon if my IP changes?
Yes! If validators can't reach you, you get zero scores. Serve again with your new IP.
What about firewalls?
Ensure your axon port is publicly accessible. The chain just stores the address - you're responsible for actually being reachable.

Use Cases

  • Publish your miner's API endpoint
  • Update your endpoint after IP change
  • Make your neuron discoverable for queries

From Chain Metadata

Serves or updates axon /prometheus information for the neuron associated with the caller. If the caller is already registered the metadata is updated. If the caller is not registered this call throws NotRegistered.

Input Parameters

#NameTypeDescription
0
netuid
u16 NetUidnetuid: Subnet ID (u16, 0-65535)
1
version
u32 version (u32)
2
ip
u128 ip (u128)
3
port
u16 port (u16)
4
ip_type
u8 ip_type (u8)
5
protocol
u8 protocol (u8)
6
placeholder1
u8 placeholder1 (u8)
7
placeholder2
u8 placeholder2 (u8)

Permissions

Origin
Signed
Required Role
Authorization Checks
  • Hotkey must be registered on the target subnet

Requirements

  • Caller is registered on subnet
  • Valid IP/port provided
  • Serving not rate limited

Effects

Events Emitted

Storage Modified

Postconditions

  • Axon endpoint stored

Side Effects

  • Other neurons can discover endpoint
  • Validators can send requests

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build serve_axon call (typed, named args)
const netuid = 1;
const version = 0;
const ip = 0n;
const port = 0;
const ip_type = 0;
const protocol = 0;
const placeholder1 = 0;
const placeholder2 = 0;

const tx = api.tx.SubtensorModule.serve_axon({
  netuid,
  version,
  ip,
  port,
  ip_type,
  protocol,
  placeholder1,
  placeholder2,
});

On-Chain Activity

Usage Frequency
●●●●●● Dominant >10M extrinsics

Highest-volume operations

#3 most used call

Success Rate Competitive

5–20% of submissions succeed — expect frequent failures

As of block 7,429,232

Version History

v101 block 1 8 args
v290 block 5,947,548 8 args Current

Runtime Info

View Source
Pallet Index
7
Call Index
4
First Version
v101
Current Version
v411