dev@locazia: add ton_daemon

This commit is contained in:
user committed 2024-03-01 23:44:09 +03:00
1 parent f0a0350a57
commit 0c271e3482
6 files changed
+132

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
from app.core.logger import make_log
from app.core.storage import db_session
from app.core._secrets import service_wallet
from app.core._blockchain.ton.toncenter import toncenter
import asyncio
async def main():
make_log("TON", "Service started", level="info")
sw_seqno_result = await toncenter.run_get_method(service_wallet.address.to_string(1, 1, 1), 'seqno')
make_log("TON", f"Service wallet run seqno method: {sw_seqno_result}", level="info")
while True:
make_log("TON", "Service running", level="debug")
# with db_session() as session:
# for stored_content in session.query(StoredContent).filter(StoredContent.uploaded == False).all():
# pass
await asyncio.sleep(5)
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()