-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add smart rollup snapshot download logic
- Loading branch information
1 parent
0c4b252
commit f4ffa9c
Showing
3 changed files
with
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
data_dir="/var/tezos" | ||
rollup_dir="$data_dir/rollup" | ||
snapshot_file=$rollup_dir/rollup.snapshot | ||
|
||
if [ ! -d "$data_dir" ]; then | ||
echo "ERROR: /var/tezos doesn't exist. There should be a volume mounted." | ||
exit 1 | ||
fi | ||
|
||
if [ -e "$rollup_dir/context/store.dict" ]; then | ||
echo "Smart rollup snapshot has already been imported. Exiting." | ||
exit 0 | ||
fi | ||
|
||
echo "Did not find a pre-existing smart rollup snapshot." | ||
|
||
mkdir -p "$rollup_dir" | ||
curl -LfsS ${SNAPSHOT_URL} | tee >(sha256sum > ${snapshot_file}.sha256sum) > "$snapshot_file" |
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,17 @@ | ||
set -e | ||
|
||
bin_dir="/usr/local/bin" | ||
data_dir="/var/tezos" | ||
smart_rollup_node_dir="$data_dir/rollup" | ||
smart_rollup_node="$bin_dir/octez-smart-rollup-node" | ||
snapshot_file=${rollup_dir}/rollup.snapshot | ||
|
||
if [ ! -f ${snapshot_file} ]; then | ||
echo "No snapshot to import." | ||
exit 0 | ||
fi | ||
|
||
${smart_rollup_node} snapshot import ${snapshot_file} --data-dir ${rollup_data_dir} --no-check | ||
find ${node_dir} | ||
|
||
rm -rvf ${snapshot_file} |
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