This is an Ethereum block explorer designed to be run locally with an archive node companion, more specifically, with [Erigon](https://github.com/ledgerwatch/erigon).
This approach brings many advantages, as follows.
### Privacy
You are querying your own node, so you are not sending your IP address or queries to an external third-party node.
### Fast
Since you are querying your local archive node, everything is fast, no network roundtrips are necessary.
### Actually, very fast
This software was designed to be a companion of Erigon, a blazingly fast archive node.
### Really, it is even faster
The standard web3 jsonrpc methods are quite verbose and generic requiring many calls to gather many pieces of information at client side.
We've implemented some custom methods at rpcdaemon level, less information is needed to be json-marshalled and transmitted over network.
Current offerings are either closed source or lack many features the most famous Ethereum block explorer has, or simply have high requirements like having an archive node + additional indexers.
Otterscan requires only mainline Erigon executing node, patched Erigon RPC daemon and running Otterscan itself (a simple React app), which makes it a laptop-friendly block explorer.
- It is heavily based on Erigon, whose mascot is an otter (Erigon, the otter), think about an otter scanning your transactions inside blocks.
- It is an homage to the most famous and used ethereum block explorer.
- The author loves wordplays and bad puns.
## It looks familiar...
The UI was intentionally made very similar to the most popular Ethereum block explorer so users do not strugle trying to find where the information is.
However, you will see that we made many UI improvements.
## Install instructions
This software is currently available as compile-only form.
It depends heavily on a working Erigon installation with Otterscan patches applied, so let's begin with it first.
You will need an Erigon executing node (`erigon`). Also you will need Erigon RPC daemon (`rpcdaemon`) with Otterscan patches. Since setting up an Erigon environment itself can take some work, make sure to follow their instructions and have a working archive node before continuing.
Checkout the tag corresponding to the stable version you are running. For each supported Erigon version, there should be a corresponding tag containing Otterscan patches.
For example, if you are running Erigon from `v2021.07.01` tag, checkout the tag `v2021.07.01-otterscan` and rebuild `rpcdaemon`.
We intend to release a compatible rebased version containig our changes every week just after Erigon's weekly release, as time permits.
Clone Otterscan repo and its submodules. Checkout the tag corresponding to your Erigon + Otterscan patches. It uses the same version tag from Erigon + Otterscan repo, i.e., if you built the `v2021.07.01-otterscan`, you should build the `v2021.07.01-otterscan` of Otterscan.
- The app itself is a simple React app which will be run locally and communicates with your Erigon node.
- The app makes use of two sources of external databases for cosmetic reasons:
- Token icons come from the trustwallet public assets repository.
- Method names come from the 4bytes database.
- These 2 repositories were cloned as submodules and are made available to the app through separate http services. They are accessed at browser level and are optional, if the service is down the result will be broken icons and default 4bytes method selectors instead of human-readable names.
These instructions are subjected to changes in future for the sake of simplification.
Open a new terminal and start the 4bytes method decoding service:
```
npm run serve-4bytes
```
Open another terminal and start the trustwallet assets service:
```
npm run serve-trustwallet-assets
```
In another terminal start the Otterscan app:
```
npm run serve
```
Otterscan should now be running at http://localhost:5000/.
For now, it assumes the `rpcdaemon` is running on 127.0.0.1:8545. If for some reason your installation is running in another host/port, change it in the `src/ethersconfig.ts` file (patches to make it parameterized are welcome).
**You can make sure it is working correctly if the homepage is able to show the latest block/timestamp your Erigon node is at just bellow the search button.**
To the [Erigon](https://github.com/ledgerwatch/erigon) team that made it possible for regular humans to run an archive node in a retail laptop. Also, they have been very helpful explaining Erigon's internals which made the modifications Otterscan requires possible.
To the owners of the [4bytes repository](https://github.com/ethereum-lists/4bytes) that we import and use to translate the method selectors to human-friendly strings.
Erigon keeps evolving at a fast pace, with weekly releases, sometimes with (necessary) breaking changes.
This project intends to keep following their progress and mantaining compatibility as the availability of the author permits.
Erigon itself is alpha, so I consider this software is also in alpha state, however it is pretty usable.
Also there is room for many improvements that are not possible in the current centralized, closed source block explorer offerings and the author of this software would like to have.