Separate Indexer, Web App, and API
Blockscout supports several modes which run in a single all-in-one application by default.
It is possible to run modes separately or in different combinations. For example, you may want to run the
indexer mode + APIto create an indexed db with programatic access and no UI, or
indexer mode + UIto leverage Blockscout as a read-only explorer.
Note that the application is limited to 1 running indexer per 1 Blockscout instance. However, the indexer automatically reruns child processes within the Elixir architecture, making it quite fault-tolerant.
To run these modes separately, adjust ENV variables as follows:
After extending the set of environment variables for the instance, recompile the application (or rebuilt the docker image, if this is Docker version) to enable mode settings.
To run Blockscout in indexer mode, disable the web application and API:
To run Blockscout in web application mode only, disable the indexer and API read methods (API write functionality is not disabled to support smart contracts verification in the UI).
If you have a separate web application and indexer and they are connected to the same database (via DATABASE_URL), you will see new incoming items on the web UI like in the all-in-one mode. This configuration allows you to scale the web UI separately from indexer.
To run in API mode, disable the indexer and webapp.
In API mode the web UI will show the API docs page at the default path (/). In the default all-in-one mode, it is located on the /api-docs page.