Skip to content

Commit

Permalink
Remove ens client mainnet base url
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
falvaradorodriguez committed Dec 19, 2024
1 parent 6e30184 commit cab037e
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -197,9 +198,7 @@ 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/",
)
return EnsClient.Config("")

def get_metadata_cache_key(self, address: str, token_id: int):
return f"metadata:{address}:{token_id}"
Expand Down

0 comments on commit cab037e

Please sign in to comment.