-
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 snapshot download and import support for evm
- Loading branch information
1 parent
857e111
commit d8ad4b1
Showing
3 changed files
with
78 additions
and
3 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,23 @@ | ||
set -e | ||
|
||
TEZ_VAR=/var/tezos | ||
EVM_DATA_DIR="${TEZ_VAR}/evm" | ||
SNAPSHOT_FILE="${EVM_DATA_DIR}/snapshot.gz" | ||
|
||
if [ ! -d "${TEZ_VAR}" ]; then | ||
echo "ERROR: /var/tezos doesn't exist. There should be a volume mounted." | ||
exit 1 | ||
fi | ||
|
||
if [ -e "${EVM_DATA_DIR}/store.sqlite" ]; then | ||
echo "EVM node data is already populated" | ||
exit 0 | ||
fi | ||
|
||
echo "Couldn't find a pre-existing evm snapshot." | ||
|
||
echo "Downloading ${EVM_SNAPSHOT_URL}" | ||
mkdir -p "${EVM_DATA_DIR}" | ||
curl -LfsS ${EVM_SNAPSHOT_URL} | tee >(sha256sum > ${SNAPSHOT_FILE}.sha256sum) > "${SNAPSHOT_FILE}" | ||
|
||
chown -R 1000:1000 "${EVM_SNAPSHOT_URL}" |
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,23 @@ | ||
set -ex | ||
|
||
TEZ_VAR=/var/tezos | ||
TEZ_BIN=/usr/local/bin | ||
EVM_DATA_DIR="${TEZ_VAR}/evm" | ||
SNAPSHOT_FILE="${EVM_DATA_DIR}/snapshot.gz" | ||
|
||
if [ ! -f ${SNAPSHOT_FILE} ]; then | ||
echo "No snapshot to import." | ||
exit 0 | ||
fi | ||
|
||
if [ -e "${EVM_DATA_DIR}/store.sqlite" ]; then | ||
echo "EVM node data is already populated" | ||
exit 0 | ||
fi | ||
|
||
"${TEZ_BIN}/octez-evm-node" snapshot import ${SNAPSHOT_FILE} --data-dir ${EVM_DATA_DIR} | ||
|
||
echo "List populated data dir of evm " | ||
find ${EVM_DATA_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