Skip to content

Commit

Permalink
subspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Apr 17, 2024
1 parent 863a9be commit 652909b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 0 additions & 6 deletions commune/subspace/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ class Network(c.Module):
Handles interactions with the subspace chain.
"""

def __init__(
self,
**kwargs,
):
self.set_config(kwargs=kwargs)

def resolve_url(self, url:str = None, network:str = network, mode=None , **kwargs):
mode = mode or self.config.connection_mode
network = 'network' or self.config.network
Expand Down
10 changes: 9 additions & 1 deletion commune/subspace/subnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ def __init__(self, network='main', **kwargs):
def emissions(self, netuid = 0, network = "main", block=None, update=False, **kwargs):
return self.subspace.query_vector('Emission', network=network, netuid=netuid, block=block, update=update, **kwargs)





def subnet2stake(self, network=None, update=False) -> dict:
subnet2stake = {}
for subnet_name in self.subnet_names(network=network):
c.print(f'Getting stake for subnet {subnet_name}')
subnet2stake[subnet_name] = self.my_total_stake(network=network, netuid=subnet_name , update=update)
return subnet2stake
1 change: 0 additions & 1 deletion commune/subspace/subspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3029,7 +3029,6 @@ def staked(self,

def my_keys(self, search=None, netuid=0, max_age=1000, update=False, **kwargs):
netuid = self.resolve_netuid(netuid)

keys = self.keys(netuid=netuid, max_age=max_age, update=update, **kwargs)
key2address = c.key2address(search=search, max_age=max_age, update=update)
if search != None:
Expand Down

0 comments on commit 652909b

Please sign in to comment.