NAV
Python

Tensorplex Kami v1.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Ultra-light server library written in TypeScript for interacting with the Bittensor chain.

Example code samples provided work with the Kami boilerplate Python code in the repo here.

You may also test out the endpoints through Swagger UI once the Kami instance is running locally.

Base URLs:

Web: Tensorplex Labs

substrate

getAvailableRuntimeApis

Code samples

from kami import Kami
from dotenv import load_dotenv
async def main():
    load_dotenv()
    kami = Kami()

    available_runtime_api = await kami.get_available_runtime_api()
    print("Available runtime definitions and methods:")
    for runtime in available_runtime_api:
        runtime_name = runtime['name']
        print(f"\n📦 {runtime_name}")
        for method in runtime['methods']:
            method_name = method['name']
            print(f"  ├─ {method_name}")

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

GET /substrate/available-runtime-apis

Get available runtime APIs

Retrieves all available runtime APIs

Responses

Status Meaning Description Schema
200 OK Available runtime APIs retrieved successfully None

getKeyringPairInfo

Code samples

from kami import Kami
from dotenv import load_dotenv
async def main():
    load_dotenv()
    kami = Kami()

    keyring_pair_info = await kami.get_keyring_pair_info()
    print(f"Coldkey SS58 address: {keyring_pair_info.walletColdkey}")
    print(f"Hotkey SS58 address: {keyring_pair_info.keyringPair.address}")

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

GET /substrate/keyring-pair-info

Get keyring pair info

Retrieves the current keyring pair information

Example responses

200 Response

{
  "statusCode": 200,
  "success": true,
  "data": {
    "keyringPair": {
      "address": "5E4z3h9yVhmQyCFWNbY9BPpwhx4xFiPwq3eeqmBgVF6KULde",
      "addressRaw": {},
      "isLocked": true,
      "meta": [
        "string"
      ],
      "publicKey": {},
      "type": "sr25519"
    },
    "walletColdkey": "5DSsZGwBuYHRDA7HzdZUVBhKKpZpJKcf7rTd9y5Gz1SQyo9V"
  },
  "error": null
}

Responses

Status Meaning Description Schema
200 OK Keyring pair info retrieved successfully Inline

Response Schema

getLatestBlock

Code samples

from kami import Kami
from dotenv import load_dotenv
async def main():
    load_dotenv()
    kami = Kami()

    block = await kami.get_current_block()
    print(f"Latest Block: {block}")

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

GET /chain/latest-block

Get latest block

Retrieves the latest block from the blockchain

Example responses

200 Response

{
  "statusCode": 200,
  "success": true,
  "data": {
    "parentHash": "0x56a255a1ed8eb98fde76ba92692f1272197464fe40b4bc938f9cc3ae3dea9bb7",
    "blockNumber": 42069,
    "stateRoot": "0xc95e11b40425b3c3bd6302eba0ffa32e572102d287fc4cf7ebe6a38a950ddc89",
    "extrinsicsRoot": "0xe846ab1234bd62370a6b4197c3bedd1a9f0b29920b54756154ec53db4cd494fe"
  },
  "error": null
}

Responses

Status Meaning Description Schema
200 OK Latest block retrieved successfully Inline

Response Schema

getAccountNonce

Code samples

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('http://localhost:8882/substrate/account-nonce/{account}', headers = headers)

print(r.json())

GET /substrate/account-nonce/{account}

Get the nonce of an account

Get the nonce of an account

Parameters

Name In Type Required Description
account path string true SS58 Address

Example responses

200 Response

{
  "statusCode": 200,
  "success": true,
  "data": {
    "accountNonce": 1
  },
  "error": null
}

Responses

Status Meaning Description Schema
200 OK Successfully checked hotkey on metagraph Inline

Response Schema

signMessage

Code samples

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('http://localhost:8882/substrate/sign-message/sign', headers = headers)

print(r.json())

POST /substrate/sign-message/sign

Sign a message.

Sign a message with a keyring pair.

Body parameter

{
  "message": "string"
}

Parameters

Name In Type Required Description
body body SignMessageParamDto true none

Example responses

200 Response

{
  "statusCode": 200,
  "success": true,
  "data": {
    "signature": "string"
  },
  "error": null
}

Responses

Status Meaning Description Schema
200 OK Message signed successfully. Inline

Response Schema

verifyMessage

Code samples

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('http://localhost:8882/substrate/sign-message/verify', headers = headers)

print(r.json())

POST /substrate/sign-message/verify

Verify a signature.

Verify a signature with a keyring pair.

Body parameter

{
  "message": "string",
  "signature": "string",
  "signeeAddress": "string"
}

Parameters

Name In Type Required Description
body body VerifyMessageParamDto true none

Example responses

200 Response

{
  "statusCode": 200,
  "success": true,
  "data": {
    "valid": "boolean"
  },
  "error": null
}

Responses

Status Meaning Description Schema
200 OK Signature verified successfully. Inline

Response Schema

subnet

getSubnetMetagraph

Code samples

from kami import Kami
from dotenv import load_dotenv
import os
async def main():
    load_dotenv()
    kami = Kami()
    netuid = os.getenv("NETUID")

    metagraph = await kami.get_metagraph(netuid)
    print(f"Number of registered Coldkeys: {len(metagraph.coldkeys)}")
    print(f"Number of registered Hotkeys: {len(metagraph.hotkeys)}")

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

GET /chain/subnet-metagraph/{netuid}

Get subnet metagraph

Retrieves all subnet metagraph information by netuid

Parameters

Name In Type Required Description
netuid path number true Network UID

Example responses

200 Response

{
  "statusCode": 200,
  "success": true,
  "data": {
    "netuid": 1,
    "name": "Tensorplex Dojo",
    "symbol": "ا",
    "identity": {
      "subnetName": "Dojo",
      "githubRepo": "https://github.com/tensorplex-labs/dojo",
      "subnetContact": "jarvis@tensorplex.ai",
      "subnetUrl": "https://dojo.network",
      "discord": "https://discord.com/channels/799672011265015819/1213131262483628102",
      "description": "Premier Infrastructure Layer for Human Intelligence.",
      "additional": "~"
    },
    "networkRegisteredAt": 3989825,
    "ownerHotkey": "5EgfUiH6A99dhihMzp7eMM8UDkvmFjCWgM5gnpBN8UgLrVuz",
    "ownerColdkey": "5EgfUiH6A99dhihMzp7eMM8UDkvmFjCWgM5gnpBN8UgLrVuz",
    "block": 3989825,
    "tempo": 360,
    "lastStep": 170,
    "blocksSinceLastStep": 3989825,
    "subnetEmission": 0,
    "alphaIn": 0,
    "alphaOut": 0,
    "taoIn": 0,
    "alphaOutEmission": 1,
    "alphaInEmission": 0,
    "taoInEmission": 0,
    "pendingAlphaEmission": 0,
    "pendingRootEmission": 0,
    "subnetVolume": 0,
    "movingPrice": {
      "bits": 0
    },
    "rho": 0,
    "kappa": 0,
    "minAllowedWeights": 0,
    "maxAllowedWeights": 0,
    "weightsVersion": 0,
    "weightsRateLimit": 0,
    "activityCutoff": 0,
    "maxValidators": 0,
    "numUids": 0,
    "maxUids": 0,
    "burn": 0,
    "difficulty": 0,
    "registrationAllowed": false,
    "powRegistrationAllowed": false,
    "immunityPeriod": 0,
    "minDifficulty": 0,
    "maxDifficulty": 1,
    "minBurn": 0,
    "maxBurn": 0,
    "adjustmentAlpha": 0,
    "adjustmentInterval": 0,
    "targetRegsPerInterval": 0,
    "maxRegsPerBlock": 0,
    "servingRateLimit": 0,
    "commitRevealWeightsEnabled": false,
    "commitRevealPeriod": 0,
    "liquidAlphaEnabled": false,
    "alphaHigh": 0,
    "alphaLow": 0,
    "bondsMovingAvg": 0,
    "hotkeys": [],
    "coldkeys": [],
    "identities": [
      {
        "name": "",
        "url": "",
        "githubRepo": "",
        "image": "",
        "discord": "",
        "description": "",
        "additional": ""
      }
    ],
    "axons": [
      {
        "block": 0,
        "version": 0,
        "ip": 0,
        "port": 0,
        "ipType": 4,
        "protocol": 4,
        "placeholder1": 0,
        "placeholder2": 0
      }
    ],
    "active": [
      false
    ],
    "validatorPermit": [
      false
    ],
    "pruningScore": [
      0
    ],
    "lastUpdate": [
      0
    ],
    "emission": [
      0
    ],
    "dividends": [
      0
    ],
    "incentives": [
      0
    ],
    "consensus": [
      0
    ],
    "trust": [
      0
    ],
    "rank": [
      0
    ],
    "blockAtRegistration": [
      0
    ],
    "alphaStake": [
      0
    ],
    "taoStake": [
      0
    ],
    "totalStake": [
      0
    ],
    "taoDividendsPerHotkey": [
      "",
      0
    ],
    "alphaDividendsPerHotkey": [
      "",
      0
    ]
  },
  "error": null
}

Responses

Status Meaning Description Schema
200 OK Subnet metagraph retrieved successfully Inline
404 Not Found Subnet metagraph not found Inline

Response Schema

getSubnetHyperparams

Code samples

from kami import Kami
from dotenv import load_dotenv
import os
async def main():
    load_dotenv()
    kami = Kami()
    netuid = os.getenv("NETUID")

    hyperparameters = await kami.get_subnet_hyperparameters(netuid)
    print(f"Registration Allowed: {hyperparameters.registrationAllowed}")
    print(f"Max Difficulty: {hyperparameters.maxDifficulty}")

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

GET /chain/subnet-hyperparameters/{netuid}

Get subnet hyperparameter

Retrieves all subnet hyperparameter information by netuid

Parameters

Name In Type Required Description
netuid path number true Network UID

Example responses

200 Response

{
  "statusCode": 200,
  "success": true,
  "data": {
    "rho": 10,
    "kappa": 32767,
    "immunityPeriod": 5000,
    "minAllowedWeights": 1,
    "maxWeightsLimit": 65535,
    "tempo": 99,
    "minDifficulty": 10000000,
    "maxDifficulty": 18446744073709552000,
    "weightsVersion": 0,
    "weightsRateLimit": 100,
    "adjustmentInterval": 360,
    "activityCutoff": 5000,
    "registrationAllowed": true,
    "targetRegsPerInterval": 1,
    "minBurn": 500000,
    "maxBurn": 100000000000,
    "bondsMovingAvg": 900000,
    "maxRegsPerBlock": 1,
    "servingRateLimit": 50,
    "maxValidators": 64,
    "adjustmentAlpha": 58000,
    "difficulty": 10000000,
    "commitRevealPeriod": 1,
    "commitRevealWeightsEnabled": true,
    "alphaHigh": 58982,
    "alphaLow": 45875,
    "liquidAlphaEnabled": true
  },
  "error": null
}

Responses

Status Meaning Description Schema
200 OK Subnet hyperparameter retrieved successfully Inline

Response Schema

serveAxon

Code samples

from kami import Kami
from kami.types import ServeAxonPayload
import os
from dotenv import load_dotenv

from loguru import logger
import bittensor
from bittensor.utils.networking import ip_to_int, ip_version

async def main():
    load_dotenv()
    kami = Kami()

    wallet_name = os.getenv("WALLET_COLDKEY")
    wallet_hotkey = os.getenv("WALLET_HOTKEY")
    wallet_path = os.getenv("WALLET_PATH")
    netuid = os.getenv("NETUID")
    axon_port = os.getenv("AXON_PORT")
    wallet = bittensor.wallet(name=wallet_name, hotkey=wallet_hotkey, path=wallet_path)
    axon = bittensor.axon(wallet=wallet, port=int(axon_port))

    # Serve passes the axon information to the network + netuid we are hosting on.
    # This will auto-update if the axon port of external ip have changed.
    logger.info(f"Serving miner axon {axon} with netuid: {netuid}")

    axon_payload = ServeAxonPayload(
        netuid=netuid,
        port=axon.external_port,
        ip=ip_to_int(axon.external_ip),
        ipType=ip_version(axon.external_ip),
        protocol=ip_version(axon.external_ip),
        version=1,
    )
    print(f"Axon payload: {axon_payload}")
    if not await kami.check_if_axon_served(axon_payload):
        print("Axon not served, serving axon...")
        serve_success = await kami.serve_axon(axon_payload)
        if serve_success.get("statusCode", None) == 200:
            logger.success("Successfully served axon for miner!")
        else:
            logger.error(
                f"Failed to serve axon for miner, exiting with error message: {serve_success.get('message')}"
            )
            exit()
    else:
        logger.info("Axon already served, no need to serve again.")

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

POST /chain/serve-axon

Serve axon

Must setup Bittensor wallet in env

Body parameter

{
  "version": 0,
  "ip": "2240446049",
  "port": 8888,
  "ipType": 4,
  "netuid": 2,
  "protocol": 4,
  "placeholder1": 0,
  "placeholder2": 0
}

Parameters

Name In Type Required Description
body body AxonCallParamsDto true none

Example responses

200 Response

{
  "statusCode": 200,
  "success": true,
  "data": "0xce230ef4308b4073e448a4b92ea7ebf40385568ebe93598b6cde7cc3658dc499",
  "error": null
}

Responses

Status Meaning Description Schema
200 OK Operation completed successfully Inline

Response Schema

setWeights

Code samples

from kami import Kami
from kami.types import SetWeightsPayload
import os
from dotenv import load_dotenv

async def main():
    load_dotenv()
    kami = Kami()
    netuid = os.getenv("NETUID")
    uids = [1, 2, 3]
    weights = [1000, 2000, 3000]
    version_key = 1

    payload = SetWeightsPayload(netuid=int(netuid), dests=uids, weights=weights, version_key=version_key)
    await kami.set_weights(payload)
    ## Sets Commit Reveal weights automatically if Commit Reveal is enabled

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

POST /chain/set-weights

Set weights

Must setup Bittensor wallet in env

Body parameter

{
  "netuid": 1,
  "dests": [
    0,
    1,
    2,
    3
  ],
  "weights": [
    1,
    2,
    3,
    4
  ],
  "versionKey": 1
}

Parameters

Name In Type Required Description
body body SetWeightsParamsDto true none

Example responses

200 Response

{
  "statusCode": 200,
  "success": true,
  "data": "0xce230ef4308b4073e448a4b92ea7ebf40385568ebe93598b6cde7cc3658dc499",
  "error": null
}

Responses

Status Meaning Description Schema
200 OK Operation completed successfully Inline

Response Schema

setCommitRevealWeights

Code samples

from kami import Kami
from kami.types import SetWeightsPayload
import os
from dotenv import load_dotenv

async def main():
    load_dotenv()
    kami = Kami()
    netuid = os.getenv("NETUID")
    uids = [1, 2, 3]
    weights = [1000, 2000, 3000]
    version_key = 1

    payload = SetWeightsPayload(netuid=int(netuid), dests=uids, weights=weights, version_key=version_key)
    await kami.set_weights(payload)
    ## Sets Commit Reveal weights automatically if Commit Reveal is enabled

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

POST /chain/set-commit-reveal-weights

Set commit reveal weights

Must setup Bittensor wallet in env

Body parameter

{
  "netuid": 1,
  "commit": "0x78b67e3f8062eb063934f935e5c79dc47928d594c16ea2841f8225667b4440f4 or b'‚„\u0014·÷Ÿ\u0002Ù7”ªkD\u000bú3o\u0015ßYÈ\u000b\u0016Ææ\u0007s=¤f͸...00AES_GCM_",
  "revealRound": 1
}

Parameters

Name In Type Required Description
body body SetCommitRevealWeightsParamsDto true none

Example responses

200 Response

{
  "statusCode": 200,
  "success": true,
  "data": "0xce230ef4308b4073e448a4b92ea7ebf40385568ebe93598b6cde7cc3658dc499",
  "error": null
}

Responses

Status Meaning Description Schema
200 OK Operation completed successfully Inline

Response Schema

checkHotkey

Code samples

from kami import Kami
from dotenv import load_dotenv
import os
async def main():
    load_dotenv()
    kami = Kami()
    netuid = os.getenv("NETUID")

    keyring_pair_info = await kami.get_keyring_pair_info()
    hotkey = keyring_pair_info.keyringPair.address

    is_hotkey_registered = await kami.is_hotkey_registered(netuid, hotkey)
    print(f"Is hotkey {hotkey} registered on netuid {netuid}: {is_hotkey_registered}")
    ## Is hotkey 5XXX registered on netuid 98: True

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

GET /chain/check-hotkey

Check if a hotkey is valid on a subnet

If a block is provided, the hotkey will be checked against the block.

Parameters

Name In Type Required Description
netuid query number true Subnet UID
hotkey query string true Hotkey
block query number false Block

Example responses

200 Response

{
  "statusCode": 200,
  "success": true,
  "data": {
    "isHotkeyValid": true
  },
  "error": null
}

Responses

Status Meaning Description Schema
200 OK Successfully checked hotkey on metagraph Inline

Response Schema

Schemas

ErrorDto

{
  "type": "SUBNET_METAGRAPH.NOT_FOUND",
  "message": "Subnet metagraph with ID 1000 not found",
  "stackTrace": "string"
}

Properties

Name Type Required Restrictions Description
type string true none Error Type Enum Defined in Exception
message string true none Error Message
stackTrace string false none Error Stack Trace

ApiResponseDto

{
  "statusCode": 200,
  "success": true,
  "data": null,
  "error": null
}

Properties

Name Type Required Restrictions Description
statusCode number true none Status Code
success boolean true none Success
data object true none Data
error ErrorDto true none Error Details

KeyringPairDto

{
  "address": "5E4z3h9yVhmQyCFWNbY9BPpwhx4xFiPwq3eeqmBgVF6KULde",
  "addressRaw": {},
  "isLocked": true,
  "meta": [
    "string"
  ],
  "publicKey": {},
  "type": "sr25519"
}

Properties

Name Type Required Restrictions Description
address string true none Hotkey
addressRaw object true none Raw Address
isLocked boolean true none Is locked
meta [string] true none Metadata
publicKey object true none Public key
type string true none Type

KeyringPairInfoDto

{
  "keyringPair": {
    "address": "5E4z3h9yVhmQyCFWNbY9BPpwhx4xFiPwq3eeqmBgVF6KULde",
    "addressRaw": {},
    "isLocked": true,
    "meta": [
      "string"
    ],
    "publicKey": {},
    "type": "sr25519"
  },
  "walletColdkey": "5DSsZGwBuYHRDA7HzdZUVBhKKpZpJKcf7rTd9y5Gz1SQyo9V"
}

Properties

Name Type Required Restrictions Description
keyringPair KeyringPairDto true none The keyring pair
walletColdkey string true none The wallet coldkey

SubnetIdentityDto

{
  "subnetName": "Dojo",
  "githubRepo": "https://github.com/tensorplex-labs/dojo",
  "subnetContact": "jarvis@tensorplex.ai",
  "subnetUrl": "https://dojo.network",
  "discord": "https://discord.com/channels/799672011265015819/1213131262483628102",
  "description": "Premier Infrastructure Layer for Human Intelligence.",
  "additional": "~"
}

Properties

Name Type Required Restrictions Description
subnetName string true none The subnet name
githubRepo string true none The GitHub repository
subnetContact string true none The contact URL
subnetUrl string true none The URL
discord string true none The Discord URL
description string true none The description
additional string true none The additional information

IdentitiesInfoDto

{
  "name": "",
  "url": "",
  "githubRepo": "",
  "image": "",
  "discord": "",
  "description": "",
  "additional": ""
}

Properties

Name Type Required Restrictions Description
name string true none Name
url string true none URL
githubRepo string true none GitHub Repository
image string true none Image
discord string true none Discord
description string true none Description
additional string true none Additional

AxonInfoDto

{
  "block": 0,
  "version": 0,
  "ip": 0,
  "port": 0,
  "ipType": 4,
  "protocol": 4,
  "placeholder1": 0,
  "placeholder2": 0
}

Properties

Name Type Required Restrictions Description
block number true none Block
version number true none Version
ip number true none IP
port number true none Port
ipType number true none IP Type (v4 or v6)
protocol number true none Protocol
placeholder1 number true none Placeholder 1
placeholder2 number true none Placeholder 2

SubnetMetagraphDto

{
  "netuid": 1,
  "name": "Tensorplex Dojo",
  "symbol": "ا",
  "identity": {
    "subnetName": "Dojo",
    "githubRepo": "https://github.com/tensorplex-labs/dojo",
    "subnetContact": "jarvis@tensorplex.ai",
    "subnetUrl": "https://dojo.network",
    "discord": "https://discord.com/channels/799672011265015819/1213131262483628102",
    "description": "Premier Infrastructure Layer for Human Intelligence.",
    "additional": "~"
  },
  "networkRegisteredAt": 3989825,
  "ownerHotkey": "5EgfUiH6A99dhihMzp7eMM8UDkvmFjCWgM5gnpBN8UgLrVuz",
  "ownerColdkey": "5EgfUiH6A99dhihMzp7eMM8UDkvmFjCWgM5gnpBN8UgLrVuz",
  "block": 3989825,
  "tempo": 360,
  "lastStep": 170,
  "blocksSinceLastStep": 3989825,
  "subnetEmission": 0,
  "alphaIn": 0,
  "alphaOut": 0,
  "taoIn": 0,
  "alphaOutEmission": 1,
  "alphaInEmission": 0,
  "taoInEmission": 0,
  "pendingAlphaEmission": 0,
  "pendingRootEmission": 0,
  "subnetVolume": 0,
  "movingPrice": {
    "bits": 0
  },
  "rho": 0,
  "kappa": 0,
  "minAllowedWeights": 0,
  "maxAllowedWeights": 0,
  "weightsVersion": 0,
  "weightsRateLimit": 0,
  "activityCutoff": 0,
  "maxValidators": 0,
  "numUids": 0,
  "maxUids": 0,
  "burn": 0,
  "difficulty": 0,
  "registrationAllowed": false,
  "powRegistrationAllowed": false,
  "immunityPeriod": 0,
  "minDifficulty": 0,
  "maxDifficulty": 1,
  "minBurn": 0,
  "maxBurn": 0,
  "adjustmentAlpha": 0,
  "adjustmentInterval": 0,
  "targetRegsPerInterval": 0,
  "maxRegsPerBlock": 0,
  "servingRateLimit": 0,
  "commitRevealWeightsEnabled": false,
  "commitRevealPeriod": 0,
  "liquidAlphaEnabled": false,
  "alphaHigh": 0,
  "alphaLow": 0,
  "bondsMovingAvg": 0,
  "hotkeys": [],
  "coldkeys": [],
  "identities": [
    {
      "name": "",
      "url": "",
      "githubRepo": "",
      "image": "",
      "discord": "",
      "description": "",
      "additional": ""
    }
  ],
  "axons": [
    {
      "block": 0,
      "version": 0,
      "ip": 0,
      "port": 0,
      "ipType": 4,
      "protocol": 4,
      "placeholder1": 0,
      "placeholder2": 0
    }
  ],
  "active": [
    false
  ],
  "validatorPermit": [
    false
  ],
  "pruningScore": [
    0
  ],
  "lastUpdate": [
    0
  ],
  "emission": [
    0
  ],
  "dividends": [
    0
  ],
  "incentives": [
    0
  ],
  "consensus": [
    0
  ],
  "trust": [
    0
  ],
  "rank": [
    0
  ],
  "blockAtRegistration": [
    0
  ],
  "alphaStake": [
    0
  ],
  "taoStake": [
    0
  ],
  "totalStake": [
    0
  ],
  "taoDividendsPerHotkey": [
    "",
    0
  ],
  "alphaDividendsPerHotkey": [
    "",
    0
  ]
}

Properties

Name Type Required Restrictions Description
netuid number true none The subnet UID
name [string] true none The subnet name
symbol [string] true none The subnet symbol
identity SubnetIdentityDto true none The subnet identity
networkRegisteredAt number true none The network registered at
ownerHotkey string true none The owner hotkey
ownerColdkey string true none The owner coldkey
block number true none Current block
tempo number true none The tempo
lastStep number true none Last step
blocksSinceLastStep number true none Blocks since last step
subnetEmission number true none Subnet emission
alphaIn number true none alpha_in
alphaOut number true none alpha_out
taoIn number true none tao_in
alphaOutEmission number true none alpha_out_emission
alphaInEmission number true none alpha_in_emission
taoInEmission number true none tao_in_emission
pendingAlphaEmission number true none pending_alpha_emission
pendingRootEmission number true none pending_root_emission
subnetVolume number true none subnet_volume
movingPrice object true none moving_price
rho number true none rho
kappa number true none kappa
minAllowedWeights number true none Min Allowed Weights
maxAllowedWeights number true none Max Allowed Weights
weightsVersion number true none Weights Version
weightsRateLimit number true none Weights Rate Limit
activityCutoff number true none Activity Cutoff
maxValidators number true none Max Validators
numUids number true none Current number of UIDs
maxUids number true none Max UIDs
burn number true none Burn
difficulty number true none Difficulty
registrationAllowed boolean true none Registration Allowed
powRegistrationAllowed boolean true none Pow Registration Allowed
immunityPeriod number true none Immunity Period
minDifficulty number true none Min Difficulty
maxDifficulty string true none Max Difficulty
minBurn number true none Min Burn
maxBurn number true none Max Burn
adjustmentAlpha string true none Adjustment Alpha
adjustmentInterval number true none Adjustment Interval
targetRegsPerInterval number true none Target Registrations Per Interval
maxRegsPerBlock number true none Max Registrations Per Block
servingRateLimit number true none Serving Rate Limit
commitRevealWeightsEnabled boolean true none Commit Reveal Weights Enabled
commitRevealPeriod number true none Commit Reveal Epoch
liquidAlphaEnabled boolean true none Liquid Alpha Enabled
alphaHigh number true none Alpha High
alphaLow number true none Alpha Low
bondsMovingAvg number true none Bonds Moving Average
hotkeys [string] true none Hotkeys
coldkeys [string] true none Coldkeys
identities [IdentitiesInfoDto] true none Identities
axons [AxonInfoDto] true none Axons
active [string] true none Active
validatorPermit [string] true none Validator Permit
pruningScore [string] true none Pruning Score
lastUpdate [string] true none Last Update
emission [string] true none Emission
dividends [string] true none Dividends
incentives [string] true none Incentives
consensus [string] true none Consensus
trust [string] true none Trust
rank [string] true none Rank
blockAtRegistration [string] true none Block At Registration
alphaStake [string] true none Alpha Stake
taoStake [string] true none Root Stake
totalStake [string] true none Total Stake
taoDividendsPerHotkey [string] true none Tao Dividends Per Hotkey
alphaDividendsPerHotkey [string] true none Alpha Dividends Per Hotkey

SubnetHyperparamsResponseDto

{
  "rho": 10,
  "kappa": 32767,
  "immunityPeriod": 5000,
  "minAllowedWeights": 1,
  "maxWeightsLimit": 65535,
  "tempo": 99,
  "minDifficulty": 10000000,
  "maxDifficulty": 18446744073709552000,
  "weightsVersion": 0,
  "weightsRateLimit": 100,
  "adjustmentInterval": 360,
  "activityCutoff": 5000,
  "registrationAllowed": true,
  "targetRegsPerInterval": 1,
  "minBurn": 500000,
  "maxBurn": 100000000000,
  "bondsMovingAvg": 900000,
  "maxRegsPerBlock": 1,
  "servingRateLimit": 50,
  "maxValidators": 64,
  "adjustmentAlpha": 58000,
  "difficulty": 10000000,
  "commitRevealPeriod": 1,
  "commitRevealWeightsEnabled": true,
  "alphaHigh": 58982,
  "alphaLow": 45875,
  "liquidAlphaEnabled": true
}

Properties

Name Type Required Restrictions Description
rho number true none Scaling factor in the sigmoid that normalises the steepness of the sigmoid curve.
kappa number true none The consensus majority ratio: The weights set by validators who have lower normalized stake than Kappa are not used in calculating consensus, which affects ranks, which affect incentives. The consensus threshold for bond-clipping during Yuma Consensus.
immunityPeriod number true none The number of blocks after registration when a miner is protected from deregistration.
minAllowedWeights number true none Minimum number of weights for a validator to set when setting weights.
maxWeightsLimit number true none The limit for the u16-normalized weights. If some weight is greater than this limit when all weights are normalized so that maximum weight is 65535, then it will not be used.
tempo number true none Length of subnet tempo in blocks. See Emissions.
minDifficulty number true none The minimum of the range of the proof-of-work for registering on the subnet.
maxDifficulty number true none The maximum of the dynamic range for difficulty of proof-of-work registration on the subnet.
weightsVersion number true none If the version key specified in set_weights extrinsic is lower than this system-wide setting (WeightsVersionKey), the transaction will fail. This is a fool-proofing protection for validators to update, not a security feature.
weightsRateLimit number true none How long, in blocks, a validator must wait between weight commits on a subnet.
adjustmentInterval number true none AdjustmentInterval is number of blocks that pass between difficulty and burn adjustments. So, I was wrong about "next block" when I said that if root sets difficulty outside of range, it will get back in range. Difficulty will get back in range at most after AdjustmentInterval blocks pass.
activityCutoff number true none The number of blocks for the stake to become inactive for the purpose of epoch in Yuma Consensus. If a validator doesn't submit weights within the first ActivityCutoff blocks of the epoch, it will not be able to participate until the start of the next epoch.
registrationAllowed boolean true none NetworkRegistrationAllowed determines if burned registrations are allowed. If both burned and pow registrations are disabled, the subnet will not get emissions.
targetRegsPerInterval number true none Maximum number of neuron registrations allowed per interval. Interval is AdjustmentInterval.
minBurn number true none The minimum of the range of the dynamic burn cost for registering on the subnet.
maxBurn number true none he maximum of the dynamic range for TAO cost of burn registration on the subnet.
bondsMovingAvg number true none The moving average of bonds. The higher bonds yield to higher dividends for validators. See Yuma Consensus: bonding mechanics.
maxRegsPerBlock number true none Maximum neuron registrations per block. Note: Actual limit may be lower, as there is also per interval limit TargetRegistrationsPerInterval.
servingRateLimit number true none Rate limit for calling serve_axon and serve_prometheus extrinsics used by miners.
maxValidators number true none Maximum validators on a subnet.
adjustmentAlpha string true none AdjustmentAlpha is the rate at which difficulty and burn are adjusted up or down
difficulty number true none Current dynamically computed value for the proof-of-work (POW) requirement for POW hotkey registration. Decreases over time but increases after new registrations, between the min and the maximum set by the subnet creator.
commitRevealPeriod number true none How long, in blocks, the consensus weights for a subnet remain time-lock encrypted, preventing weight-copying.
commitRevealWeightsEnabled boolean true none Enables Commit Reveal. See Commit Reveal.
alphaHigh number true none Upper bounds for the liquid alpha parameter.
alphaLow number true none Lower bounds for the liquid alpha parameter.
liquidAlphaEnabled boolean true none Enables the liquid alpha feature.

AxonCallParamsDto

{
  "version": 0,
  "ip": "2240446049",
  "port": 8888,
  "ipType": 4,
  "netuid": 2,
  "protocol": 4,
  "placeholder1": 0,
  "placeholder2": 0
}

Properties

Name Type Required Restrictions Description
version number true none Version
ip number true none Decimal representation of the IP address
port number true none Port
ipType number true none IP Type (v4 or v6)
netuid number true none Netuid
protocol number true none Protocol
placeholder1 number true none Placeholder 1
placeholder2 number true none Placeholder 2

SetWeightsParamsDto

{
  "netuid": 1,
  "dests": [
    0,
    1,
    2,
    3
  ],
  "weights": [
    1,
    2,
    3,
    4
  ],
  "versionKey": 1
}

Properties

Name Type Required Restrictions Description
netuid number true none Netuid
dests [string] true none UID
weights [string] true none Weights
versionKey number true none Version Key

SetCommitRevealWeightsParamsDto

{
  "netuid": 1,
  "commit": "0x78b67e3f8062eb063934f935e5c79dc47928d594c16ea2841f8225667b4440f4 or b'‚„\u0014·÷Ÿ\u0002Ù7”ªkD\u000bú3o\u0015ßYÈ\u000b\u0016Ææ\u0007s=¤f͸...00AES_GCM_",
  "revealRound": 1
}

Properties

Name Type Required Restrictions Description
netuid number true none Netuid
commit object true none Commit
revealRound number true none Reveal Round

LatestBlockDto

{
  "parentHash": "0x56a255a1ed8eb98fde76ba92692f1272197464fe40b4bc938f9cc3ae3dea9bb7",
  "blockNumber": 42069,
  "stateRoot": "0xc95e11b40425b3c3bd6302eba0ffa32e572102d287fc4cf7ebe6a38a950ddc89",
  "extrinsicsRoot": "0xe846ab1234bd62370a6b4197c3bedd1a9f0b29920b54756154ec53db4cd494fe"
}

Properties

Name Type Required Restrictions Description
parentHash string true none The parent hash of the block
blockNumber number true none The block number of the block
stateRoot string true none The state root of the block
extrinsicsRoot string true none The extrinsics root of the block

CheckHotkeyDto

{
  "isHotkeyValid": true
}

Properties

Name Type Required Restrictions Description
isHotkeyValid boolean true none Whether the hotkey is registered on the subnet

AccountNonceDto

{
  "accountNonce": 1
}

Properties

Name Type Required Restrictions Description
accountNonce number true none The nonce of the SS58 address

SignMessageResponseDto

{
  "signature": "string"
}

Properties

Name Type Required Restrictions Description
signature string true none The signature of the signed message against keyring pair.

VerifyMessageResponseDto

{
  "valid": "boolean"
}

Properties

Name Type Required Restrictions Description
valid boolean true none If signature is valid.

SignMessageParamDto

{
  "message": "string"
}

Properties

Name Type Required Restrictions Description
message string true none The signature of the signed message against keyring pair.

VerifyMessageParamDto

{
  "message": "string",
  "signature": "string",
  "signeeAddress": "string"
}

Properties

Name Type Required Restrictions Description
message string true none The message that is crafted for the signature to verify against.
signature string true none The signaturethat is crafted for message to verify against in hex, will be converted to u8a during verification.
signeeAddress string true none Wallet public key in ss58 address format.