-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (22 loc) · 919 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import asyncio
import aiohttp
from loguru import logger
from config import ADDRESSES
from modules import *
from modules.network import Network
from settings import chainbase_get_balance, get_module
from utils.helpers import get_network
from utils.sleeping import async_sleep
async def run_module(session, address, network, module):
await chainbase_get_balance(session, address, network, module)
async def main(module):
async with aiohttp.ClientSession() as session:
for address in ADDRESSES:
for network in Network.networks:
await run_module(session, address, network, module)
logger.info(f"Balance for {address} in chain {get_network(network)} has been calculated")
await async_sleep(5, 10)
logger.info("File with balances has been created")
if __name__ == "__main__":
module = get_module()
asyncio.run(main(module))