Update available chains.

fix-supported-interfaces
Andrey 2025-01-15 13:58:28 +02:00
rodzic 21e61fdf31
commit 481c46571e
5 zmienionych plików z 35 dodań i 6 usunięć

Wyświetl plik

@ -42,6 +42,12 @@ export MOONSTREAM_IMX_ZKEVM_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_
export MOONSTREAM_GAME7_TESTNET_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
export MOONSTREAM_B3_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
export MOONSTREAM_B3_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
export MOONSTREAM_GAME7_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
export MOONSTREAM_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
export MOONSTREAM_QUERIES_JOURNAL_ID="<bugout_journal_id_where_store_queries_for_executing>"
export MOONSTREAM_USAGE_REPORTS_JOURNAL_ID="<bugout_journal_id_where_save_generated_reports>"
@ -56,4 +62,4 @@ export MOONSTREAM_S3_QUERIES_BUCKET="<AWS_S3_bucket_to_store_sql_queries>"
export MOONSTREAM_S3_QUERIES_BUCKET_PREFIX="dev"
# Set the following variables in the most reasonable manner for your development environment
export HUMBUG_REPORTER_BACKEND_TOKEN="<Bugout_umbug_token_for_crash_reports>"
export HUMBUG_REPORTER_BACKEND_TOKEN="<Bugout_umbug_token_for_crash_reports>"

Wyświetl plik

@ -24,7 +24,7 @@ from bugout.exceptions import BugoutResponseException
from bugout.journal import SearchOrder
from ens.utils import is_valid_ens_name # type: ignore
from eth_utils.address import is_address # type: ignore
from moonstreamdb.blockchain import AvailableBlockchainType
from moonstreamtypes.blockchain import AvailableBlockchainType
from moonstreamdb.models import EthereumLabel
from moonstreamdb.subscriptions import blockchain_by_subscription_id
from moonstreamdbv3.models_indexes import AbiJobs, AbiSubscriptions

Wyświetl plik

@ -11,7 +11,7 @@ from typing import Any, Dict, List, Optional, Union, cast
from bugout.data import BugoutSearchResult, BugoutSearchResultAsEntity
from bugout.exceptions import BugoutResponseException
from fastapi import APIRouter, BackgroundTasks, Depends, Form, Path, Query, Request
from moonstreamdb.blockchain import AvailableBlockchainType
from moonstreamtypes.blockchain import AvailableBlockchainType
from web3 import Web3
from .. import data
@ -836,7 +836,8 @@ async def address_info(request: Request, address: str = Query(...)):
except Exception as e:
logger.error(f"Error reading contract info from web3: {str(e)}")
raise MoonstreamHTTPException(status_code=500, internal_error=e)
continue # Skip failing blockchain and continue with others
if len(contract_info) == 0:
raise MoonstreamHTTPException(
status_code=404,

Wyświetl plik

@ -2,7 +2,7 @@ import os
from typing import Dict, Optional
from bugout.app import Bugout
from moonstreamdb.blockchain import AvailableBlockchainType
from moonstreamtypes.blockchain import AvailableBlockchainType
from moonstreamdbv3.db import MoonstreamDBIndexesEngine
# Bugout
@ -285,6 +285,13 @@ MOONSTREAM_B3_SEPOLIA_WEB3_PROVIDER_URI = os.environ.get(
if MOONSTREAM_B3_SEPOLIA_WEB3_PROVIDER_URI == "":
raise Exception("MOONSTREAM_B3_SEPOLIA_WEB3_PROVIDER_URI env variable is not set")
MOONSTREAM_GAME7_WEB3_PROVIDER_URI = os.environ.get(
"MOONSTREAM_GAME7_WEB3_PROVIDER_URI", ""
)
if MOONSTREAM_GAME7_WEB3_PROVIDER_URI == "":
raise Exception("MOONSTREAM_GAME7_WEB3_PROVIDER_URI env variable is not set")
## QueryAPI

Wyświetl plik

@ -4,7 +4,7 @@ from uuid import UUID
from eth_abi import decode_single, encode_single
from eth_utils import function_signature_to_4byte_selector
from moonstreamdb.blockchain import AvailableBlockchainType
from moonstreamtypes.blockchain import AvailableBlockchainType
from web3 import Web3
from web3._utils.abi import normalize_event_input_types
from web3.contract import ContractFunction
@ -39,6 +39,11 @@ from .settings import (
MOONSTREAM_GAME7_TESTNET_WEB3_PROVIDER_URI,
MOONSTREAM_B3_WEB3_PROVIDER_URI,
MOONSTREAM_B3_SEPOLIA_WEB3_PROVIDER_URI,
MOONSTREAM_GAME7_WEB3_PROVIDER_URI,
MOONSTREAM_GAME7_TESTNET_WEB3_PROVIDER_URI,
MOONSTREAM_SEPOLIA_WEB3_PROVIDER_URI,
MOONSTREAM_IMX_ZKEVM_WEB3_PROVIDER_URI,
MOONSTREAM_IMX_ZKEVM_SEPOLIA_WEB3_PROVIDER_URI,
NB_ACCESS_ID_HEADER,
multicall_contract_abi,
multicall_contracts,
@ -133,6 +138,16 @@ def connect(
web3_uri = MOONSTREAM_B3_WEB3_PROVIDER_URI
elif blockchain_type == AvailableBlockchainType.B3_SEPOLIA:
web3_uri = MOONSTREAM_B3_SEPOLIA_WEB3_PROVIDER_URI
elif blockchain_type == AvailableBlockchainType.SEPOLIA:
web3_uri = MOONSTREAM_SEPOLIA_WEB3_PROVIDER_URI
elif blockchain_type == AvailableBlockchainType.GAME7:
web3_uri = MOONSTREAM_GAME7_WEB3_PROVIDER_URI
elif blockchain_type == AvailableBlockchainType.GAME7_TESTNET:
web3_uri = MOONSTREAM_GAME7_TESTNET_WEB3_PROVIDER_URI
elif blockchain_type == AvailableBlockchainType.IMX_ZKEVM:
web3_uri = MOONSTREAM_IMX_ZKEVM_WEB3_PROVIDER_URI
elif blockchain_type == AvailableBlockchainType.IMX_ZKEVM_SEPOLIA:
web3_uri = MOONSTREAM_IMX_ZKEVM_SEPOLIA_WEB3_PROVIDER_URI
else:
raise Exception("Wrong blockchain type provided for web3 URI")