├── docker-compose.yml └── README.md /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | name: librescan 4 | 5 | services: 6 | 7 | db: 8 | restart: always 9 | image: postgres:15.4-alpine3.18 10 | environment: 11 | POSTGRES_DB: postgres # default, can be omitted 12 | POSTGRES_USER: postgres # default, can be omitted 13 | POSTGRES_PASSWORD: postgres 14 | volumes: 15 | - db:/var/lib/postgresql/data 16 | networks: 17 | - backend 18 | 19 | scraper: 20 | restart: always 21 | image: librescan/backend-scraper 22 | environment: 23 | RPC_URL: https://eth.llamarpc.com # should be replaced with a paid account endpoint! 24 | POSTGRES_HOST: db 25 | POSTGRES_PORT: 5432 26 | POSTGRES_DB: postgres 27 | POSTGRES_USER: postgres 28 | POSTGRES_PASSWORD: postgres 29 | GENESIS_JSON_PATH: "" # if used for custom chain, genesis must be mounted and path specified 30 | LOG_FREQUENCY: 15s 31 | networks: 32 | - backend 33 | 34 | api: 35 | restart: always 36 | image: librescan/backend-api 37 | environment: 38 | QAN_RPC_URL: "" 39 | LISTEN: :9090 40 | POSTGRES_HOST: db 41 | POSTGRES_PORT: 5432 42 | POSTGRES_DB: postgres 43 | POSTGRES_USER: postgres 44 | POSTGRES_PASSWORD: postgres 45 | networks: 46 | - backend 47 | - frontend 48 | 49 | web: 50 | restart: always 51 | image: librescan/frontend-web 52 | environment: 53 | NUXT_APP_GRPC_API_URL: api:9090 54 | networks: 55 | - frontend 56 | ports: 57 | - 3000:3000 58 | 59 | volumes: 60 | db: 61 | 62 | networks: 63 | frontend: 64 | driver: bridge 65 | 66 | backend: 67 | driver: bridge 68 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # deploy-compose 2 | 3 | Sample manifest file for deploying LibreScan with Docker Compose. 4 | 5 | The deployment depends on an external RPC endpoint which is exposed from an OpenEthereum compatible archive node. 6 | 7 | LibreScan works with any OpenEthereum derivative blockchain node, which exposes the trace_* RPC namespace in a compatible manner. 8 | The node exposing the RPC endpoint must be running in full-archive mode. This can be a self-hosted node as well of course. 9 | 10 | Some example node providers are: 11 | 12 | - [QuickNode](https://www.quicknode.com?tap_a=67226-09396e&tap_s=4155448-b52731&utm_source=affiliate&utm_campaign=generic&utm_content=affiliate_landing_page&utm_medium=generic) 13 | - [LlamaNodes](https://llamarpc.com/eth) 14 | - [Alchemy](https://alchemy.com) 15 | - [Infura](https://infura.io) 16 | 17 | ## Deployment step-by-step 18 | 19 | ### 1.) Obtain an RPC endpoint 20 | 21 | LibreScan scrapes data off an RPC endpoint as described above. 22 | This RPC endpoint needs to be passed as an ENV variable to the scraper service. 23 | Once you have obtained your RPC endpoint URL (either from your own node or from a provider) replace the default one in the ```docker-compose.yml``` file. 24 | 25 | ### 2.) Launch the configured compose stack 26 | 27 | Just run ```docker compose up -d```. 28 | If you want to observe the logs of the underlying services, execute ```docker compose logs -f``` afterwards. 29 | 30 | ### 3.) Open the web based frontend 31 | 32 | The web interface will be made available at [http://localhost:3000](http://localhost:3000) by default. 33 | 34 | ### 4.) Wait for sync and scraping to finish 35 | 36 | If you are starting to sync a brand new instance, this will take days. This is not a LibreScan limitation, but generally blockchain sync time takes this much. 37 | Afterwards you will be kept up to date, and even relaunching after a couple weeks being offline will resync super quickly. 38 | 39 | 40 | --------------------------------------------------------------------------------