diff --git a/commune/subspace/subspace.py b/commune/subspace/subspace.py index 3eb193d03..4f00461c0 100644 --- a/commune/subspace/subspace.py +++ b/commune/subspace/subspace.py @@ -1111,6 +1111,12 @@ def query_multi(self, params_batch , substrate=None, module='SubspaceModule', fe results = substrate.query_multi(multi_query) return results + def blocks_until_vote(self, netuid=0, **kwargs): + netuid = self.resolve_netuid(netuid) + tempo = self.subnet_params(netuid=netuid, **kwargs)['tempo'] + block = self.block + return tempo - ((block + netuid) % tempo) + def subnet_params(self, netuid=0, network = 'main', @@ -2449,7 +2455,7 @@ def register( stake = stake or 0 min_register_stake = self.min_register_stake(netuid=netuid, network=network) - stake = min(min_register_stake, stake) + stake = max(min_register_stake, stake) if c.key_exists(name): mkey = c.get_key(name) @@ -2463,6 +2469,9 @@ def register( if '0.0.0.0' in address: address = address.replace('0.0.0.0', c.ip(update=1)) + if len(address) > 32: + address = address[-32:] + metadata = c.dict2str(metadata or {}) params = { 'network': subnet.encode('utf-8'), diff --git a/commune/subspace/subspace.yaml b/commune/subspace/subspace.yaml index 129f8fc5f..df25a2dbd 100644 --- a/commune/subspace/subspace.yaml +++ b/commune/subspace/subspace.yaml @@ -47,7 +47,9 @@ urls: comstats: http: https://api.comstats.io ws: wss://api.com - local: null + local: + http: http://0.0.0.0:8080 + ws: ws://0.0.0.0:8080 onfinality: http: https://commune.api.onfinality.io/public-http ws: wss://commune.api.onfinality.io/public-ws