sync: add sync script for resyncing from ERA
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
e7342c3ccf
commit
ba40b3afc3
|
@ -8,14 +8,6 @@
|
||||||
update: true
|
update: true
|
||||||
become_user: '{{ beacon_node_user }}'
|
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
|
- name: Create launchd config file for scheduled builds
|
||||||
template:
|
template:
|
||||||
src: launchd-build.plist.j2
|
src: launchd-build.plist.j2
|
||||||
|
|
|
@ -28,3 +28,13 @@
|
||||||
dest: '{{ beacon_node_web3_jwt_secret_path }}'
|
dest: '{{ beacon_node_web3_jwt_secret_path }}'
|
||||||
content: '{{ beacon_node_web3_jwt_secret }}'
|
content: '{{ beacon_node_web3_jwt_secret }}'
|
||||||
group: '{{ beacon_node_group }}'
|
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/*'
|
||||||
|
|
|
@ -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}"
|
Loading…
Reference in New Issue