Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exchange rates CoinMarketCap source module/CoinGecko API key support #5613

Merged
merged 4 commits into from
May 27, 2022

Conversation

vbaranov
Copy link
Member

@vbaranov vbaranov commented May 26, 2022

Resolves #5600

Motivation

CoinGecko API refused requests from Blockscout without API key

Changelog

  • Add CoinMarketCap Exchange rates source module
  • Make CoinMarketCap source module default
  • Add Environment variable EXCHANGE_RATES_SOURCE (renamed SOURCE_MODULE) with acceptable values:
    coin_market_cap - market cap from CoinMarketCap API
    coin_gecko - market cap from CoinGecko API
    token_bridge - market cap from token bridge contract
  • Add EXCHANGE_RATES_COINMARKETCAP_API_KEY environment variable for setting API key for CoinMarketCap API
  • Add EXCHANGE_RATES_COINGECKO_API_KEY environment variable for setting API key for CoinGecko API

CoinGecko is still the default source for exchange rates.
In order to switch to CoinMarketCap, the Blockscout instance maintainer should provide:

EXCHANGE_RATES_SOURCE=coin_market_cap
EXCHANGE_RATES_COINMARKETCAP_API_KEY=...

For CoinGecko:

EXCHANGE_RATES_SOURCE=coin_gecko # or unset EXCHANGE_RATES_SOURCE env variable
EXCHANGE_RATES_COINMARKETCAP_API_KEY=...

Checklist for your Pull Request (PR)

@vbaranov vbaranov force-pushed the vb-coin-marketcap-source branch 2 times, most recently from d216cd5 to cfde2df Compare May 26, 2022 12:41
@vbaranov vbaranov changed the title Exchange rates CoinMarketCap source module Exchange rates CoinMarketCap source module/CoinGecko API key May 27, 2022
@vbaranov vbaranov changed the title Exchange rates CoinMarketCap source module/CoinGecko API key Exchange rates CoinMarketCap source module/CoinGecko API key support May 27, 2022
@vbaranov vbaranov force-pushed the vb-coin-marketcap-source branch 4 times, most recently from b27d546 to 4998246 Compare May 27, 2022 14:11
@vbaranov vbaranov merged commit e777447 into master May 27, 2022
@vbaranov vbaranov deleted the vb-coin-marketcap-source branch May 27, 2022 17:39
sidhujag pushed a commit to syscoin/blockscout that referenced this pull request May 29, 2022
…source

Exchange rates CoinMarketCap source module/CoinGecko API key support
@leekin96
Copy link

Is blockscout can get coin price from other side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Market Cap suddenly not working on ETH Blockscout.
2 participants