-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e18b8f0
commit 2d66274
Showing
6 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
- name: placeholder | ||
debug: | ||
msg: 'hello world' | ||
# wget -O aura_1530150.tar.lz4 https://snapshots.polkachu.com/snapshots/aura/aura_1530150.tar.lz4 --inet4-only | ||
|
||
# sudo service aura stop | ||
|
||
# aurad tendermint unsafe-reset-all --home $HOME/.aura --keep-addr-book | ||
|
||
# lz4 -c -d aura_1530150.tar.lz4 | tar -x -C $HOME/.aura | ||
|
||
# sudo service aura start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
- name: Stop node process | ||
become: true | ||
systemd: | ||
name: '{{ network }}' | ||
state: stopped | ||
daemon_reload: yes | ||
enabled: yes | ||
|
||
- name: Move priv_validator_state.json to a safe location | ||
command: 'mv {{ user_dir }}/{{ folder }}/data/priv_validator_state.json {{ user_dir }}/{{ folder }}' | ||
|
||
- name: Get the latest snapshot url | ||
uri: | ||
url: '{{ snapshot_base_url }}/{{ network }}/snapshot' | ||
headers: | ||
x-polkachu: '{{ snapshot_secret }}' | ||
register: snapshot | ||
|
||
- name: Download snapshot to home folder | ||
get_url: | ||
url: '{{ snapshot.json.snapshot.url }}' | ||
dest: '{{ user_dir }}/{{ snapshot.json.snapshot.name }}' | ||
mode: '0644' | ||
|
||
- name: Unsafe reset | ||
shell: '{{ user_dir }}/go/bin/{{ daemon }} tendermint unsafe-reset-all --home $HOME/{{ folder }} --keep-addr-book' | ||
|
||
- name: Extract snapshot | ||
shell: 'lz4 -c -d $HOME/{{ snapshot.json.snapshot.name }} | tar -x -C $HOME/{{ folder }}' | ||
|
||
- name: Move priv_validator_state.json back | ||
command: 'mv {{ user_dir }}/{{ folder }}/priv_validator_state.json {{ user_dir }}/{{ folder }}/data/' | ||
|
||
- name: Delete the downloaded snapshot file | ||
file: | ||
path: '{{ user_dir }}/{{ snapshot.json.snapshot.name }}' | ||
state: absent | ||
|
||
- name: start node process | ||
become: true | ||
systemd: | ||
name: '{{ network }}' | ||
state: started | ||
daemon_reload: yes | ||
enabled: yes | ||
|
||
- name: Pause for 5 seconds | ||
pause: | ||
seconds: 5 | ||
|
||
- name: Ensure it is running | ||
uri: | ||
url: 'http://localhost:{{ custom_port_prefix }}61' | ||
method: GET | ||
status_code: 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Remove a node and clean up | ||
hosts: '{{ target }}' | ||
gather_facts: false | ||
vars_files: | ||
- '{{ var_file }}' | ||
roles: | ||
- support_remove_node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Sync node from a snapshot | ||
hosts: '{{ target }}' | ||
gather_facts: false | ||
vars_files: | ||
- '{{ var_file }}' | ||
roles: | ||
- support_sync_snapshot |