From e760df55099d8210680cb9197551f5053bda007b Mon Sep 17 00:00:00 2001
From: Rafael Matias <rafael@skyle.net>
Date: Wed, 29 Jan 2025 15:54:21 +0100
Subject: [PATCH] snapshotter: add new config and new image (#301)

---
 requirements.txt                     |  2 +-
 roles/snapshotter/defaults/main.yaml | 11 +++++++++--
 setup.sh                             |  7 +++++--
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/requirements.txt b/requirements.txt
index 207a18e2..4016c07f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,5 +3,5 @@ ansible==10.1.0
 molecule-containers==2.0.0
 molecule==24.6.0
 netaddr==1.3.0
-pip==24.0
+pip==25.0
 requests==2.31 # Fix for not being able to run 'molecule test' using docker on mac. Issue: https://github.com/docker/docker-py/issues/3256
diff --git a/roles/snapshotter/defaults/main.yaml b/roles/snapshotter/defaults/main.yaml
index d2ab15ab..1c1fcdfb 100644
--- a/roles/snapshotter/defaults/main.yaml
+++ b/roles/snapshotter/defaults/main.yaml
@@ -3,14 +3,14 @@ snapshotter_datadir: /data/snapshotter
 
 snapshotter_cleanup: false # when set to "true" it will remove the container(s)
 
-snapshotter_container_image: skylenet/snapshotter:latest
+snapshotter_container_image: ghcr.io/ethpandaops/snapshotter:master
 snapshotter_container_name: snapshotter
 snapshotter_container_ports: []
 snapshotter_container_restart_policy: always
 snapshotter_container_networks: []
 snapshotter_container_volumes_from: []
 snapshotter_container_volumes:
-  - "{{ snapshotter_datadir }}:/etc/snapshotter:ro"
+  - "{{ snapshotter_datadir }}:/etc/snapshotter"
   - "/var/run/docker.sock:/var/run/docker.sock:ro"
 snapshotter_container_env: {}
 snapshotter_container_command:
@@ -30,9 +30,13 @@ snapshotter_ssh_known_hosts: ""
 # Will be mounted within the container at:
 # - /etc/snapshotter/config.yaml
 snapshotter_config: |
+  server:
+    listen_addr: 0.0.0.0:5000
   global:
     logging: warn
     chainID: "0x4268" # Holesky
+    database:
+      path: /etc/snapshotter/snapshots.db
     ssh:
       private_key_path: /etc/snapshotter/.ssh/id_rsa
       private_key_passphrase_path: "/etc/snapshotter/.ssh/id_rsa.passphrase"
@@ -43,6 +47,7 @@ snapshotter_config: |
       check_interval_seconds: 1
       block_interval: 100000
       run_once: false
+      dry_run: false
       rclone:
         version: "1.65.2"
         env:
@@ -76,6 +81,7 @@ snapshotter_config: |
         docker_containers:
           engine_snooper: snooper-engine
           execution: execution
+          beacon: beacon
         endpoints:
           beacon: http://localhost:5052
           execution: http://localhost:8545
@@ -88,6 +94,7 @@ snapshotter_config: |
         docker_containers:
           engine_snooper: snooper-engine
           execution: execution
+          beacon: beacon
         endpoints:
           beacon: http://localhost:5052
           execution: http://localhost:8545
diff --git a/setup.sh b/setup.sh
index 325f21d4..92b8b27a 100755
--- a/setup.sh
+++ b/setup.sh
@@ -1,11 +1,14 @@
 #!/usr/bin/env bash
 
+set -xe
+
 # Install required tools using asdf
 
-asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git
-asdf plugin-add python
+asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git || true
+asdf plugin-add python || true
 
 asdf install
+asdf reshim
 
 # Install python tools
 pip install -r requirements.txt