Add INDEXER_TX_ACTIONS_ENABLE env variable

pull/6582/head
POA 2 years ago
parent 0dc8cffaa3
commit be99681177
  1. 2
      apps/indexer/lib/indexer/supervisor.ex
  2. 4
      apps/indexer/lib/indexer/transform/transaction_actions.ex
  3. 3
      config/runtime.exs
  4. 1
      docker-compose/envs/common-blockscout.env
  5. 3
      docker/Makefile

@ -121,7 +121,7 @@ defmodule Indexer.Supervisor do
[
[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]
]},
{TransactionAction.Supervisor, [[memory_monitor: memory_monitor]]},
configure(TransactionAction.Supervisor, [[memory_monitor: memory_monitor]]),
{ContractCode.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{TokenBalance.Supervisor,

@ -99,6 +99,7 @@ defmodule Indexer.Transform.TransactionActions do
Returns a list of transaction actions given a list of logs.
"""
def parse(logs, protocols_to_rewrite \\ []) do
if Application.get_env(:indexer, Indexer.Fetcher.TransactionAction.Supervisor)[:enabled] do
actions = []
chain_id = NetVersion.get_version()
@ -131,6 +132,9 @@ defmodule Indexer.Transform.TransactionActions do
end
%{transaction_actions: tx_actions}
else
%{transaction_actions: []}
end
end
defp uniswap(logs_grouped, actions, chain_id) do

@ -432,6 +432,9 @@ config :indexer,
trace_last_block: System.get_env("TRACE_LAST_BLOCK") || "",
fetch_rewards_way: System.get_env("FETCH_REWARDS_WAY", "trace_block")
config :indexer, Indexer.Fetcher.TransactionAction.Supervisor,
enabled: System.get_env("INDEXER_TX_ACTIONS_ENABLE", "false") == "true"
config :indexer, Indexer.Fetcher.TransactionAction,
reindex_first_block: System.get_env("INDEXER_TX_ACTIONS_REINDEX_FIRST_BLOCK"),
reindex_last_block: System.get_env("INDEXER_TX_ACTIONS_REINDEX_LAST_BLOCK"),

@ -90,6 +90,7 @@ INDEXER_DISABLE_INTERNAL_TRANSACTIONS_FETCHER=false
# INDEXER_COIN_BALANCES_CONCURRENCY=
# INDEXER_RECEIPTS_BATCH_SIZE=
# INDEXER_RECEIPTS_CONCURRENCY=
# INDEXER_TX_ACTIONS_ENABLE=
# INDEXER_TX_ACTIONS_MAX_TOKEN_CACHE_SIZE=
# INDEXER_TX_ACTIONS_REINDEX_FIRST_BLOCK=
# INDEXER_TX_ACTIONS_REINDEX_LAST_BLOCK=

@ -487,6 +487,9 @@ endif
ifdef TOKEN_ID_MIGRATION_BATCH_SIZE
BLOCKSCOUT_CONTAINER_PARAMS += -e 'TOKEN_ID_MIGRATION_BATCH_SIZE=$(TOKEN_ID_MIGRATION_BATCH_SIZE)'
endif
ifdef INDEXER_TX_ACTIONS_ENABLE
BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_TX_ACTIONS_ENABLE=$(INDEXER_TX_ACTIONS_ENABLE)'
endif
ifdef INDEXER_TX_ACTIONS_MAX_TOKEN_CACHE_SIZE
BLOCKSCOUT_CONTAINER_PARAMS += -e 'INDEXER_TX_ACTIONS_MAX_TOKEN_CACHE_SIZE=$(INDEXER_TX_ACTIONS_MAX_TOKEN_CACHE_SIZE)'
endif

Loading…
Cancel
Save