Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(node): support downloading snapshot db from url #138

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roles/node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ avalanchego_network_id: fuji
## Node IDs of the bootstrap nodes on networks other than `mainnet`, `testnet` and `fuji`
avalanchego_bootstrap_node_ids:
- NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg
## URL or path to the bootstrap database
avalanchego_bootstrap_db: ""

# Subnets
Expand Down
10 changes: 8 additions & 2 deletions roles/node/tasks/bootstrap-db.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022-2024, E36 Knots
---
---
- name: Check if bootstrap_db is an url
set_fact:
avalanchego_bootstrap_db_url: "{{ avalanchego_bootstrap_db }}"
when: (avalanchego_bootstrap_db is defined) and (avalanchego_bootstrap_db|length > 0) and (avalanchego_bootstrap_db is url)

- name: Unpack bootstrap database
unarchive:
src: "{{ avalanchego_bootstrap_db }}"
remote_src: "{{ (avalanchego_bootstrap_db_url is defined) | bool }}"
src: "{{ avalanchego_bootstrap_db if (avalanchego_bootstrap_db_url is not defined) else avalanchego_bootstrap_db_url }}"
dest: "{{ avalanchego_db_dir }}"
owner: "{{ avalanchego_user }}"
group: "{{ avalanchego_group }}"
Expand Down