> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blockscout.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Developer FAQs

> FAQs for developers

## Developer FAQs

<AccordionGroup>
  <Accordion title="How do I run my own Blockscout explorer?">
    The easiest way is by using [<u>Autoscout</u>](https://deploy.blockscout.com/). Other methods are listed in [<u>https://docs.blockscout.com/setup/deployment</u>](https://docs.blockscout.com/setup/deployment)
  </Accordion>

  <Accordion title="How do I speed up my self-hosted instance?">
    BlockScout can be resource intensive. If your instance is running slowly:

    * clear the cache - the application cache is cleared on restart by running: `sudo systemctl restart explorer.service`
    * increase the memory limit for indexers using the [INDEXER\_MEMORY\_LIMIT](/setup/env-variables/backend-env-variables#indexer-management:~:text=INDEXER%5FMEMORY%5FLIMIT) ENV if indexing is slow.
    * increase the number of CPUs if CPU is running at 100% on the web app server
    * increase the memory if memory consumption is high on the web app server
    * increase the number of CPUs or/and increase the memory on the database server if consumption is high.

    Instructions for accessing and upgrading CPUs/memory will differ based on your setup. If you are running BlockScout on AWS, these settings can be accessed through your AWS services portal.
  </Accordion>

  <Accordion title="I want to use the latest version, how do I download it?">
    Use  `git clone https://github.com/blockscout/blockscout.git -b <version>`
  </Accordion>

  <Accordion title="How do I customize the coin symbol / name?">
    **Exchange Rates Coin Name**

    * Specify coin name for exchange rates fetcher with the `COIN` [ENV variables](/setup/env-variables)

    BlockScout utilizes the `COIN` environment variable which pulls the associated market data from the Coinmarketcap.com API or CoinGecko API to provide pricing data throughout the application.

    **Displayed Coin Symbol**

    In order to set displayed coin symbol, instance maintainer should set `COIN_NAME` runtime environment variable:

    ```
    export COIN_NAME=
    ```

    For instance, in case of POA instance of Blockscout:

    ```
    export COIN_NAME=POA
    ```
  </Accordion>

  <Accordion title="How do I manage deployment with AWS CodeDeploy?">
    1. Visit CodeDeploy in AWS. You will see a list of your deployments. Select the deployment id to view details `https://console.aws.amazon.com/codesuite/codedeploy/deployments?region=us-east-1`
    2. Deployment status consists of several steps. Once step 2 is complete (application is installed on replacement instances), you manually reroute traffic. Click the `Reroute traffic` button to initiate.

    <Frame>
      <img src="https://mintcdn.com/blockscout/kl-dO7vK6d_hNvHA/images/d72b77e2-image.jpeg?fit=max&auto=format&n=kl-dO7vK6d_hNvHA&q=85&s=c8dfaae14d7e83aa2b7b5abca1598550" alt="" width="900" height="607" data-path="images/d72b77e2-image.jpeg" />
    </Frame>

    3. Once traffic is rerouted, you'll be asked to terminate the original instance. Click the **Terminate** button to initiate.

    <Frame>
      <img src="https://mintcdn.com/blockscout/JTppjXqh5Q4u166M/images/1d238ee9-image.jpeg?fit=max&auto=format&n=JTppjXqh5Q4u166M&q=85&s=6712800d518e98a5d57d0a21cb258da4" alt="" width="900" height="607" data-path="images/1d238ee9-image.jpeg" />
    </Frame>

    4. Once complete, use the public DNS address of the Amazon EC2 instance to view in a web browser. (To get the public DNS value, choose your Amazon EC2 instance in the Amazon EC2 console, and look for the value in **Public DNS** in the **Description** tab).
  </Accordion>

  <Accordion title="What's the best way to deploy to AWS?">
    Currently the best existing way is through docker compose [https://github.com/blockscout/blockscout/tree/master/docker-compose](https://github.com/blockscout/blockscout/tree/master/docker-compose).

    We are currently working on deployment through Kubernetes (K8s) and other methods for easily spinning up an instance on AWS.
  </Accordion>

  <Accordion title="How do I replace missing assets/version numbers?">
    #### Missing Assets

    1. Find the public ip of corresponding Blockscout instance in the EC2 -> Instances of AWS Dashboard.
    2. Connect to the host via SSH `ssh -i <host.pem> ec2-user@<public_ip>`, where `<host.pem>` is host's private key file, `<public_ip>` is the public ip of the host, that can be found in the AWS dashboard.
    3. Go to assets folder `cd /opt/app/apps/block_scout_web/priv/static`
    4. Add missing assets there or to `./images` folder depending on what is missing. Refresh Blockscout instance page. For example, if `favicon.ico` is missing in `./images` folder, just copy it from the root assets folder \`cp favicon.ico ./images/. You should see now the missing assets.

    #### Missing Version in Footer

    The app version number should be in the footer of BlockScout instance

    <Frame>
      <img src="https://mintcdn.com/blockscout/BBa8nQTQ6isU0DUJ/images/a79db894-image.jpeg?fit=max&auto=format&n=BBa8nQTQ6isU0DUJ&q=85&s=2c8abe4a8bd8fa2f95077d663b3a113f" alt="" width="900" height="232" data-path="images/a79db894-image.jpeg" />
    </Frame>

    1. Find the public ip of corresponding Blockscout instance in the EC2 -> Instances of AWS Dashboard
    2. Connect to the host via SSH `ssh -i <host.pem> ec2-user@<public_ip>`, where `<host.pem>` is host's private key file, `<public_ip>` is the public ip of the host, that can be found in the AWS dashboard.
    3. Go to layout folder `/opt/app/apps/block_scout_web/lib/block_scout_web/templates/layout`
    4. Open `_footer.html.eex` footer template in the favorite text editor. For example `nano ./_footer.html.eex` and fix the line `<% version = version() %>` (it is in the bottom of the file) with the hardcoded new version, for example, `<% version = 'v1.3.3-beta' %>` and save.
    5. Restart the Blockscout instance with `sudo systemctl restart explorer.service`
  </Accordion>

  <Accordion title="How do I fix the Gettext.Error?">
    You may receive this error after making changes to a specific BlockScout application.

    `(Gettext.Error) translation with msgid '...<msg_here>...' has a non-empty msgstr`

    To update gettext, run the following command **in the app's folder where the changes were made**.

    1. Go to the ./apps/name\_of\_app folder where the changes were made.
    2. Run `mix gettext.extract —merge`
    3. Repeat for other app folders as required.

    More information on Gettext is [available here](https://hexdocs.pm/gettext/Mix.Tasks.Gettext.Extract.html).
  </Accordion>

  <Accordion title="How do I update the UI?">
    See the [Configuration options](/setup/configuration-options) page for details related to different UI elements.

    For updates like adding elements/links etc you will need to change .eex templates. When changing .eex templates you don't need to rebuild. Run the application in dev mode (MIX\_ENV=dev), and change the template. You'll see changes on-the-fly. When changing js/scss while running the application, you need to run `mix phx.digest` to apply the changes.
  </Accordion>

  <Accordion title="How can I view smart contracts using RPC?">
    Use the JSON RPC `listcontracts` endpoint. For example, to view verified contracts, use the following query. Pagination is available

    ```sh theme={null}
    curl -X GET "
    https://gnosis.blockscout.com/api?module=contract&action=listcontracts&page=1&offset=50&filter=verified
    " -H "accept: application/json"
    ```
  </Accordion>

  <Accordion title="Why are Market Cap/Token Price stats wrong?">
    One reason may be related to the CoinGecko API refusing Blockscout requests without an API key.

    If impacted, apply this pull request to your instance:

    [https://github.com/blockscout/blockscout/pull/5613](https://github.com/blockscout/blockscout/pull/5613)

    It implements CoinGecko API key management and alternative CoinMarketCap exchange rates.
  </Accordion>

  <Accordion title="How do I verify contracts via an API?">
    There are several ways:

    * Use the [API v2 endpoints](/devs/verification/blockscout-smart-contract-verification-api)
    * Use the [RPC endpoints for verification](https://docs.blockscout.com/for-users/api/rpc-endpoints/contract#verify-a-contract-with-its-source-code-and-contract-creation-information)
  </Accordion>

  <Accordion title="How do I disable exchange rates?">
    Change the Explorer.ExchangeRates variable from `enabled: true` to `enabled: false`

    * config :explorer, Explorer.ExchangeRates, `enabled: false`, store: :ets

    [https://github.com/poanetwork/blockscout/blob/7aeecb2a04838cda0289a7fe432db74481cf575a/apps/explorer/config/config.exs#L32](https://github.com/poanetwork/blockscout/blob/7aeecb2a04838cda0289a7fe432db74481cf575a/apps/explorer/config/config.exs#L32)
  </Accordion>

  <Accordion title="How can I migrate verified contracts between databases?">
    You may want to do this if you are creating a new instance or resyncing a new node.

    1. Backup the `smart_contracts` table
    2. Restore this table following the resync.
  </Accordion>

  <Accordion title="Can I set RPC variable to a normal http(s) url?">
    Yes you can. The `ethereum_json_rpc_http` variable can be set to any url, it does not need to be a localhost. Client variant env variable should be specified in either case.
  </Accordion>

  <Accordion title="Do I need to enable ws?">
    No, it is not required. If ws is disabled, leave the `ETHEREUM_JSONRPC_WS_URL` env var empty or unset it.
  </Accordion>

  <Accordion title="How to fix error message &#x22;execution timeout at `pushGasToTopCall`&#x22;?">
    Try increasing time for the `ETHEREUM_JSONRPC_DEBUG_TRACE_TRANSACTION_TIMEOUT` [ENV variable](/setup/env-variables#indexer-management). The default is 5 sec.
  </Accordion>

  <Accordion title="How do I fix Unknown Private Network error?">
    In a self-hosted or locally deployed instance, when attempting to do a **write transaction** on a verified contract, the following errors may appear:

    **Unauthorized**

    "You connected to Unknown Private Network chain in the wallet, but the current instance of Blockscout is for Unknown Private Network chain"

    "No "from" address specified in neither the give options, nor the default options."

    **To Troubleshoot:**

    * Check that you set the correct `CHAIN_ID` env variable
    * Check correct variable for `NETWORK_ID`
  </Accordion>

  <Accordion title=" Is there an env variable for the favicon?">
    Yes, the [<u>FAVICON\_MASTER\_URL</u>](https://docs.blockscout.com/setup/env-variables/frontend-common-envs/envs#favicon:~:text=Version-,FAVICON_MASTER_URL,-string) ENV accepts a URL to a jpg/png/svg image.
  </Accordion>

  <Accordion title=" If I run my own local Blockscout explorer, it's gonna support ERC1155?">
    Yes, Blockscout supports ERC-20, ERC-721, ERC-1155 and ERC-404 token standards.
  </Accordion>

  <Accordion title="What Linux distro do you recommend for Blockscout manual deployment?">
    Ubuntu 24.04 has been configured in Blockscout CI
  </Accordion>

  <Accordion title="Is there a way to step through the code (debugging) using vscode?">
    We recommend using ElixirLS: Elixir support and debugger
  </Accordion>

  <Accordion title="I would like to customize Blockscout. Is there any docs or tutorial on that?">
    Some customization is available by setting environments variables [<u>https://docs.blockscout.com/setup/env-variables/backend-env-variables</u>](https://docs.blockscout.com/setup/env-variables/backend-env-variables).
  </Accordion>

  <Accordion title="Where can I get more info on defining specific variables for OP stack chains?">
    [https://blockscout.notion.site/OP-ENV-variable-values-defining-1003d73641f880b58e28ded1671256ab](https://blockscout.notion.site/OP-ENV-variable-values-defining-1003d73641f880b58e28ded1671256ab?source=copy_link)
  </Accordion>

  <Accordion title="Which frontend version should I use?">
    Use the compatibility table to find the correct version.  [<u>https://docs.blockscout.com/setup/requirements/back-front-compatibility-matrix</u>](https://docs.blockscout.com/setup/requirements/back-front-compatibility-matrix)
  </Accordion>

  <Accordion title="Can I use Cryptorank API v2 key for price fetching on Blockscout?">
    No, Blockscout uses a dedicated endpoint. Contact Cryptorank for API key.
  </Accordion>

  <Accordion title="How to connect to a local RPC node on a docker compose Blockscout instance?">
    Use  host.docker.internal instead of 127.0.0.1 e.g.

    [http://host.docker.internal:8545/](http://host.docker.internal:8545/)
  </Accordion>

  <Accordion title="How can I customize footer links?">
    The footer can be customized with the [NEXT\_PUBLIC\_FOOTER\_LINKS](https://docs.blockscout.com/setup/env-variables/frontend-common-envs/envs#footer) ENV.
  </Accordion>
</AccordionGroup>
