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

Adding Blockscout explorer deployment to devnet docker-compose #45

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Setup Docker-compose v2
uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: '2.22.0'

- name: Run dev environment
run: make devnet-up

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ devnet-up:
docker-compose -f ./suave/devenv/docker-compose.yml up -d --build

devnet-down:
docker-compose -f ./suave/devenv/docker-compose.yml down
docker-compose -f ./suave/devenv/docker-compose.yml down -v
239 changes: 239 additions & 0 deletions suave/devenv/blockscout/envs/common-blockscout.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
# DOCKER_TAG=
ETHEREUM_JSONRPC_VARIANT=geth
ETHEREUM_JSONRPC_HTTP_URL=http://suave-mevm:8545/
# ETHEREUM_JSONRPC_FALLBACK_HTTP_URL=
DATABASE_URL=postgresql://blockscout:ceWb1MeLBEeOIfk65gU8EjF8@blockscout-db:5432/blockscout?ssl=false
ETHEREUM_JSONRPC_TRACE_URL=http://suave-mevm:8545/
# ETHEREUM_JSONRPC_FALLBACK_TRACE_URL=
# ETHEREUM_JSONRPC_HTTP_TIMEOUT=
CHAIN_TYPE=suave
CHAIN_ID=1337
NETWORK=
SUBNETWORK=Awesome chain
LOGO=/images/blockscout_logo.svg
ETHEREUM_JSONRPC_WS_URL=ws://suave-mevm:8546/
ETHEREUM_JSONRPC_TRANSPORT=http
ETHEREUM_JSONRPC_DISABLE_ARCHIVE_BALANCES=false
# ETHEREUM_JSONRPC_HTTP_HEADERS=
# ETHEREUM_JSONRPC_WAIT_PER_TIMEOUT=
IPC_PATH=
NETWORK_PATH=/
BLOCKSCOUT_HOST=
BLOCKSCOUT_PROTOCOL=
SECRET_KEY_BASE=56NtB48ear7+wMSf0IQuWDAAazhpb31qyc7GiyspBP2vh7t5zlCsF5QDv76chXeN
# CHECK_ORIGIN=
PORT=4000
COIN_NAME=
# METADATA_CONTRACT=
# VALIDATORS_CONTRACT=
# KEYS_MANAGER_CONTRACT=
# REWARDS_CONTRACT=
# TOKEN_BRIDGE_CONTRACT=
EMISSION_FORMAT=DEFAULT
# CHAIN_SPEC_PATH=
# SUPPLY_MODULE=
COIN=
EXCHANGE_RATES_COIN=
# EXCHANGE_RATES_MARKET_CAP_SOURCE=
# EXCHANGE_RATES_PRICE_SOURCE=
# EXCHANGE_RATES_COINGECKO_COIN_ID=
# EXCHANGE_RATES_COINGECKO_API_KEY=
# EXCHANGE_RATES_COINMARKETCAP_API_KEY=
# EXCHANGE_RATES_COINMARKETCAP_COIN_ID=
POOL_SIZE=30
# EXCHANGE_RATES_COINGECKO_PLATFORM_ID=
# TOKEN_EXCHANGE_RATE_INTERVAL=
# TOKEN_EXCHANGE_RATE_REFETCH_INTERVAL=
# TOKEN_EXCHANGE_RATE_MAX_BATCH_SIZE=
# DISABLE_TOKEN_EXCHANGE_RATE=
POOL_SIZE_API=10
ECTO_USE_SSL=false
# DATADOG_HOST=
# DATADOG_PORT=
# SPANDEX_BATCH_SIZE=
# SPANDEX_SYNC_THRESHOLD=
HEART_BEAT_TIMEOUT=30
# HEART_COMMAND=
#BLOCKSCOUT_VERSION=
RELEASE_LINK=
BLOCK_TRANSFORMER=base
# GRAPHIQL_TRANSACTION=
# BLOCK_RANGES=
# FIRST_BLOCK=
# LAST_BLOCK=
# TRACE_FIRST_BLOCK=
# TRACE_LAST_BLOCK=
# FOOTER_CHAT_LINK=
# FOOTER_FORUM_LINK_ENABLED=
# FOOTER_FORUM_LINK=
# FOOTER_TELEGRAM_LINK_ENABLED=
# FOOTER_TELEGRAM_LINK=
# FOOTER_GITHUB_LINK=
FOOTER_LOGO=/images/blockscout_logo.svg
FOOTER_LINK_TO_OTHER_EXPLORERS=false
FOOTER_OTHER_EXPLORERS={}
SUPPORTED_CHAINS={}
CACHE_BLOCK_COUNT_PERIOD=7200
CACHE_TXS_COUNT_PERIOD=7200
CACHE_ADDRESS_SUM_PERIOD=3600
CACHE_TOTAL_GAS_USAGE_PERIOD=3600
CACHE_ADDRESS_TRANSACTIONS_GAS_USAGE_COUNTER_PERIOD=1800
CACHE_TOKEN_HOLDERS_COUNTER_PERIOD=3600
CACHE_TOKEN_TRANSFERS_COUNTER_PERIOD=3600
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=1800
CACHE_AVERAGE_BLOCK_PERIOD=1800
CACHE_MARKET_HISTORY_PERIOD=21600
CACHE_ADDRESS_TRANSACTIONS_COUNTER_PERIOD=1800
CACHE_ADDRESS_TOKENS_USD_SUM_PERIOD=3600
CACHE_ADDRESS_TOKEN_TRANSFERS_COUNTER_PERIOD=1800
TOKEN_METADATA_UPDATE_INTERVAL=172800
CONTRACT_VERIFICATION_ALLOWED_SOLIDITY_EVM_VERSIONS=homestead,tangerineWhistle,spuriousDragon,byzantium,constantinople,petersburg,istanbul,berlin,london,paris,shanghai,default
CONTRACT_VERIFICATION_ALLOWED_VYPER_EVM_VERSIONS=byzantium,constantinople,petersburg,istanbul,berlin,paris,shanghai,default
# CONTRACT_VERIFICATION_MAX_LIBRARIES=10
CONTRACT_MAX_STRING_LENGTH_WITHOUT_TRIMMING=2040
# CONTRACT_DISABLE_INTERACTION=
UNCLES_IN_AVERAGE_BLOCK_TIME=false
DISABLE_WEBAPP=false
API_V1_READ_METHODS_DISABLED=false
API_V1_WRITE_METHODS_DISABLED=false
DISABLE_INDEXER=false
DISABLE_REALTIME_INDEXER=false
INDEXER_DISABLE_TOKEN_INSTANCE_REALTIME_FETCHER=false
INDEXER_DISABLE_TOKEN_INSTANCE_RETRY_FETCHER=false
INDEXER_DISABLE_TOKEN_INSTANCE_SANITIZE_FETCHER=false
INDEXER_DISABLE_TOKEN_INSTANCE_LEGACY_SANITIZE_FETCHER=false
INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER=true
INDEXER_DISABLE_INTERNAL_TRANSACTIONS_FETCHER=true
# INDEXER_CATCHUP_BLOCKS_BATCH_SIZE=
# INDEXER_CATCHUP_BLOCKS_CONCURRENCY=
# INDEXER_CATCHUP_BLOCK_INTERVAL=
# INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE=
# INDEXER_INTERNAL_TRANSACTIONS_CONCURRENCY=
# INDEXER_BLOCK_REWARD_BATCH_SIZE=
# INDEXER_BLOCK_REWARD_CONCURRENCY=
# INDEXER_TOKEN_INSTANCE_RETRY_REFETCH_INTERVAL=
# INDEXER_TOKEN_INSTANCE_RETRY_CONCURRENCY=
# INDEXER_TOKEN_INSTANCE_REALTIME_CONCURRENCY=
# INDEXER_TOKEN_INSTANCE_SANITIZE_CONCURRENCY=
# INDEXER_TOKEN_INSTANCE_LEGACY_SANITIZE_CONCURRENCY=10
# INDEXER_COIN_BALANCES_BATCH_SIZE=
# INDEXER_COIN_BALANCES_CONCURRENCY=
# INDEXER_RECEIPTS_BATCH_SIZE=
# INDEXER_RECEIPTS_CONCURRENCY=
# INDEXER_TOKEN_CONCURRENCY=
# INDEXER_TOKEN_BALANCES_BATCH_SIZE=
# INDEXER_TOKEN_BALANCES_CONCURRENCY=
# INDEXER_TX_ACTIONS_ENABLE=
# INDEXER_TX_ACTIONS_MAX_TOKEN_CACHE_SIZE=
# INDEXER_TX_ACTIONS_REINDEX_FIRST_BLOCK=
# INDEXER_TX_ACTIONS_REINDEX_LAST_BLOCK=
# INDEXER_TX_ACTIONS_REINDEX_PROTOCOLS=
# INDEXER_TX_ACTIONS_AAVE_V3_POOL_CONTRACT=
# INDEXER_POLYGON_EDGE_L1_RPC=
# INDEXER_POLYGON_EDGE_L1_EXIT_HELPER_CONTRACT=
# INDEXER_POLYGON_EDGE_L1_WITHDRAWALS_START_BLOCK=
# INDEXER_POLYGON_EDGE_L1_STATE_SENDER_CONTRACT=
# INDEXER_POLYGON_EDGE_L1_DEPOSITS_START_BLOCK=
# INDEXER_POLYGON_EDGE_L2_STATE_SENDER_CONTRACT=
# INDEXER_POLYGON_EDGE_L2_WITHDRAWALS_START_BLOCK=
# INDEXER_POLYGON_EDGE_L2_STATE_RECEIVER_CONTRACT=
# INDEXER_POLYGON_EDGE_L2_DEPOSITS_START_BLOCK=
# INDEXER_POLYGON_EDGE_ETH_GET_LOGS_RANGE_SIZE=
# INDEXER_REALTIME_FETCHER_MAX_GAP=
# INDEXER_FETCHER_INIT_QUERY_LIMIT=
# INDEXER_TOKEN_BALANCES_FETCHER_INIT_QUERY_LIMIT=
# INDEXER_COIN_BALANCES_FETCHER_INIT_QUERY_LIMIT=
# INDEXER_DISABLE_WITHDRAWALS_FETCHER=
# WITHDRAWALS_FIRST_BLOCK=
# TOKEN_ID_MIGRATION_FIRST_BLOCK=
# TOKEN_ID_MIGRATION_CONCURRENCY=
# TOKEN_ID_MIGRATION_BATCH_SIZE=
# INDEXER_INTERNAL_TRANSACTIONS_TRACER_TYPE=
# WEBAPP_URL=
# API_URL=
SHOW_ADDRESS_MARKETCAP_PERCENTAGE=true
CHECKSUM_ADDRESS_HASHES=true
CHECKSUM_FUNCTION=eth
DISABLE_EXCHANGE_RATES=true
TXS_STATS_ENABLED=true
SHOW_PRICE_CHART=false
SHOW_PRICE_CHART_LEGEND=false
SHOW_TXS_CHART=true
TXS_HISTORIAN_INIT_LAG=0
TXS_STATS_DAYS_TO_COMPILE_AT_INIT=10
COIN_BALANCE_HISTORY_DAYS=90
APPS_MENU=true
EXTERNAL_APPS=[]
# GAS_PRICE=
# RESTRICTED_LIST=
# RESTRICTED_LIST_KEY=
SHOW_MAINTENANCE_ALERT=false
MAINTENANCE_ALERT_MESSAGE=
SOURCIFY_INTEGRATION_ENABLED=false
SOURCIFY_SERVER_URL=
SOURCIFY_REPO_URL=
MAX_SIZE_UNLESS_HIDE_ARRAY=50
HIDE_BLOCK_MINER=false
DISPLAY_TOKEN_ICONS=false
SHOW_TENDERLY_LINK=false
TENDERLY_CHAIN_PATH=
RE_CAPTCHA_SECRET_KEY=
RE_CAPTCHA_CLIENT_KEY=
RE_CAPTCHA_V3_SECRET_KEY=
RE_CAPTCHA_V3_CLIENT_KEY=
RE_CAPTCHA_DISABLED=false
JSON_RPC=
#API_RATE_LIMIT_DISABLED=true
API_RATE_LIMIT_TIME_INTERVAL=1s
API_RATE_LIMIT_BY_IP_TIME_INTERVAL=5m
API_RATE_LIMIT=50
API_RATE_LIMIT_BY_KEY=50
API_RATE_LIMIT_BY_WHITELISTED_IP=50
API_RATE_LIMIT_WHITELISTED_IPS=
API_RATE_LIMIT_STATIC_API_KEY=
API_RATE_LIMIT_UI_V2_WITH_TOKEN=5
API_RATE_LIMIT_BY_IP=3000
# API_RATE_LIMIT_HAMMER_REDIS_URL=redis://redis_db:6379/1
# API_RATE_LIMIT_IS_BLOCKSCOUT_BEHIND_PROXY=false
API_RATE_LIMIT_UI_V2_TOKEN_TTL_IN_SECONDS=18000
FETCH_REWARDS_WAY=trace_block
MICROSERVICE_SC_VERIFIER_ENABLED=true
#MICROSERVICE_SC_VERIFIER_URL=http://smart-contract-verifier:8050/
#MICROSERVICE_SC_VERIFIER_TYPE=sc_verifier
MICROSERVICE_SC_VERIFIER_URL=https://eth-bytecode-db.services.blockscout.com/
0x416e746f6e marked this conversation as resolved.
Show resolved Hide resolved
MICROSERVICE_SC_VERIFIER_TYPE=eth_bytecode_db
MICROSERVICE_ETH_BYTECODE_DB_INTERVAL_BETWEEN_LOOKUPS=10m
#MICROSERVICE_VISUALIZE_SOL2UML_ENABLED=true
#MICROSERVICE_VISUALIZE_SOL2UML_URL=http://visualizer:8050/
#MICROSERVICE_SIG_PROVIDER_ENABLED=true
#MICROSERVICE_SIG_PROVIDER_URL=http://sig-provider:8050/
DECODE_NOT_A_CONTRACT_CALLS=true
# DATABASE_READ_ONLY_API_URL=
# ACCOUNT_DATABASE_URL=
# ACCOUNT_POOL_SIZE=
# ACCOUNT_AUTH0_DOMAIN=
# ACCOUNT_AUTH0_CLIENT_ID=
# ACCOUNT_AUTH0_CLIENT_SECRET=
# ACCOUNT_PUBLIC_TAGS_AIRTABLE_URL=
# ACCOUNT_PUBLIC_TAGS_AIRTABLE_API_KEY=
# ACCOUNT_SENDGRID_API_KEY=
# ACCOUNT_SENDGRID_SENDER=
# ACCOUNT_SENDGRID_TEMPLATE=
ACCOUNT_CLOAK_KEY=
ACCOUNT_ENABLED=false
#ACCOUNT_REDIS_URL=redis://redis_db:6379
# MIXPANEL_TOKEN=
# MIXPANEL_URL=
# AMPLITUDE_API_KEY=
# AMPLITUDE_URL=
EIP_1559_ELASTICITY_MULTIPLIER=2
# API_SENSITIVE_ENDPOINTS_KEY=
# ACCOUNT_VERIFICATION_EMAIL_RESEND_INTERVAL=
# INDEXER_TOKEN_INSTANCE_RETRY_BATCH_SIZE=10
# INDEXER_TOKEN_INSTANCE_REALTIME_BATCH_SIZE=1
# INDEXER_TOKEN_INSTANCE_SANITIZE_BATCH_SIZE=10
API_V2_ENABLED=true
# INDEXER_TOKEN_INSTANCE_LEGACY_SANITIZE_BATCH_SIZE=10
# TOKEN_INSTANCE_OWNER_MIGRATION_CONCURRENCY=5
# TOKEN_INSTANCE_OWNER_MIGRATION_BATCH_SIZE=50
SUAVE_BID_CONTRACTS=0x8f21fdd6b4f4cacd33151777a46c122797c8bf17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question:

what are these contract(s)? are they relevant for SUAVE?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this an address of the SUAVE contract which emits BidEvent event in devnet afaik

27 changes: 27 additions & 0 deletions suave/devenv/blockscout/envs/common-frontend.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
NEXT_PUBLIC_API_HOST=localhost
NEXT_PUBLIC_API_PORT=8080
NEXT_PUBLIC_API_PROTOCOL=http
NEXT_PUBLIC_STATS_API_HOST=http://localhost:8081
NEXT_PUBLIC_NETWORK_NAME=SUAVE
NEXT_PUBLIC_NETWORK_SHORT_NAME=SUAVE
NEXT_PUBLIC_NETWORK_ID=5
NEXT_PUBLIC_NETWORK_CURRENCY_NAME=Ether
NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL=ETH
NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS=18
NEXT_PUBLIC_API_BASE_PATH=/
NEXT_PUBLIC_APP_HOST=localhost
NEXT_PUBLIC_APP_PROTOCOL=http
NEXT_PUBLIC_HOMEPAGE_CHARTS=['daily_txs']
NEXT_PUBLIC_IS_TESTNET=true
NEXT_PUBLIC_IS_SUAVE_CHAIN=true
NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL=ws
NEXT_PUBLIC_NETWORK_LOGO=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-logos/suave-light.png
NEXT_PUBLIC_NETWORK_LOGO_DARK=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-logos/suave-light.png
NEXT_PUBLIC_NETWORK_ICON=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-icons/suave-short.png
NEXT_PUBLIC_NETWORK_ICON_DARK=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-icons/suave-short.png
NEXT_PUBLIC_HOMEPAGE_PLATE_BACKGROUND=rgba(46, 46, 46, 1)
NEXT_PUBLIC_HOMEPAGE_PLATE_TEXT_COLOR=rgba(48, 210, 248, 1)
NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml
NEXT_PUBLIC_OG_IMAGE_URL=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/og-images/suave-testnet.png
NEXT_PUBLIC_AD_BANNER_PROVIDER=none
NEXT_PUBLIC_AD_TEXT_PROVIDER=none
27 changes: 27 additions & 0 deletions suave/devenv/blockscout/envs/common-stats.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Those are examples of existing configuration variables and their default values.
# When uncommented, they would overwrite corresponding values from `base.toml`
# configuration file.

STATS__SERVER__HTTP__ENABLED=true
STATS__SERVER__HTTP__ADDR=0.0.0.0:8050
STATS__SERVER__HTTP__MAX_BODY_SIZE=2097152

STATS__SERVER__GRPC__ENABLED=false
STATS__SERVER__GRPC__ADDR=0.0.0.0:8051

STATS__DB_URL=
STATS__BLOCKSCOUT_DB_URL=
STATS__CREATE_DATABASE=false
STATS__RUN_MIGRATIONS=false
STATS__DEFAULT_SCHEDULE=0 0 1 * * * *
STATS__FORCE_UPDATE_ON_START=false

STATS__METRICS__ENABLED=false
STATS__METRICS__ADDR=0.0.0.0:6060
STATS__METRICS__ROUTE=/metrics

STATS__JAEGER__ENABLED=false
STATS__JAEGER__AGENT_ENDPOINT=localhost:6831

STATS__TRACING__ENABLED=true
STATS__TRACING__FORMAT=default
57 changes: 57 additions & 0 deletions suave/devenv/blockscout/proxy/default.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
map $http_upgrade $connection_upgrade {

default upgrade;
'' close;
}

server {
listen 8080;
server_name localhost;
proxy_http_version 1.1;

location ~ ^/(api|socket|sitemap.xml|auth/auth0|auth/auth0/callback|auth/logout) {
proxy_pass ${BACK_PROXY_PASS};
proxy_http_version 1.1;
proxy_set_header Host "$host";
proxy_set_header X-Real-IP "$remote_addr";
proxy_set_header X-Forwarded-For "$proxy_add_x_forwarded_for";
proxy_set_header X-Forwarded-Proto "$scheme";
proxy_set_header Upgrade "$http_upgrade";
proxy_set_header Connection $connection_upgrade;
proxy_cache_bypass $http_upgrade;
}
location / {
proxy_pass ${FRONT_PROXY_PASS};
proxy_http_version 1.1;
proxy_set_header Host "$host";
proxy_set_header X-Real-IP "$remote_addr";
proxy_set_header X-Forwarded-For "$proxy_add_x_forwarded_for";
proxy_set_header X-Forwarded-Proto "$scheme";
proxy_set_header Upgrade "$http_upgrade";
proxy_set_header Connection $connection_upgrade;
proxy_cache_bypass $http_upgrade;
}
}

server {
listen 8081;
server_name localhost;
proxy_http_version 1.1;
proxy_hide_header Access-Control-Allow-Origin;
proxy_hide_header Access-Control-Allow-Methods;
add_header 'Access-Control-Allow-Origin' 'http://localhost:8080' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'PUT, GET, POST, OPTIONS, DELETE, PATCH' always;

location / {
proxy_pass http://blockscout-stats:8050/;
proxy_http_version 1.1;
proxy_set_header Host "$host";
proxy_set_header X-Real-IP "$remote_addr";
proxy_set_header X-Forwarded-For "$proxy_add_x_forwarded_for";
proxy_set_header X-Forwarded-Proto "$scheme";
proxy_set_header Upgrade "$http_upgrade";
proxy_set_header Connection $connection_upgrade;
proxy_cache_bypass $http_upgrade;
}
}
13 changes: 13 additions & 0 deletions suave/devenv/blockscout/services/docker-compose-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.8'

services:
blockscout-backend:
image: blockscout/blockscout-suave:${DOCKER_TAG:-5.3.1}
pull_policy: always
restart: always
container_name: 'blockscout-backend'
command: sh -c "bin/blockscout eval \"Elixir.Explorer.ReleaseTasks.create_and_migrate()\" && bin/blockscout start"
env_file:
- ../envs/common-blockscout.env
volumes:
- ./logs/:/app/logs/
Loading