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/mix/tasks/scrape.receipts.ex

25 lines
552 B

defmodule Mix.Tasks.Scrape.Receipts do
@moduledoc "Scrapes blocks from web3"
use Mix.Task
alias Explorer.Repo
alias Explorer.SkippedReceipts
alias Explorer.ReceiptImporter
def run([]), do: run(1)
def run(count) do
[:postgrex, :ecto, :ethereumex, :tzdata]
|> Enum.each(&Application.ensure_all_started/1)
Repo.start_link()
"#{count}"
|> String.to_integer()
|> SkippedReceipts.first()
|> Enum.shuffle()
|> Flow.from_enumerable()
|> Flow.map(&ReceiptImporter.import/1)
|> Enum.to_list()
end
end