|
|
@ -11,9 +11,14 @@ defmodule Explorer.ChainSpec.GenesisData do |
|
|
|
|
|
|
|
|
|
|
|
@interval :timer.minutes(2) |
|
|
|
@interval :timer.minutes(2) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def start_link(opts) do |
|
|
|
|
|
|
|
GenServer.start_link(__MODULE__, opts, name: __MODULE__) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@impl GenServer |
|
|
|
@impl GenServer |
|
|
|
def init(_) do |
|
|
|
def init(_) do |
|
|
|
:timer.send_interval(@interval, :import) |
|
|
|
:timer.send_interval(@interval, :import) |
|
|
|
|
|
|
|
Process.send_after(self(), :import, @interval) |
|
|
|
|
|
|
|
|
|
|
|
{:ok, %{}} |
|
|
|
{:ok, %{}} |
|
|
|
end |
|
|
|
end |
|
|
@ -58,6 +63,8 @@ defmodule Explorer.ChainSpec.GenesisData do |
|
|
|
|
|
|
|
|
|
|
|
{:ok, _} = Importer.import_genesis_coin_balances(chain_spec) |
|
|
|
{:ok, _} = Importer.import_genesis_coin_balances(chain_spec) |
|
|
|
end) |
|
|
|
end) |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
Logger.warn(fn -> "Failed to fetch genesis data. Chain spec path is not set." end) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|