Adding base database seed script
This commit is contained in:
parent
d91f64e8be
commit
0fab25736f
3 changed files with 30 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.gitlab-ci.yml
|
28
chainquery/db-seed.sh
Normal file
28
chainquery/db-seed.sh
Normal file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
source ./db-seed.sha
|
||||
echo "Checking if seeding is needed"
|
||||
if [[ -d !./data/db/chainquery ]]; then
|
||||
echo "It appears as though you don't currently have the db created."
|
||||
echo "Downloading the Chainquery DB checkpoint data."
|
||||
wget -O data.zip https://s3bucketURL/here.zip
|
||||
if [[ -f !./data.zip ]]; then
|
||||
echo "It seems that downloading the checkpoint data failed."
|
||||
else
|
||||
echo "Checkpoint data received verifying download integrity."
|
||||
if ! echo "$CHECKSUM data.zip" | sha256sum -c -; then
|
||||
echo "Checksum failed, somehow the checkpoint data doesn't match what it's supposed to." >&2
|
||||
exit 1
|
||||
else
|
||||
echo "clearing ./data directory in case it contains something strange."
|
||||
echo "Uncompressing chainquery checkpoint data."
|
||||
rm -Rf ./data
|
||||
unzip ./data.zip
|
||||
if [[ -d !./data/db/chainquery ]]; then
|
||||
echo "Something went wrong with uncompressing checkpoint data."
|
||||
exit 1
|
||||
else
|
||||
echo "Checkpoint data has been successfully obtained you can now run the Chainquery appliance."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
1
chainquery/db-seed.sha
Normal file
1
chainquery/db-seed.sha
Normal file
|
@ -0,0 +1 @@
|
|||
CHECKSUM=6c456f3c3687fab98b1bb3869578ccae1e5ccfd351f8907b3870d204a21ea82e
|
Loading…
Reference in a new issue