Developers Forum for XinFin XDC Network

Cover image for Snapshot Standardisation
s4njk4n
s4njk4n

Posted on

Snapshot Standardisation

Issue: Legacy Geth snapshot consistency notes.


Issue 1

URLS:

Note in the above URLs that the Full node snapshot URL has no "s" at the end of download, so it differs from the naming convention of the other 3 snapshots.

SOLUTION: Add a 301 or 302 to server or Cloudflare pointing:

https://downloads.xinfin.network/xdcchain.tar

to

https://download.xinfin.network/xdcchain.tar


Issue 2

Mainnet full node snapshot tar file uses gzip compression whereas Mainnet archive, Apothem full and Apothem archive snapshots all have no compression.

The effect is that when mainnet full node snapshots are extracted, they need:

tar -xzf SNAPSHOT_FILE
Enter fullscreen mode Exit fullscreen mode

Whereas all the other snapshot types require:

tar -xf SNAPSHOT_FILE
Enter fullscreen mode Exit fullscreen mode

SOLUTION: For the script that is creating each of the snapshots, can we use the following across all of them:

tar -czf xdcchain.tar XDC
Enter fullscreen mode Exit fullscreen mode

That would make all of them extractable with the same flags.

If the creation script is being updated anyway, zstd would also be a nice improvement for download size…


Issue 3

Mainnet full and archive node snapshots contain a single folder "XDC" that contains all the necessary chain files.

Apothem full and archive node snapshots do not contain the XDC directory but look like they have been created one level down the tree such that the root directory of the tar file is the CONTENTS of the XDC directory instead of being encapsulated in an XDC directory like the Mainnet snapshots.

This is conisistent with the path specified in the snapshot creation command for Mainnet snapshots being:

tar -cf xdcchain.tar XDC
Enter fullscreen mode Exit fullscreen mode

And for Apothem snapshots being something like:

tar -cf xdcchain.tar XDC/*
Enter fullscreen mode Exit fullscreen mode

Solution: When the snapshots are created, always wrap the contents in an XDC directory:

tar -cf xdcchain.tar XDC
tar -cf xdcchain_archive.tar XDC
Enter fullscreen mode Exit fullscreen mode

If new clients supercede the geth client, then the above issues may no longer be relevant. In the lead up until then, if it is possible it would be great to just make those tweaks (as long as its not going to break infrastructure elsewhere).

Happy to test any updated snapshots if that would help.


Discussion (2)

Collapse
nolanngo profile image
Nolan Ngo •

rpc.xdc.network/snapshots/ please use this endpoint for download snapshot

Collapse
s4njk4n profile image
s4njk4n Author •

That looks amazing Nolan! Confirming they're for the Geth-based client?