Skip to content

Commit

Permalink
Add ledger-migration to entrypoint and Dockerfile (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
joekottke committed Aug 14, 2020
1 parent c8a7507 commit 3492d74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions ops/Dockerfile-consensus
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ COPY bin/libconsensus-enclave.signed.so /usr/bin/
COPY bin/consensus-service /usr/bin/
COPY bin/ledger-distribution /usr/bin/
COPY bin/mc-admin-http-gateway /usr/bin/
COPY bin/mc-ledger-migration /usr/bin/

# Q: Why not use NODE_LEDGER_DIR here?
# A: The ENV dictates where the app actually looks, and the ARG sets
Expand Down
3 changes: 3 additions & 0 deletions ops/entrypoints/consensus_validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ if [ ! -r "${NODE_LEDGER_DIR}/data.mdb" ]; then
rsync -a --delete /var/lib/mobilecoin/origin_data/* ${NODE_LEDGER_DIR}/
fi

# Update the ledger to the current version if necessary
/usr/bin/mc-ledger-migration --ledger-db ${NODE_LEDGER_DIR}

if [[ -z "${AWS_PATH}" ]] || [[ -z "${AWS_SECRET_ACCESS_KEY}" ]] || [[ -z "${AWS_ACCESS_KEY_ID}" ]]; then
echo "Warning: Must provide AWS_PATH, AWS_SECRET_ACCESS_KEY, and AWS_ACCESS_KEY_ID to start ledger distribution";
else
Expand Down

0 comments on commit 3492d74

Please sign in to comment.