Transactions
serve-prometheus
Publish this hotkey's prometheus metrics endpoint (ip:port) for a subnet.
Advertises where this neuron's prometheus metrics can be scraped, separate
from the axon endpoint used for inter-neuron traffic. Signed by the hotkey,
which must be registered on the subnet, and subject to the same serving
rate limit as serve_axon. Like the axon calls, this only writes chain
data — running the metrics server is up to the caller.
| Signer | Pallet | Wraps |
|---|---|---|
hotkey | SubtensorModule | SubtensorModule.serve_prometheus |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
netuid | integer | yes | Subnet on which to publish the endpoint. |
ip | string | yes | Public IPv4 or IPv6 address of the endpoint, in standard dotted or colon notation. |
port | integer | yes | TCP port the endpoint listens on. |
version | integer | no | Version number of the serving neuron's software, stored with the endpoint. |
Address parameters (--hotkey, --coldkey, --dest, ...) accept a raw ss58
address, an address-book or proxy-book name, or a local wallet/hotkey name.
CLI
Preview with --dry-run (shows fee, effects, and policy result without
submitting), then submit:
btcli tx serve-prometheus \
--netuid <int> \
--ip <value> \
--port <int> --dry-run
btcli tx serve-prometheus \
--netuid <int> \
--ip <value> \
--port <int> -w my_coldkeyPython
import bittensor as sub
from bittensor.wallet import Wallet
wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.ServePrometheus(netuid=1, ip="...", port=0)
async with sub.Client("finney") as client:
plan = await client.plan(intent, wallet) # fee, effects, policy — no submission
result = await client.execute(intent, wallet)
if not result.success:
print(result.error.code, result.error.remediation)Or build it by op name, as an agent would:
await client.execute_tool("serve_prometheus", {...}, wallet)