mana-ethereum/ethereumex

infinite timeout does not work

Closed this issue · 2 comments

I am trying the following configs:

config :ethereumex,
  url: "https://mainnet.infura.io/v3/MY_KEY",
  request_timeout: :infinity

But I get the following response:

{: error, :timeout}

for some requests. Is this response coming from Infura?

In order to get through this, I think I will have to keep making the same call until I get {:ok, response}. Is this the suggested way?

@roynalnaruto ethereumex returns results from a node. we can implement some king of retry logic. what do you think?

Yes, I did that. Here is my snippet for that:

defp fetch_info do
  with {:ok, info} <-
         ExW3.Contract.call(:my_contract, :myFunctionInContract) do
    # do something with info and return
  else
    {:error, _} -> fetch_info()
  end
end