Subtensor Storage Query Examples
1. ActivityCutoff
- Description: Activity cutoff for networks.
- Query Type:
u16 -> u16
- Parameters:
netuid
:u16
- Default Value:
5000
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'ActivityCutoff', [netuid])
print(result.value)
2. AdjustmentAlpha
- Description: Alpha adjustment value for the network.
- Query Type:
u16 -> u64
- Parameters:
netuid
:u16
- Default Value:
0
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'AdjustmentAlpha', [netuid])
print(result.value)
3. AdjustmentInterval
- Description: Adjustment interval for networks.
- Query Type:
u16 -> u16
- Parameters:
netuid
:u16
- Default Value:
100
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'AdjustmentInterval', [netuid])
print(result.value)
4. AlphaValues
- Description: Alpha values for the network.
- Query Type:
u16 -> (u16, u16)
- Parameters:
netuid
:u16
- Default Value:
(45875, 58982)
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'AlphaValues', [netuid])
print(result.value)
5. Axons
- Description: Axon information for a given hotkey within a network.
- Query Type:
(u16, AccountId) -> AxonInfoOf
- Parameters:
netuid
:u16
hotkey
:AccountId
- Default Value:
None
- Python Example:
from substrateinterface import SubstrateInterface, Keypair
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
hotkey = Keypair.create_from_uri('//Alice').ss58_address
result = substrate.query('SubtensorModule', 'Axons', [netuid, hotkey])
print(result.value)
6. BlockAtRegistration
- Description: Block number at registration for a given UID.
- Query Type:
(u16, u16) -> u64
- Parameters:
netuid
:u16
uid
:u16
- Default Value:
0
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
uid = 123
result = substrate.query('SubtensorModule', 'BlockAtRegistration', [netuid, uid])
print(result.value)
7. BlockEmission
- Description: The total block emission value.
- Query Type:
u64
- Default Value:
1000000000
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
result = substrate.query('SubtensorModule', 'BlockEmission')
print(result.value)
8. BlocksSinceLastStep
- Description: Number of blocks since the last mechanism step.
- Query Type:
u16 -> u64
- Parameters:
netuid
:u16
- Default Value:
0
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'BlocksSinceLastStep', [netuid])
print(result.value)
9. Bonds
- Description: Bond values of UIDs in a network.
- Query Type:
(u16, u16) -> Vec<(u16, u16)>
- Parameters:
netuid
:u16
uid
:u16
- Default Value:
[]
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
uid = 123
result = substrate.query('SubtensorModule', 'Bonds', [netuid, uid])
print(result.value)
10. BondsMovingAverage
- Description: Moving average of bonds in the network.
- Query Type:
u16 -> u64
- Parameters:
netuid
:u16
- Default Value:
900000
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'BondsMovingAverage', [netuid])
print(result.value)
11. Burn
- Description: Burn value for a given network.
- Query Type:
u16 -> u64
- Parameters:
netuid
:u16
- Default Value:
1000000000
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'Burn', [netuid])
print(result.value)
12. BurnRegistrationsThisInterval
- Description: Number of burn registrations in this interval.
- Query Type:
u16 -> u16
- Parameters:
netuid
:u16
- Default Value:
0
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'BurnRegistrationsThisInterval', [netuid])
print(result.value)
13. ChildKeys
- Description: Maps parent keys to child keys with proportions.
- Query Type:
(AccountId, u16) -> Vec<(u64, AccountId)>
- Parameters:
parent
:AccountId
netuid
:u16
- Default Value:
[]
- Python Example:
from substrateinterface import SubstrateInterface, Keypair
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
parent = Keypair.create_from_uri('//Alice').ss58_address
netuid = 1
result = substrate.query('SubtensorModule', 'ChildKeys', [parent, netuid])
print(result.value)
14. CommitRevealWeightsEnabled
- Description: Indicates whether the commit-reveal process for weights is enabled for a given network.
- Query Type:
u16 -> bool
- Parameters:
netuid
:u16
- Default Value:
false
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'CommitRevealWeightsEnabled', [netuid])
print(result.value)
15. Consensus
- Description: Consensus values of UIDs in a network.
- Query Type:
u16 -> Vec<u16>
- Parameters:
netuid
:u16
- Default Value:
[]
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'Consensus', [netuid])
print(result.value)
16. Delegates
- Description: Returns the hotkey delegation take, signaling that this key is open for delegation.
- Query Type:
AccountId -> u16
- Parameters:
hotkey
:AccountId
- Default Value:
11796
- Python Example:
from substrateinterface import SubstrateInterface, Keypair
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
hotkey = Keypair.create_from_uri('//Alice').ss58_address
result = substrate.query('SubtensorModule', 'Delegates', [hotkey])
print(result.value)
17. Difficulty
- Description: Difficulty parameter for a given network.
- Query Type:
u16 -> u64
- Parameters:
netuid
:u16
- Default Value:
10000000
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'Difficulty', [netuid])
print(result.value)
18. Dividends
- Description: Dividend values of UIDs in a network.
- Query Type:
u16 -> Vec<u16>
- Parameters:
netuid
:u16
- Default Value:
[]
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'Dividends', [netuid])
print(result.value)
19. Emission
- Description: Emission values of UIDs in a network.
- Query Type:
u16 -> Vec<u64>
- Parameters:
netuid
:u16
- Default Value:
[]
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'Emission', [netuid])
print(result.value)
20. EmissionValues
- Description: Emission values of the network.
- Query Type:
u16 -> u64
- Parameters:
netuid
:u16
- Default Value:
0
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'EmissionValues', [netuid])
print(result.value)
21. HasMigrationRun
- Description: Storage for migration run status.
- Query Type:
Vec<u8> -> bool
- Parameters:
key
:Vec<u8>
- Default Value:
false
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
key = b"migrate_identities"
result = substrate.query('SubtensorModule', 'HasMigrationRun', [key])
print(result.value)
22. HotkeyEmissionTempo
- Description: The emission tempo of hotkeys.
- Query Type:
u64
- Default Value:
7200
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
result = substrate.query('SubtensorModule', 'HotkeyEmissionTempo')
print(result.value)
23. Identities
- Description: Identity information for a given coldkey.
- Query Type:
AccountId -> ChainIdentityOf
- Parameters:
coldkey
:AccountId
- Default Value:
None
- Python Example:
from substrateinterface import SubstrateInterface, Keypair
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
coldkey = Keypair.create_from_uri('//Bob').ss58_address
result = substrate.query('SubtensorModule', 'Identities', [coldkey])
print(result.value)
24. ImmunityPeriod
- Description: Immunity period for networks.
- Query Type:
u16 -> u16
- Parameters:
netuid
:u16
- Default Value:
4096
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'ImmunityPeriod', [netuid])
print(result.value)
25. Incentive
- Description: Incentive values of UIDs in a network.
- Query Type:
u16 -> Vec<u16>
- Parameters:
netuid
:u16
- Default Value:
[]
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'Incentive', [netuid])
print(result.value)
26. IsNetworkMember
- Description: Whether a hotkey is a member of a network.
- Query Type:
(AccountId, u16) -> bool
- Parameters:
hotkey
:AccountId
netuid
:u16
- Default Value:
false
- Python Example:
from substrateinterface import SubstrateInterface, Keypair
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
hotkey = Keypair.create_from_uri('//Alice').ss58_address
netuid = 1
result = substrate.query('SubtensorModule', 'IsNetworkMember', [hotkey, netuid])
print(result.value)
27. Kappa
- Description: Kappa parameter of the network.
- Query Type:
u16 -> u16
- Parameters:
netuid
:u16
- Default Value:
32767
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'Kappa', [netuid])
print(result.value)
28. Keys
- Description: Maps UID to hotkey within a network.
- Query Type:
(u16, u16) -> AccountId
- Parameters:
netuid
:u16
uid
:u16
- Default Value:
AccountId derived from trailing zeroes
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
uid = 123
result = substrate.query('SubtensorModule', 'Keys', [netuid, uid])
print(result.value)
29. LastAddStakeIncrease
- Description: Last block number when stake was increased for a hotkey-coldkey pair.
- Query Type:
(AccountId, AccountId) -> u64
- Parameters:
hotkey
:AccountId
coldkey
:AccountId
- Default Value:
0
- Python Example:
from substrateinterface import SubstrateInterface, Keypair
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
hotkey = Keypair.create_from_uri('//Alice').ss58_address
coldkey = Keypair.create_from_uri('//Bob').ss58_address
result = substrate.query('SubtensorModule', 'LastAddStakeIncrease', [hotkey, coldkey])
print(result.value)
30. LastAdjustmentBlock
- Description: Block number of the last adjustment for a given network.
- Query Type:
u16 -> u64
- Parameters:
netuid
:u16
- Default Value:
0
- Python Example:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9945")
netuid = 1
result = substrate.query('SubtensorModule', 'LastAdjustmentBlock', [netuid])
print(result.value)