Stages will be between Import and the Import.Runner. Unlike Runners,
which use 1 common Ecto.Multi, a Stage can produce 1 or more independent
Ecto.Multi that will run in separate transactions. This allows
addresses to be chunked into separate transactions, which releases the
locks between transactions unlike the INSERT-level chunking that was all
in 1 transaction.
For each fetcher set the `Logger.metadata(fetcher: ...)` to a short
semantic name.
For Fetchers that use `BufferedTask`, `BufferedTask` now has an option
to set `metadata` passed to `Logger.metadata/1` in
1. GenServer process
2. The `c:init/3` Task
3. The `c:run/2` Tasks
Have a separate subtree for each fetcher with a supervisor supervising
the fetcher and a Task.Supervisor that is only used by the fetcher, so
that looking at the Task.Supervisor in that subtree will show which
fetcher is causing any memory, message, or blocking problems.
Why:
* For users to be able to get the transactions for a given address hash.
Support for optional parameters will be added in an upcoming PR.
* Issue link: https://github.com/poanetwork/poa-explorer/issues/138
This change addresses the need by:
* Adding `Explorer.Etherscan` context, where we want to keep
etherscan-only logic within the Explorer app. This is because we want to
mimic the way their RPC API works. The only function in this module for
now is `list_transactions/1`, which gets all transactions for a given
address hash.
* Adding `txlist/2` action to `API.RPC.AddressController`, to handle
account transactions requests.
Example usage:
```
api?module=account&action=txlist \
&address=0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a
```
* Editing `API.RPC.AddressView` and `API.RPC.RPCView` to format
responses for new API endpoint as required.
* Editing `.credo.exs` to allow for `Hash.Address.t()` alias usage in
`Explorer.Etherscan` without Credo complaining with:
```
Software Design
┃
┃ [D] ↓ Nested modules could be aliased at the top of the invoking module.
┃ apps/explorer/lib/explorer/etherscan.ex:19:51
```
* Fix bug when restarting index from lst block
* Include tests for block sequencer
* Check for new blocks periodically after indexing
Co-authored-by: Alex Garibay <alex@alexgaribay.com>
Co-authored-by: Luke Imhoff <luke.imhoff@dockyard.com>
Note: deployment jobs are filtered by branch, so deploy_staging won't be
tested until the merge to master and deploy_production won't be tested
until the merge to production.