runtime

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountAmountPair

type AccountAmountPair struct {
	Account types.AccountID
	Amount  types.UCompact
}

AccountAmountPair represents a tuple of account and amount

type AxonInfo

type AxonInfo struct {
	Block        types.U64
	Version      types.U32
	IP           types.U128
	Port         types.U16
	IPType       types.U8
	Protocol     types.U8
	Placeholder1 types.U8
	Placeholder2 types.U8
}

type ChainIdentityOfV2

type ChainIdentityOfV2 struct {
	Name        types.Bytes
	URL         types.Bytes
	GithubRepo  types.Bytes
	Image       types.Bytes
	Discord     types.Bytes
	Description types.Bytes
	Additional  types.Bytes
}

ChainIdentityOfV2 represents identity information for a chain account

type I96F32

type I96F32 struct {
	Bits types.U128
}

I96F32 represents a fixed-point number with 96 bits integer part and 32 bits fractional part

type Metagraph

type Metagraph struct {
	// Subnet index
	Netuid types.UCompact // Compact<u16>

	// Name and symbol
	Name   []types.UCompact // Vec<Compact<u8>>
	Symbol []types.UCompact // Vec<Compact<u8>>

	// Identity
	Identity            types.Option[SubnetIdentityV3] // Option<SubnetIdentityV3>
	NetworkRegisteredAt types.UCompact                 // Compact<u64>
	OwnerHotkey         types.AccountID                // AccountId
	OwnerColdkey        types.AccountID                // AccountId

	// Tempo terms
	Block               types.UCompact // Compact<u64>
	Tempo               types.UCompact // Compact<u16>
	LastStep            types.UCompact // Compact<u64>
	BlocksSinceLastStep types.UCompact // Compact<u64>

	// Subnet emission terms
	SubnetEmission       types.UCompact // Compact<u64>
	AlphaIn              types.UCompact // Compact<u64>
	AlphaOut             types.UCompact // Compact<u64>
	TaoIn                types.UCompact // Compact<u64>
	AlphaOutEmission     types.UCompact // Compact<u64>
	AlphaInEmission      types.UCompact // Compact<u64>
	TaoInEmission        types.UCompact // Compact<u64>
	PendingAlphaEmission types.UCompact // Compact<u64>
	PendingRootEmission  types.UCompact // Compact<u64>
	SubnetVolume         types.UCompact // Compact<u128>
	MovingPrice          I96F32         // fixed-point

	// Hparams for epoch
	Rho   types.UCompact // Compact<u16>
	Kappa types.UCompact // Compact<u16>

	// Validator params
	MinAllowedWeights types.UCompact // Compact<u16>
	MaxWeightsLimit   types.UCompact // Compact<u16>
	WeightsVersion    types.UCompact // Compact<u64>
	WeightsRateLimit  types.UCompact // Compact<u64>
	ActivityCutoff    types.UCompact // Compact<u16>
	MaxValidators     types.UCompact // Compact<u16>

	// Registration
	NumUids                types.UCompact // Compact<u16>
	MaxUids                types.UCompact // Compact<u16>
	Burn                   types.UCompact // Compact<u64>
	Difficulty             types.UCompact // Compact<u64>
	RegistrationAllowed    types.Bool     // bool
	PowRegistrationAllowed types.Bool     // bool
	ImmunityPeriod         types.UCompact // Compact<u16>
	MinDifficulty          types.UCompact // Compact<u64>
	MaxDifficulty          types.UCompact // Compact<u64>
	MinBurn                types.UCompact // Compact<u64>
	MaxBurn                types.UCompact // Compact<u64>
	AdjustmentAlpha        types.UCompact // Compact<u64>
	AdjustmentInterval     types.UCompact // Compact<u16>
	TargetRegsPerInterval  types.UCompact // Compact<u16>
	MaxRegsPerBlock        types.UCompact // Compact<u16>
	ServingRateLimit       types.UCompact // Compact<u64>

	// Commit‐reveal
	CommitRevealWeightsEnabled types.Bool     // bool
	CommitRevealPeriod         types.UCompact // Compact<u64>

	// Bonds
	LiquidAlphaEnabled types.Bool     // bool
	AlphaHigh          types.UCompact // Compact<u16>
	AlphaLow           types.UCompact // Compact<u16>
	BondsMovingAvg     types.UCompact // Compact<u64>

	// Metagraph info
	Hotkeys         []types.AccountID // Vec<AccountId>
	Coldkeys        []types.AccountID
	Identities      []types.Option[ChainIdentityOfV2]
	Axons           []AxonInfo
	Active          []types.Bool
	ValidatorPermit []types.Bool

	PruningScore []types.UCompact // Vec<Compact<u16>>
	LastUpdate   []types.UCompact // Vec<Compact<u64>>
	Emission     []types.UCompact // Vec<Compact<u64>>
	Dividends    []types.UCompact // Vec<Compact<u16>>
	Incentives   []types.UCompact // Vec<Compact<u16>>
	Consensus    []types.UCompact // Vec<Compact<u16>>
	Trust        []types.UCompact // Vec<Compact<u16>>
	Rank         []types.UCompact // Vec<Compact<u16>>

	BlockAtRegistration []types.UCompact // Vec<Compact<u64>>
	AlphaStake          []types.UCompact // Vec<Compact<u64>>
	TaoStake            []types.UCompact // Vec<Compact<u64>>
	TotalStake          []types.UCompact // Vec<Compact<u64>>

	// Dividend breakdown
	TaoDividendsPerHotkey   []AccountAmountPair // Vec<(AccountId, Compact<u64>)>
	AlphaDividendsPerHotkey []AccountAmountPair
}

func GetMetagraph

func GetMetagraph(c *client.Client, netuid uint16, blockHash *types.Hash) (*Metagraph, error)

GetMetagraph retrieves the metagraph for a specific subnet

type NeuronInfo

type NeuronInfo struct {
	Hotkey         types.AccountID
	Coldkey        types.AccountID
	UID            types.UCompact
	NetUID         types.UCompact
	Active         types.Bool
	AxonInfo       AxonInfo
	PrometheusInfo PrometheusInfo
	Stake          []struct {
		Account types.AccountID
		Amount  types.UCompact
	}
	Rank            types.UCompact
	Emission        types.UCompact
	Incentive       types.UCompact
	Consensus       types.UCompact
	Trust           types.UCompact
	ValidatorTrust  types.UCompact
	Dividends       types.UCompact
	LastUpdate      types.UCompact
	ValidatorPermit types.Bool
	Weights         []struct {
		UID    types.UCompact
		Weight types.UCompact
	}
	Bonds []struct {
		UID  types.UCompact
		Bond types.UCompact
	}
	PruningScore types.UCompact
}

func GetNeuron added in v0.0.4

func GetNeuron(c *client.Client, netuid uint16, uid uint16, blockHash *types.Hash) (*NeuronInfo, error)

func GetNeurons

func GetNeurons(c *client.Client, netuid uint16, blockHash *types.Hash) ([]NeuronInfo, error)

type PrometheusInfo

type PrometheusInfo struct {
	Block   types.U64
	Version types.U32
	IP      types.U128
	Port    types.U16
	IPType  types.U8
}

type SubnetIdentityV3 added in v0.0.7

type SubnetIdentityV3 struct {
	SubnetName     types.Bytes
	GithubRepo     types.Bytes
	SubnetContact  types.Bytes
	SubnetURL      types.Bytes
	Discord        types.Bytes
	Description    types.Bytes
	LogoURL        types.Bytes
	AdditionalInfo types.Bytes
}

SubnetIdentityV3 represents identity information for a subnet

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL