 
   defp reload_interval, do: 20*1000 # TODO from config
 
-  @agent_name String.to_atom(Atom.to_string(__MODULE__) <> ".Agent")
   @tasksup_name String.to_atom(Atom.to_string(__MODULE__) <> ".TaskSup")
 
   ## Client API

  ## Private

  defp retrieve(key) do
    @agent_name
    |> Agent.get(&Map.get(&1, key))
  end

  defp store(value, key) do
    @agent_name
    |> Agent.update(&Map.put(&1, key, value))
  end

  defp add_to_pkh({:ok, pkh}, txn_id) do
    @agent_name
    |> Agent.get_and_update(fn(map) ->
      map |> Map.get_and_update(:pkh_index, fn(index) ->
        index
        |> Map.get_and_update(pkh, fn(set) -> {set, set |> add(txn_id)} end)
      end)
    end)
  end
  defp add_to_pkh({:error, _}, _txn_id), do: nil


      block_cnt = :rpc |> Gold.getblockcount!
      Logger.info("Explorer.Repo: RPC connection initialized (reload_interval: " <> Integer.to_string(reload_interval) <> ")")
      # Init the asset storage agent (TODO: persistent storage)
      :ets.new(:pkh_index, [:set, :public, :named_table])
      store(block_cnt - 3000, :low_cnt)
      store(block_cnt - 3000, :high_cnt)
      # Init the task supervisor
      Task.Supervisor.start_link(name: @tasksup_name)
      # Initial blockchain parse (TODO: persistent storage)
