serve_axon

Call v101 → 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

Input Parameters

#NameTypeDescription
0
netuid
u16 Subnet/network identifier (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
Unknown
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 { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Build serve_axon call
const netuid = 1;
const version = 0;
const ip = 0;
const port = 0;
const ip_type = 0;
const protocol = 0;
const placeholder1 = 0;
const placeholder2 = 0;

const call = api.tx[stringCamelCase("SubtensorModule")][stringCamelCase("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

Runtime Info

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