From 2f28084d9c5fac77059d54b5a9f65fc06e1e067e Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Thu, 20 Jul 2023 15:54:54 +0200 Subject: [PATCH] incorporate firehose into the monorepo --- firehose-mainnet/Dockerfile | 7 ++ firehose-mainnet/config.yml | 23 ++++++ firehose.yml | 155 ++++++++++++++++++++++++++++++++++++ rpc-base.yml | 2 + 4 files changed, 187 insertions(+) create mode 100644 firehose-mainnet/Dockerfile create mode 100644 firehose-mainnet/config.yml create mode 100644 firehose.yml diff --git a/firehose-mainnet/Dockerfile b/firehose-mainnet/Dockerfile new file mode 100644 index 00000000..7c0a5941 --- /dev/null +++ b/firehose-mainnet/Dockerfile @@ -0,0 +1,7 @@ +FROM debian +RUN apt-get update && apt-get install -y wget +RUN wget -O- https://github.com/streamingfast/firehose-ethereum/releases/download/v1.4.4/firehose-ethereum_linux_x86_64.tar.gz | tar xvz -C /usr/bin +RUN wget https://github.com/streamingfast/go-ethereum/releases/download/geth-v1.12.0-fh2.2/geth_linux -O /usr/bin/geth +RUN chmod +x /usr/bin/geth + +ENTRYPOINT ["fireeth"] \ No newline at end of file diff --git a/firehose-mainnet/config.yml b/firehose-mainnet/config.yml new file mode 100644 index 00000000..f1f7302e --- /dev/null +++ b/firehose-mainnet/config.yml @@ -0,0 +1,23 @@ +start: + args: + - merger + - firehose + - reader-node + - relayer + - combined-index-builder + flags: + data-dir: /var/lib/firehose + common-chain-id: "1" + common-network-id: "1" + reader-node-path: /usr/bin/geth + substreams-rpc-endpoints: $ETHEREUM_ARCHIVE_RPC + substreams-enabled: true + substreams-request-stats-enabled: true + reader-node-arguments: "--mainnet --datadir=/var/lib/geth + --ipcpath=/var/lib/firehose/reader/ipc + --http --http.api=eth,net,web3 + --authrpc.jwtsecret=/jwtsecret + --authrpc.addr=0.0.0.0 + --authrpc.vhosts=* + --http.port=8545 --http.addr=0.0.0.0 --http.vhosts=* + --firehose-enabled --port=24465 --cache=2048" diff --git a/firehose.yml b/firehose.yml new file mode 100644 index 00000000..93b4410e --- /dev/null +++ b/firehose.yml @@ -0,0 +1,155 @@ +version: '3.1' + +services: + erigon-mainnet: + image: thorax/erigon:v2.48.1 + expose: + - "16630" + - "9090" + - "8545" + - "8551" + ports: + - "16630:16630" + - "16630:16630/udp" + volumes: + - erigon-mainnet:/home/erigon/.local/share/erigon + - .jwtsecret:/jwtsecret + networks: + - chains + command: > + --chain mainnet + --port=16630 + --metrics --metrics.addr=0.0.0.0 --metrics.port=6060 + --private.api.addr=0.0.0.0:9090 + --torrent.upload.rate="1250mb" + --torrent.download.rate="1250mb" + --pprof + --pprof.addr=0.0.0.0 + --pprof.port=6061 + --authrpc.addr=0.0.0.0 + --authrpc.vhosts=* + --authrpc.jwtsecret=/jwtsecret + --http.addr=0.0.0.0 + --http.vhosts=* + --http.corsdomain=* + --http.api=eth,erigon,web3,net,debug,trace,txpool + --rpc.returndata.limit=1000000 + --rpc.gascap=5000000000 + --ws + restart: unless-stopped + stop_grace_period: 1m + labels: + - "prometheus-scrape.enabled=true" + - "prometheus-scrape.port=6060" + - "prometheus-scrape.job_name=erigon" + - "prometheus-scrape.metrics_path=/debug/metrics/prometheus" + - "traefik.enable=true" + - "traefik.http.middlewares.erigon-mainnet-stripprefix.stripprefix.prefixes=/erigon" + - "traefik.http.services.erigon-mainnet.loadbalancer.server.port=8545" + - "traefik.http.routers.erigon-mainnet.entrypoints=websecure" + - "traefik.http.routers.erigon-mainnet.tls.certresolver=myresolver" + - "traefik.http.routers.erigon-mainnet.rule=Host(`$DOMAIN`) && PathPrefix(`/erigon`)" + - "traefik.http.routers.erigon-mainnet.middlewares=erigon-mainnet-stripprefix, ipwhitelist" + + + fireeth-mainnet: + build: + context: ./firehose-mainnet/ + command: -c /etc/firehose/config.yml start + environment: + - "ETHEREUM_ARCHIVE_RPC=http://erigon-mainnet:8545" + expose: + - 8545 # geth rpc + - 8551 # consensus client + - 13042 # firehose grpc + ports: + - "24465:24465" + - "24465:24465/udp" + #- "13042:13042" + labels: + - "traefik.enable=true" + - "traefik.http.services.firehose-mainnet.loadbalancer.server.scheme=h2c" + - "traefik.http.services.firehose-mainnet.loadbalancer.server.port=13042" + - "traefik.http.routers.firehose-mainnet.entrypoints=grpc" + #- "traefik.http.routers.firehose-mainnet.tls.certresolver=myresolver" + - "traefik.http.routers.firehose-mainnet.rule=Host(`firehose-mainnet.$DOMAIN`)" + - "traefik.http.routers.firehose-mainnet.middlewares=ipwhitelist" + networks: + - chains + volumes: + - "./firehose-mainnet/config.yml:/etc/firehose/config.yml" + - "geth-mainnet_data:/var/lib/geth" + - "firehose-mainnet_data:/var/lib/firehose" + - ".jwtsecret:/jwtsecret" + restart: unless-stopped + stop_grace_period: 1m + + + lighthouse-erigon-mainnet: + image: sigp/lighthouse:latest-modern + ports: + - "18719:18719" + - "18719:18719/udp" + volumes: + - .jwtsecret:/jwtsecret + - lighthouse-erigon-mainnet_data:/root/.lighthouse + command: > + lighthouse beacon_node + --eth1-endpoints http://erigon-mainnet:8545 + --execution-endpoint http://erigon-mainnet:8551 + --execution-jwt /jwtsecret + --checkpoint-sync-url https://sync-mainnet.beaconcha.in + --http + --http-address 0.0.0.0 + --port 18719 + restart: unless-stopped + stop_grace_period: 1m + networks: + - chains + labels: + - "traefik.enable=true" + - "traefik.http.middlewares.lighthouse-erigon-mainnet-stripprefix.stripprefix.prefixes=/lighthouse-erigon-mainnet" + - "traefik.http.services.lighthouse-erigon-mainnet.loadbalancer.server.port=5052" + - "traefik.http.routers.lighthouse-erigon-mainnet.entrypoints=websecure" + - "traefik.http.routers.lighthouse-erigon-mainnet.tls.certresolver=myresolver" + - "traefik.http.routers.lighthouse-erigon-mainnet.rule=Host(`$DOMAIN`) && PathPrefix(`/lighthouse-erigon-mainnet`)" + - "traefik.http.routers.lighthouse-erigon-mainnet.middlewares=lighthouse-erigon-mainnet-stripprefix, ipwhitelist" + + + lighthouse-fireeth-mainnet: + image: sigp/lighthouse:latest-modern + ports: + - "55031:55031" + - "55031:55031/udp" + volumes: + - .jwtsecret:/jwtsecret + - lighthouse-fireeth-mainnet_data:/root/.lighthouse + command: > + lighthouse beacon_node + --eth1-endpoints http://fireeth-mainnet:8545 + --execution-endpoint http://fireeth-mainnet:8551 + --execution-jwt /jwtsecret + --checkpoint-sync-url https://mainnet-checkpoint-sync.attestant.io + --http + --http-address 0.0.0.0 + --port 55031 + restart: unless-stopped + stop_grace_period: 1m + networks: + - chains + labels: + - "traefik.enable=true" + - "traefik.http.middlewares.lighthouse-fireeth-mainnet-stripprefix.stripprefix.prefixes=/lighthouse-fireeth-mainnet" + - "traefik.http.services.lighthouse-fireeth-mainnet.loadbalancer.server.port=5052" + - "traefik.http.routers.lighthouse-fireeth-mainnet.entrypoints=websecure" + - "traefik.http.routers.lighthouse-fireeth-mainnet.tls.certresolver=myresolver" + - "traefik.http.routers.lighthouse-fireeth-mainnet.rule=Host(`$DOMAIN`) && PathPrefix(`/lighthouse-fireeth-mainnet`)" + - "traefik.http.routers.lighthouse-fireeth-mainnet.middlewares=lighthouse-fireeth-mainnet-stripprefix, ipwhitelist" + + +volumes: + erigon-mainnet: + lighthouse-fireeth-mainnet_data: + lighthouse-erigon-mainnet_data: + geth-mainnet_data: + firehose-mainnet_data: diff --git a/rpc-base.yml b/rpc-base.yml index b0fc4d07..b200e5b6 100644 --- a/rpc-base.yml +++ b/rpc-base.yml @@ -11,6 +11,7 @@ services: ports: - "443:443" - "127.0.0.1:8080:8080" + - "3042:3042" command: - "--api=true" - "--api.insecure=true" @@ -21,6 +22,7 @@ services: - "--providers.file.filename=/dynamic_config.yml" - "--entrypoints.websecure.address=:443" - "--entryPoints.metrics.address=:8082" + - "--entryPoints.grpc.address=:3042" - "--metrics.prometheus.entryPoint=metrics" - "--certificatesresolvers.myresolver.acme.tlschallenge=true" # TESTING