Skip to content

Commit

Permalink
fix/fix data sync (#223)
Browse files Browse the repository at this point in the history
* 🐛 fix docs on sync

Signed-off-by: Anathan (Ana) Ye <[email protected]>

* 🐛 fix docs on sync 2

Signed-off-by: Anathan (Ana) Ye <[email protected]>

---------

Signed-off-by: Anathan (Ana) Ye <[email protected]>
  • Loading branch information
anaye1997 authored Jan 18, 2024
1 parent d5811f3 commit 5a45e6c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/manta-atlantic/Collation/03-SetupAndRun/04-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,23 @@ sudo systemctl stop manta.service
# sync manta blockchain database
lib_path="/var/lib/substrate" # change this accordingly
identity="$(sudo -H -u manta cat "${lib_path}"/chains/manta/db/full/IDENTITY)"
echo "identity: ${identity}"
sudo -H -u manta rm -r "${lib_path}"/chains/manta/db/full
curl -L https://manta-polkadot.s3.amazonaws.com/backup/2023-12-05UTC/manta.tar.zst | sudo -H -u manta tar --zstd -C "${lib_path}"/chains/manta -xv
echo "${identity}" | sudo -H -u manta tee "${lib_path}"/chains/manta/db/full/IDENTITY

# sync polkadot blockchain database
identity_relay="$(sudo -H -u manta cat "${lib_path}"/polkadot/chains/polkadot/db/full/IDENTITY)"
identity_para="$(sudo -H -u manta cat "${lib_path}"/polkadot/chains/polkadot/db/full/parachains/db/IDENTITY)"
echo "identity_relay: ${identity_relay}"
echo "identity_para: ${identity_para}"
sudo -H -u manta rm -r "${lib_path}"/polkadot/chains/polkadot/db/full
curl -L https://manta-polkadot.s3.amazonaws.com/backup/2023-12-05UTC/manta-polkadot.tar.zst | sudo -H -u manta tar --zstd -C "${lib_path}"/polkadot/chains/polkadot -xv
echo "${identity_relay}" | sudo -H -u manta tee "${lib_path}"/polkadot/chains/polkadot/db/full/IDENTITY
echo "${identity_para}" | sudo -H -u manta tee "${lib_path}"/polkadot/chains/polkadot/db/full/parachains/db/IDENTITY

# update database `current` manifests
sudo -H -u manta bash -c 'basename $(ls "${lib_path}"/chains/manta/db/full/MANIFEST-*) > "${lib_path}"/chains/manta/db/full/CURRENT'
sudo -H -u manta bash -c 'basename $(ls "${lib_path}"/polkadot/chains/polkadot/db/full/MANIFEST-*) > "${lib_path}"/polkadot/chains/polkadot/db/full/CURRENT'
sudo -H -u manta bash -c 'basename $(ls "${lib_path}"/polkadot/chains/polkadot/db/full/parachains/db/MANIFEST-*) > "${lib_path}"/polkadot/chains/polkadot/db/full/parachains/db/CURRENT'
sudo -H -u manta bash -c "basename $(ls "${lib_path}"/chains/manta/db/full/MANIFEST-*) > \"${lib_path}\"/chains/manta/db/full/CURRENT"
sudo -H -u manta bash -c "basename $(ls "${lib_path}"/polkadot/chains/polkadot/db/full/MANIFEST-*) > \"${lib_path}\"/polkadot/chains/polkadot/db/full/CURRENT"
sudo -H -u manta bash -c "basename $(ls "${lib_path}"/polkadot/chains/polkadot/db/full/parachains/db/MANIFEST-*) > \"${lib_path}\"/polkadot/chains/polkadot/db/full/parachains/db/CURRENT"
```

1 comment on commit 5a45e6c

@vercel
Copy link

@vercel vercel bot commented on 5a45e6c Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.