From 3eab407c00598b5d027f52866addc31ec7e69bb9 Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Date: Tue, 26 Nov 2024 21:40:13 -0300 Subject: [PATCH] Switch to gpu.scd in all relevant segments --- skynet/cli.py | 20 ++++++++++---------- skynet/dgpu/network.py | 18 +++++++++--------- skynet/frontend/discord/__init__.py | 4 ++-- skynet/frontend/discord/handlers.py | 2 +- skynet/frontend/discord/utils.py | 4 ++-- skynet/frontend/telegram/__init__.py | 4 ++-- skynet/frontend/telegram/handlers.py | 2 +- skynet/frontend/telegram/utils.py | 4 ++-- skynet/ipfs/pinner.py | 8 ++++---- 9 files changed, 33 insertions(+), 33 deletions(-) diff --git a/skynet/cli.py b/skynet/cli.py index 9dec928..859e2b6 100755 --- a/skynet/cli.py +++ b/skynet/cli.py @@ -141,7 +141,7 @@ def enqueue( }) res = await cleos.a_push_action( - 'telos.gpu', + 'gpu.scd', 'enqueue', { 'user': Name(account), @@ -176,7 +176,7 @@ def clean( trio.run( partial( cleos.a_push_action, - 'telos.gpu', + 'gpu.scd', 'clean', {}, account, key, permission=permission @@ -191,9 +191,9 @@ def queue(): resp = requests.post( f'{node_url}/v1/chain/get_table_rows', json={ - 'code': 'telos.gpu', + 'code': 'gpu.scd', 'table': 'queue', - 'scope': 'telos.gpu', + 'scope': 'gpu.scd', 'json': True } ) @@ -208,7 +208,7 @@ def status(request_id: int): resp = requests.post( f'{node_url}/v1/chain/get_table_rows', json={ - 'code': 'telos.gpu', + 'code': 'gpu.scd', 'table': 'status', 'scope': request_id, 'json': True @@ -232,7 +232,7 @@ def dequeue(request_id: int): res = trio.run( partial( cleos.a_push_action, - 'telos.gpu', + 'gpu.scd', 'dequeue', { 'user': Name(account), @@ -267,7 +267,7 @@ def config( res = trio.run( partial( cleos.a_push_action, - 'telos.gpu', + 'gpu.scd', 'config', { 'token_contract': token_contract, @@ -296,13 +296,13 @@ def deposit(quantity: str): res = trio.run( partial( cleos.a_push_action, - 'telos.gpu', + 'gpu.scd', 'transfer', { 'sender': Name(account), - 'recipient': Name('telos.gpu'), + 'recipient': Name('gpu.scd'), 'amount': asset_from_str(quantity), - 'memo': f'{account} transferred {quantity} to telos.gpu' + 'memo': f'{account} transferred {quantity} to gpu.scd' }, account, key, permission=permission ) diff --git a/skynet/dgpu/network.py b/skynet/dgpu/network.py index 276d187..dfe4d67 100644 --- a/skynet/dgpu/network.py +++ b/skynet/dgpu/network.py @@ -72,7 +72,7 @@ class SkynetGPUConnector: return await failable( partial( self.cleos.aget_table, - 'telos.gpu', 'telos.gpu', 'queue', + 'gpu.scd', 'gpu.scd', 'queue', index_position=2, key_type='i64', lower_bound=int(time.time()) - 3600 @@ -83,14 +83,14 @@ class SkynetGPUConnector: return await failable( partial( self.cleos.aget_table, - 'telos.gpu', request_id, 'status'), ret_fail=[]) + 'gpu.scd', request_id, 'status'), ret_fail=[]) async def get_global_config(self): logging.info('get_global_config') rows = await failable( partial( self.cleos.aget_table, - 'telos.gpu', 'telos.gpu', 'config')) + 'gpu.scd', 'gpu.scd', 'config')) if rows: return rows[0] @@ -102,7 +102,7 @@ class SkynetGPUConnector: rows = await failable( partial( self.cleos.aget_table, - 'telos.gpu', 'telos.gpu', 'users', + 'gpu.scd', 'gpu.scd', 'users', index_position=1, key_type='name', lower_bound=self.account, @@ -149,7 +149,7 @@ class SkynetGPUConnector: return await failable( partial( self.cleos.a_push_action, - 'telos.gpu', + 'gpu.scd', 'workbegin', { 'worker': self.account, @@ -166,7 +166,7 @@ class SkynetGPUConnector: return await failable( partial( self.cleos.a_push_action, - 'telos.gpu', + 'gpu.scd', 'workcancel', { 'worker': self.account, @@ -189,7 +189,7 @@ class SkynetGPUConnector: await failable( partial( self.cleos.a_push_action, - 'telos.gpu', + 'gpu.scd', 'withdraw', { 'user': self.account, @@ -205,7 +205,7 @@ class SkynetGPUConnector: return await failable( partial( self.cleos.aget_table, - 'telos.gpu', 'telos.gpu', 'results', + 'gpu.scd', 'gpu.scd', 'results', index_position=4, key_type='name', lower_bound=self.account, @@ -224,7 +224,7 @@ class SkynetGPUConnector: return await failable( partial( self.cleos.a_push_action, - 'telos.gpu', + 'gpu.scd', 'submit', { 'worker': self.account, diff --git a/skynet/frontend/discord/__init__.py b/skynet/frontend/discord/__init__.py index 4c5bf31..a6bc0f3 100644 --- a/skynet/frontend/discord/__init__.py +++ b/skynet/frontend/discord/__init__.py @@ -155,7 +155,7 @@ class SkynetDiscordFrontend: reward = '20.0000 GPU' res = await self.cleos.a_push_action( - 'telos.gpu', + 'gpu.scd', 'enqueue', { 'user': Name(self.account), @@ -202,7 +202,7 @@ class SkynetDiscordFrontend: try: submits = await self.hyperion.aget_actions( account=self.account, - filter='telos.gpu:submit', + filter='gpu.scd:submit', sort='desc', after=request_time ) diff --git a/skynet/frontend/discord/handlers.py b/skynet/frontend/discord/handlers.py index 27da3cd..95bfc52 100644 --- a/skynet/frontend/discord/handlers.py +++ b/skynet/frontend/discord/handlers.py @@ -309,7 +309,7 @@ def create_handler_context(frontend: 'SkynetDiscordFrontend'): # async def queue(message): # an_hour_ago = datetime.now() - timedelta(hours=1) # queue = await cleos.aget_table( - # 'telos.gpu', 'telos.gpu', 'queue', + # 'gpu.scd', 'gpu.scd', 'queue', # index_position=2, # key_type='i64', # sort='desc', diff --git a/skynet/frontend/discord/utils.py b/skynet/frontend/discord/utils.py index ac73646..8f6d484 100644 --- a/skynet/frontend/discord/utils.py +++ b/skynet/frontend/discord/utils.py @@ -112,12 +112,12 @@ def generate_reply_caption( async def get_global_config(cleos): return (await cleos.aget_table( - 'telos.gpu', 'telos.gpu', 'config'))[0] + 'gpu.scd', 'gpu.scd', 'config'))[0] async def get_user_nonce(cleos, user: str): return (await cleos.aget_table( - 'telos.gpu', 'telos.gpu', 'users', + 'gpu.scd', 'gpu.scd', 'users', index_position=1, key_type='name', lower_bound=user, diff --git a/skynet/frontend/telegram/__init__.py b/skynet/frontend/telegram/__init__.py index 14f8c6b..d4fd549 100644 --- a/skynet/frontend/telegram/__init__.py +++ b/skynet/frontend/telegram/__init__.py @@ -143,7 +143,7 @@ class SkynetTelegramFrontend: reward = '20.0000 GPU' res = await self.cleos.a_push_action( - 'telos.gpu', + 'gpu.scd', 'enqueue', { 'user': Name(self.account), @@ -193,7 +193,7 @@ class SkynetTelegramFrontend: try: submits = await self.hyperion.aget_actions( account=self.account, - filter='telos.gpu:submit', + filter='gpu.scd:submit', sort='desc', after=request_time ) diff --git a/skynet/frontend/telegram/handlers.py b/skynet/frontend/telegram/handlers.py index ef0e31f..63abe60 100644 --- a/skynet/frontend/telegram/handlers.py +++ b/skynet/frontend/telegram/handlers.py @@ -47,7 +47,7 @@ def create_handler_context(frontend: 'SkynetTelegramFrontend'): async def queue(message): an_hour_ago = datetime.now() - timedelta(hours=1) queue = await cleos.aget_table( - 'telos.gpu', 'telos.gpu', 'queue', + 'gpu.scd', 'gpu.scd', 'queue', index_position=2, key_type='i64', sort='desc', diff --git a/skynet/frontend/telegram/utils.py b/skynet/frontend/telegram/utils.py index 01a2a9b..f438623 100644 --- a/skynet/frontend/telegram/utils.py +++ b/skynet/frontend/telegram/utils.py @@ -95,11 +95,11 @@ def generate_reply_caption( async def get_global_config(cleos): return (await cleos.aget_table( - 'telos.gpu', 'telos.gpu', 'config'))[0] + 'gpu.scd', 'gpu.scd', 'config'))[0] async def get_user_nonce(cleos, user: str): return (await cleos.aget_table( - 'telos.gpu', 'telos.gpu', 'users', + 'gpu.scd', 'gpu.scd', 'users', index_position=1, key_type='name', lower_bound=user, diff --git a/skynet/ipfs/pinner.py b/skynet/ipfs/pinner.py index f3a51f9..1db06fe 100644 --- a/skynet/ipfs/pinner.py +++ b/skynet/ipfs/pinner.py @@ -44,8 +44,8 @@ class SkynetPinner: async def capture_enqueues(self, after: datetime): enqueues = await self.hyperion.aget_actions( - account='telos.gpu', - filter='telos.gpu:enqueue', + account='gpu.scd', + filter='gpu.scd:enqueue', sort='desc', after=after.isoformat(), limit=1000 @@ -63,8 +63,8 @@ class SkynetPinner: async def capture_submits(self, after: datetime): submits = await self.hyperion.aget_actions( - account='telos.gpu', - filter='telos.gpu:submit', + account='gpu.scd', + filter='gpu.scd:submit', sort='desc', after=after.isoformat(), limit=1000