sync: add sync script for resyncing from ERA

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-12-07 15:57:41 +01:00
parent e7342c3ccf
commit ba40b3afc3
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
3 changed files with 32 additions and 8 deletions

View File

@ -8,14 +8,6 @@
update: true
become_user: '{{ beacon_node_user }}'
- name: Create build script
template:
src: 'scipts/build.sh.j2'
dest: '{{ beacon_node_build_script_path }}'
owner: '{{ beacon_node_user }}'
group: '{{ beacon_node_group }}'
mode: 0775
- name: Create launchd config file for scheduled builds
template:
src: launchd-build.plist.j2

View File

@ -28,3 +28,13 @@
dest: '{{ beacon_node_web3_jwt_secret_path }}'
content: '{{ beacon_node_web3_jwt_secret }}'
group: '{{ beacon_node_group }}'
- name: Create helper scripts
template:
src: '{{ item }}'
dest: '{{ beacon_node_service_path }}/{{ item|basename|replace(".j2", "") }}'
owner: '{{ beacon_node_user }}'
group: '{{ beacon_node_group }}'
mode: 0775
with_fileglob:
- 'templates/scripts/*'

View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
# vim: ft=sh
set -e
SERVICE_USER='{{ beacon_node_user | mandatory }}'
SERVICE_NAME='{{ beacon_node_service_name | mandatory }}'
SERVICE_PATH='{{ beacon_node_service_path | mandatory }}'
SERVICE_DATA='{{ beacon_node_data_path | mandatory }}'
NETWORK_NAME='{{ beacon_node_network | mandatory }}'
TRUSTED_NODE_API_URL=$1
if [[ -z "${TRUSTED_NODE_API_URL}" ]]; then
echo "Usage: sync.sh <trusted_node_url>" >&2
exit 2
fi
sudo -u "${SERVICE_USER}" "${SERVICE_PATH}/repo/build/nimbus_beacon_node" \
trustedNodeSync \
--backfill=false \
--network="${NETWORK_NAME}" \
--data-dir="${SERVICE_DATA}" \
--trusted-node-url="${TRUSTED_NODE_API_URL}"