From a528ec434a0c924ab5b34ca2b71c74a71d2f25c1 Mon Sep 17 00:00:00 2001 From: Felipe Alvarado Date: Thu, 26 Dec 2024 14:13:06 +0100 Subject: [PATCH] Remove ens client mainnet base url (#2368) * Remove ens client mainnet base url The URL https://api.thegraph.com/subgraphs/name/ensdomains/ens is no longer supported and it is necessary to use the ENS Mainnet subgraph (https://thegraph.com/explorer/subgraphs/5XqPmWe6gjyrJtFn9cLy237i4cWw2j9HcUJEXsP5qGtH) and the subgraph config to make the same queries to the TheGraph api. * Add log for unavailable ens client config --- .../history/services/collectibles_service.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/safe_transaction_service/history/services/collectibles_service.py b/safe_transaction_service/history/services/collectibles_service.py index 78fceed90..8f9712700 100644 --- a/safe_transaction_service/history/services/collectibles_service.py +++ b/safe_transaction_service/history/services/collectibles_service.py @@ -172,11 +172,12 @@ def __init__(self, ethereum_client: EthereumClient, redis: Redis): api_key=api_key, subgraph_id=subgraph_id, ) - # Else, provide fallback for Sepolia, Holesky and Mainnet + # Else, provide fallback for Sepolia, Holesky or empty configuration. else: logger.warning( "Using fallback EnsClient configuration. This configuration is not suitable for production and it is " - "recommended to setup a Subgraph API key. See https://docs.ens.domains/web/subgraph" + "recommended to setup a Subgraph API key. Mandatory for networks other than Sepolia or Holesky." + "See https://docs.ens.domains/web/subgraph" ) config = self.fallback_ens_client() @@ -197,9 +198,11 @@ def fallback_ens_client(self) -> EnsClient.Config: "https://api.studio.thegraph.com/query/49574/ensholesky/version/latest", ) else: - return EnsClient.Config( - "https://api.thegraph.com/subgraphs/name/ensdomains/ens/", + logger.warning( + "No fallback Ens Client configuration for network=%s available", + self.ethereum_network, ) + return EnsClient.Config("") def get_metadata_cache_key(self, address: str, token_id: int): return f"metadata:{address}:{token_id}"