From 4f589e962952e9053e8e2c1b89a8fe9a5b8108e1 Mon Sep 17 00:00:00 2001 From: Jason Greathouse Date: Thu, 21 Nov 2024 14:31:43 -0600 Subject: [PATCH] update refresh job to upload ledger to us datacenter (#1023) * update refresh job to upload ledger to us datacenter * add ledger file download --- .github/workflows/refresh-ledger.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/refresh-ledger.yaml b/.github/workflows/refresh-ledger.yaml index d7f902aad..3a58f4f8f 100644 --- a/.github/workflows/refresh-ledger.yaml +++ b/.github/workflows/refresh-ledger.yaml @@ -5,6 +5,7 @@ name: Refresh ledger on: + workflow_dispatch: {} schedule: - cron: '0 0 * * *' @@ -70,6 +71,9 @@ jobs: mkdir -p "${MC_LEDGER_DB}" mkdir -p "$(dirname "${MC_WALLET_DB}")" + # Download existing ledger db + curl -sSfL "https://mcdeveu1ledger.blob.core.windows.net/${MC_CHAIN_ID}/data.mdb" -o "${MC_LEDGER_DB}/data.mdb" + # Start full-service ./full-service & @@ -87,9 +91,16 @@ jobs: echo "full-service shutdown successfully" - - name: copy ledger data.mdb to Azure Blob Storage + - name: copy ledger data.mdb to Azure Blob Storage - westeurope + env: + AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.LEDGER_DB_WESTEUROPE_AZURE_STORAGE_CONNECTION_STRING }} + run: | + cd "${DOWNLOAD_DIR}/ledger" + az storage blob upload -f ./data.mdb -c ${{ matrix.network.chain_id }} -n data.mdb --overwrite + + - name: copy ledger data.mdb to Azure Blob Storage - centralus env: - AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.LEDGER_DB_AZURE_STORAGE_CONNECTION_STRING }} + AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.LEDGER_DB_CENTRALUS_AZURE_STORAGE_CONNECTION_STRING }} run: | cd "${DOWNLOAD_DIR}/ledger" az storage blob upload -f ./data.mdb -c ${{ matrix.network.chain_id }} -n data.mdb --overwrite