Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
blockscout/lib/explorer/latest_block.ex

16 lines
300 B

defmodule Explorer.LatestBlock do
alias Explorer.Fetcher
import Ethereumex.HttpClient, only: [eth_block_number: 0]
@moduledoc false
def fetch do
get_latest_block() |> Fetcher.fetch
end
def get_latest_block do
{:ok, block_number} = eth_block_number()
block_number
end
end