pull/421/head
Andrey Dolgolev 2021-11-15 15:42:20 +02:00
rodzic 22dda47568
commit 1213ad874d
1 zmienionych plików z 14 dodań i 1 usunięć

Wyświetl plik

@ -17,7 +17,7 @@ from sqlalchemy import Column, Date, and_, func, text
from sqlalchemy.orm import Query, Session
from sqlalchemy.sql.operators import in_op
from ..blockchain import get_block_model, get_label_model, get_transaction_model
from ..blockchain import get_block_model, get_label_model, get_transaction_model, connect
from ..data import AvailableBlockchainType
from ..settings import (
MOONSTREAM_ADMIN_ACCESS_TOKEN,
@ -26,6 +26,10 @@ from ..settings import (
)
from ..settings import bugout_client as bc
from web3 import HTTPProvider, IPCProvider, Web3
from web3.middleware import geth_poa_middleware
from web3.types import BlockData
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
@ -382,6 +386,8 @@ def stats_generate_handler(args: argparse.Namespace):
s3_client = boto3.client("s3")
# Already processed
already_processed = []
@ -409,6 +415,11 @@ def stats_generate_handler(args: argparse.Namespace):
abi_functions = [item for item in abi_json if item["type"] == "function"]
abi_events = [item for item in abi_json if item["type"] == "event"]
abi_extentions = [item for item in abi_json if item["type"] == "extention"]
web3_client = connect(blockchain_type)
extention = web3_client
for timescale in [timescale.value for timescale in TimeScale]:
@ -418,6 +429,8 @@ def stats_generate_handler(args: argparse.Namespace):
print(f"Timescale: {timescale}")
s3_data_object["web3_metric"] = extention
abi_functions_names = [item["name"] for item in abi_functions]
functions_calls_data = generate_data(