From ffddb080110be953c746be54ac21be6151265860 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Mon, 21 Oct 2024 17:41:49 -0400 Subject: [PATCH] feat: bootstrap dolos from tarball snapshot (#153) Signed-off-by: Chris Gianelloni --- roles/dolos/defaults/main.yml | 8 ++++++-- roles/dolos/tasks/main.yml | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/roles/dolos/defaults/main.yml b/roles/dolos/defaults/main.yml index 1a691f6..9ef516d 100644 --- a/roles/dolos/defaults/main.yml +++ b/roles/dolos/defaults/main.yml @@ -12,8 +12,8 @@ dolos_network: mainnet cardano_node_dir: /opt/cardano # DB directory for host/container -dolos_db_dir: '{{ cardano_node_dir }}/dolos' -dolos_db_container_dir: '/data' +dolos_db_dir: '{{ cardano_node_dir }}/dolos-data/db' +dolos_db_container_dir: '/data/db' # Config directory for host/container (cardano-node) cardano_node_config_dir: '{{ cardano_node_dir }}/config' @@ -35,6 +35,10 @@ dolos_docker_image: 'ghcr.io/txpipe/dolos:v{{ dolos_version }}' # Docker container name dolos_docker_container_name: dolos +# Snapshots +dolos_snapshot_enabled: true +dolos_snapshot_url: https://dolos-snapshots.s3.amazonaws.com/v0/764824073/full/latest.tar.gz + # Port for host/container (relay) dolos_relay_container_port: 30013 dolos_relay_port: '{{ dolos_relay_container_port }}' diff --git a/roles/dolos/tasks/main.yml b/roles/dolos/tasks/main.yml index 3d87ff4..fe6e6dd 100644 --- a/roles/dolos/tasks/main.yml +++ b/roles/dolos/tasks/main.yml @@ -28,6 +28,13 @@ group: '{{ cardano_node_group | string }}' mode: 0644 +- name: Unarchive Dolos snapshot + src: '{{ dolos_snapshot_url | string }}' + dest: '{{ dolos_db_dir }}' + remote_src: yes + creates: '{{ dolos_db_dir }}/ledger' + when: dolos_snapshot_enabled + - name: Include docker-related tasks ansible.builtin.include_tasks: docker.yml when: dolos_install_method == 'docker'