Merge branch 'master' into ab-aggregate-token-transfers

pull/2477/head
Ayrat Badykov 5 years ago committed by GitHub
commit 3d7102cb20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 24
      .circleci/config.yml
  2. 4
      .tool-versions
  3. 3
      CHANGELOG.md
  4. 1
      PULL_REQUEST_TEMPLATE.md
  5. 3
      apps/indexer/config/config.exs
  6. 18
      apps/indexer/lib/indexer/block/catchup/fetcher.ex
  7. 1
      docs/env-variables.md

@ -3,7 +3,7 @@ jobs:
build: build:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
- image: circleci/elixir:1.9.0-node-browsers - image: circleci/elixir:1.9.1-node-browsers
environment: environment:
MIX_ENV: test MIX_ENV: test
# match POSTGRES_PASSWORD for postgres image below # match POSTGRES_PASSWORD for postgres image below
@ -129,7 +129,7 @@ jobs:
check_formatted: check_formatted:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
- image: circleci/elixir:1.9.0 - image: circleci/elixir:1.9.1
environment: environment:
MIX_ENV: test MIX_ENV: test
@ -143,7 +143,7 @@ jobs:
credo: credo:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
- image: circleci/elixir:1.9.0 - image: circleci/elixir:1.9.1
environment: environment:
MIX_ENV: test MIX_ENV: test
@ -177,7 +177,7 @@ jobs:
dialyzer: dialyzer:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
- image: circleci/elixir:1.9.0 - image: circleci/elixir:1.9.1
environment: environment:
MIX_ENV: test MIX_ENV: test
@ -247,7 +247,7 @@ jobs:
gettext: gettext:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
- image: circleci/elixir:1.9.0 - image: circleci/elixir:1.9.1
environment: environment:
MIX_ENV: test MIX_ENV: test
@ -286,7 +286,7 @@ jobs:
release: release:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
- image: circleci/elixir:1.9.0 - image: circleci/elixir:1.9.1
environment: environment:
MIX_ENV: prod MIX_ENV: prod
@ -312,7 +312,7 @@ jobs:
sobelow: sobelow:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
- image: circleci/elixir:1.9.0 - image: circleci/elixir:1.9.1
environment: environment:
MIX_ENV: test MIX_ENV: test
@ -336,7 +336,7 @@ jobs:
test_geth_http_websocket: test_geth_http_websocket:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
- image: circleci/elixir:1.9.0-node-browsers - image: circleci/elixir:1.9.1-node-browsers
environment: environment:
MIX_ENV: test MIX_ENV: test
# match POSTGRES_PASSWORD for postgres image below # match POSTGRES_PASSWORD for postgres image below
@ -390,7 +390,7 @@ jobs:
test_geth_mox: test_geth_mox:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
- image: circleci/elixir:1.9.0-node-browsers - image: circleci/elixir:1.9.1-node-browsers
environment: environment:
MIX_ENV: test MIX_ENV: test
# match POSTGRES_PASSWORD for postgres image below # match POSTGRES_PASSWORD for postgres image below
@ -444,7 +444,7 @@ jobs:
test_parity_http_websocket: test_parity_http_websocket:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
- image: circleci/elixir:1.9.0-node-browsers - image: circleci/elixir:1.9.1-node-browsers
environment: environment:
MIX_ENV: test MIX_ENV: test
# match POSTGRES_PASSWORD for postgres image below # match POSTGRES_PASSWORD for postgres image below
@ -498,7 +498,7 @@ jobs:
test_parity_mox: test_parity_mox:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
- image: circleci/elixir:1.9.0-node-browsers - image: circleci/elixir:1.9.1-node-browsers
environment: environment:
MIX_ENV: test MIX_ENV: test
# match POSTGRES_PASSWORD for postgres image below # match POSTGRES_PASSWORD for postgres image below
@ -552,7 +552,7 @@ jobs:
coveralls_merge: coveralls_merge:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
- image: circleci/elixir:1.9.0 - image: circleci/elixir:1.9.1
environment: environment:
MIX_ENV: test MIX_ENV: test

@ -1,3 +1,3 @@
elixir 1.9 elixir 1.9.1-otp-22
erlang 21.0.4 erlang 22.0
nodejs 10.11.0 nodejs 10.11.0

@ -2,13 +2,16 @@
### Features ### Features
- [#2477](https://github.com/poanetwork/blockscout/pull/2477) - aggregate token transfers on transaction page - [#2477](https://github.com/poanetwork/blockscout/pull/2477) - aggregate token transfers on transaction page
- [#2458](https://github.com/poanetwork/blockscout/pull/2458) - Add LAST_BLOCK var to add ability indexing in the range of blocks
- [#2456](https://github.com/poanetwork/blockscout/pull/2456) - fetch pending transactions for geth - [#2456](https://github.com/poanetwork/blockscout/pull/2456) - fetch pending transactions for geth
### Fixes ### Fixes
- [#2496](https://github.com/poanetwork/blockscout/pull/2496) - fix docker build
- [#2459](https://github.com/poanetwork/blockscout/pull/2459) - fix top addresses query - [#2459](https://github.com/poanetwork/blockscout/pull/2459) - fix top addresses query
- [#2425](https://github.com/poanetwork/blockscout/pull/2425) - Force to show address view for checksummed address even if it is not in DB - [#2425](https://github.com/poanetwork/blockscout/pull/2425) - Force to show address view for checksummed address even if it is not in DB
### Chore ### Chore
- [#2402](https://github.com/poanetwork/blockscout/pull/2402) - bump otp version to 22.0
- [#2432](https://github.com/poanetwork/blockscout/pull/2432) - bump credo version - [#2432](https://github.com/poanetwork/blockscout/pull/2432) - bump credo version
- [#2457](https://github.com/poanetwork/blockscout/pull/2457) - update mix.lock - [#2457](https://github.com/poanetwork/blockscout/pull/2457) - update mix.lock
- [#2435](https://github.com/poanetwork/blockscout/pull/2435) - Replace deprecated extract-text-webpack-plugin with mini-css-extract-plugin - [#2435](https://github.com/poanetwork/blockscout/pull/2435) - Replace deprecated extract-text-webpack-plugin with mini-css-extract-plugin

@ -35,3 +35,4 @@
- [ ] If I added new functionality, I added tests covering it. - [ ] If I added new functionality, I added tests covering it.
- [ ] If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again. - [ ] If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
- [ ] I checked whether I should update the docs and did so if necessary - [ ] I checked whether I should update the docs and did so if necessary
- [ ] If I added/changed/removed ENV var, I should update the list of env vars in https://github.com/poanetwork/blockscout/blob/master/docs/env-variables.md to reflect changes in the table here https://poanetwork.github.io/blockscout/#/env-variables?id=blockscout-env-variables

@ -35,7 +35,8 @@ config :indexer,
String.to_integer(System.get_env("TOKEN_METADATA_UPDATE_INTERVAL") || "#{2 * 24 * 60 * 60}"), String.to_integer(System.get_env("TOKEN_METADATA_UPDATE_INTERVAL") || "#{2 * 24 * 60 * 60}"),
# bytes # bytes
memory_limit: 1 <<< 30, memory_limit: 1 <<< 30,
first_block: System.get_env("FIRST_BLOCK") || "0" first_block: System.get_env("FIRST_BLOCK") || "0",
last_block: System.get_env("LAST_BLOCK") || ""
# config :indexer, Indexer.Fetcher.ReplacedTransaction.Supervisor, disabled?: true # config :indexer, Indexer.Fetcher.ReplacedTransaction.Supervisor, disabled?: true
# config :indexer, Indexer.Fetcher.BlockReward.Supervisor, disabled?: true # config :indexer, Indexer.Fetcher.BlockReward.Supervisor, disabled?: true

@ -72,7 +72,14 @@ defmodule Indexer.Block.Catchup.Fetcher do
) do ) do
Logger.metadata(fetcher: :block_catchup) Logger.metadata(fetcher: :block_catchup)
{:ok, latest_block_number} = EthereumJSONRPC.fetch_block_number_by_tag("latest", json_rpc_named_arguments) {:ok, latest_block_number} =
case latest_block() do
nil ->
EthereumJSONRPC.fetch_block_number_by_tag("latest", json_rpc_named_arguments)
number ->
{:ok, number}
end
case latest_block_number do case latest_block_number do
# let realtime indexer get the genesis block # let realtime indexer get the genesis block
@ -337,4 +344,13 @@ defmodule Indexer.Block.Catchup.Fetcher do
_ -> 0 _ -> 0
end end
end end
defp latest_block do
string_value = Application.get_env(:indexer, :last_block)
case Integer.parse(string_value) do
{integer, ""} -> integer
_ -> nil
end
end
end end

@ -48,6 +48,7 @@ $ export NETWORK=POA
| `BLOCK_TRANSFORMER` | | Transformer for blocks: base or clique. | base | v1.3.4+ | | `BLOCK_TRANSFORMER` | | Transformer for blocks: base or clique. | base | v1.3.4+ |
| `GRAPHIQL _TRANSACTION` | | Default transaction in query to GraphiQL. | (empty) | v1.3.4+ | | `GRAPHIQL _TRANSACTION` | | Default transaction in query to GraphiQL. | (empty) | v1.3.4+ |
| `FIRST_BLOCK` | | The block number, where indexing begins from. | 0 | v1.3.8+ | | `FIRST_BLOCK` | | The block number, where indexing begins from. | 0 | v1.3.8+ |
| `LAST_BLOCK` | | The block number, where indexing stops. | (empty) | master |
| `TXS_COUNT_CACHE_PERIOD` | | Interval in seconds to restart the task, which calculates the total txs count. | 60 * 60 * 2 | v1.3.9+ | | `TXS_COUNT_CACHE_PERIOD` | | Interval in seconds to restart the task, which calculates the total txs count. | 60 * 60 * 2 | v1.3.9+ |
| `ADDRESS_WITH_BALANCES` <br /> `_UPDATE_INTERVAL`| | Interval in seconds to restart the task, which calculates addresses with balances. | 30 * 60 | v1.3.9+ | | `ADDRESS_WITH_BALANCES` <br /> `_UPDATE_INTERVAL`| | Interval in seconds to restart the task, which calculates addresses with balances. | 30 * 60 | v1.3.9+ |
| `LINK_TO_OTHER_EXPLORERS` | | true/false. If true, links to other explorers are added in the footer | (empty) | v1.3.0+ | | `LINK_TO_OTHER_EXPLORERS` | | true/false. If true, links to other explorers are added in the footer | (empty) | v1.3.0+ |

Loading…
Cancel
Save