big update
This commit is contained in:
1 parent
7d05a3f2c0
commit
f45d593a84
32 files changed
+726
-320
No files matched your search
@@ -0,0 +1,50 @@
|
||||
import asyncio
|
||||
from base64 import b64decode
|
||||
from datetime import datetime
|
||||
|
||||
from base58 import b58encode
|
||||
from tonsdk.boc import Cell
|
||||
from tonsdk.utils import Address
|
||||
|
||||
from app.core._blockchain.ton.platform import platform
|
||||
from app.core._blockchain.ton.toncenter import toncenter
|
||||
from app.core._utils.send_status import send_status
|
||||
from app.core.logger import make_log
|
||||
from app.core.models.node_storage import StoredContent
|
||||
from app.core._utils.resolve_content import resolve_content
|
||||
from app.core.models.wallet_connection import WalletConnection
|
||||
from app.core._keyboards import get_inline_keyboard
|
||||
from app.core.models._telegram import Wrapped_CBotChat
|
||||
from app.core.storage import db_session
|
||||
import os
|
||||
import traceback
|
||||
|
||||
|
||||
async def license_index_loop(memory, platform_found: bool, seqno: int) -> [bool, int]:
|
||||
make_log("LicenseIndex", "Service running", level="debug")
|
||||
with db_session() as session:
|
||||
pass
|
||||
|
||||
return platform_found, seqno
|
||||
|
||||
|
||||
async def main_fn(memory, ):
|
||||
make_log("LicenseIndex", "Service started", level="info")
|
||||
platform_found = False
|
||||
seqno = 0
|
||||
while True:
|
||||
try:
|
||||
platform_found, seqno = await license_index_loop(memory, platform_found, seqno)
|
||||
except BaseException as e:
|
||||
make_log("LicenseIndex", f"Error: {e}" + '\n' + traceback.format_exc(), level="error")
|
||||
|
||||
if platform_found:
|
||||
await send_status("LicenseIndex", f"working (seqno={seqno})")
|
||||
|
||||
await asyncio.sleep(5)
|
||||
seqno += 1
|
||||
|
||||
# if __name__ == '__main__':
|
||||
# loop = asyncio.get_event_loop()
|
||||
# loop.run_until_complete(main())
|
||||
# loop.close()
|
||||
@@ -38,7 +38,7 @@ async def main_fn(memory):
|
||||
)['message'].to_boc(False)
|
||||
)
|
||||
await asyncio.sleep(5)
|
||||
return await main_fn()
|
||||
return await main_fn(memory)
|
||||
|
||||
if os.getenv("TON_BEGIN_COMMAND_WITHDRAW"):
|
||||
await toncenter.send_boc(
|
||||
@@ -53,7 +53,7 @@ async def main_fn(memory):
|
||||
)
|
||||
make_log("TON", "Withdraw command sent", level="info")
|
||||
await asyncio.sleep(10)
|
||||
return await main_fn()
|
||||
return await main_fn(memory)
|
||||
|
||||
platform_state = await toncenter.get_account(platform.address.to_string(1, 1, 1))
|
||||
if not platform_state.get('code'):
|
||||
@@ -72,7 +72,7 @@ async def main_fn(memory):
|
||||
|
||||
await send_status("ton_daemon", "working: deploying platform")
|
||||
await asyncio.sleep(15)
|
||||
return await main_fn()
|
||||
return await main_fn(memory)
|
||||
|
||||
while True:
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user