block_rate -> block_interval

block_rate is measured in milliseconds / block, but a rate would blocks
/ unit-time, so rename block_rate to block_interval to reflect it is the
interval between blocks.
pull/439/head
Luke Imhoff 6 years ago
parent 8eccd7adde
commit fe49a753d3
  1. 2
      apps/indexer/config/dev/geth.exs
  2. 2
      apps/indexer/config/dev/parity.exs
  3. 2
      apps/indexer/config/prod/geth.exs
  4. 2
      apps/indexer/config/prod/parity.exs
  5. 7
      apps/indexer/lib/indexer/block_fetcher.ex

@ -1,7 +1,7 @@
use Mix.Config
config :indexer,
block_rate: 5_000,
block_interval: 5_000,
json_rpc_named_arguments: [
transport: EthereumJSONRPC.HTTP,
transport_options: [

@ -1,7 +1,7 @@
use Mix.Config
config :indexer,
block_rate: 5_000,
block_interval: 5_000,
json_rpc_named_arguments: [
transport: EthereumJSONRPC.HTTP,
transport_options: [

@ -1,7 +1,7 @@
use Mix.Config
config :indexer,
block_rate: 5_000,
block_interval: 5_000,
json_rpc_named_arguments: [
transport: EthereumJSONRPC.HTTP,
transport_options: [

@ -1,7 +1,7 @@
use Mix.Config
config :indexer,
block_rate: 5_000,
block_interval: 5_000,
json_rpc_named_arguments: [
transport: EthereumJSONRPC.HTTP,
transport_options: [

@ -23,7 +23,7 @@ defmodule Indexer.BlockFetcher do
@blocks_concurrency 10
# milliseconds
@block_rate 5_000
@block_interval 5_000
@receipts_batch_size 250
@receipts_concurrency 10
@ -45,7 +45,8 @@ defmodule Indexer.BlockFetcher do
Defaults to #{@blocks_concurrency}. So upto `blocks_concurrency * block_batch_size` (defaults to
`#{@blocks_concurrency * @blocks_batch_size}`) blocks can be requested from the JSONRPC at once over all
connections.
* `:block_rate` - The millisecond rate new blocks are published at. Defaults to `#{@block_rate}` milliseconds.
* `:block_interval` - The number of milliseconds between new blocks being published. Defaults to
`#{@block_interval}` milliseconds.
* `:receipts_batch_size` - The number of receipts to request in one call to the JSONRPC. Defaults to
`#{@receipts_batch_size}`. Receipt requests also include the logs for when the transaction was collated into the
block. *These logs are not paginated.*
@ -70,7 +71,7 @@ defmodule Indexer.BlockFetcher do
json_rpc_named_arguments: Keyword.fetch!(opts, :json_rpc_named_arguments),
genesis_task: nil,
realtime_task: nil,
realtime_interval: opts[:block_rate] || @block_rate,
realtime_interval: opts[:block_interval] || @block_interval,
starting_block_number: nil,
blocks_batch_size: Keyword.get(opts, :blocks_batch_size, @blocks_batch_size),
blocks_concurrency: Keyword.get(opts, :blocks_concurrency, @blocks_concurrency),

Loading…
Cancel
Save