SiaFoundation / siad

The Sia daemon
https://sia.tech
MIT License
131 stars 29 forks source link

cmd/siad-convert-db: Add db conversion tool #161

Closed lukechampine closed 1 year ago

lukechampine commented 1 year ago

siad-convert-db is a standalone tool that converts a consensus.db file to a core-compatible version. The conversion is performed incrementally and in-place, so you don't need 2x the storage -- it converts 1000 blocks per db transaction, deleting the old data as it goes. Only BoltDB is supported. If we switch to a different DB in renterd/hostd/etc., we'll need to modify this tool (and it won't be able to perform the modification in-place, obviously).

On my machine, conversion takes about 50 minutes. Honestly, this probably isn't all that much faster than resyncing from peers, but it's a nice alternative to have, and your peers will thank you for it. :P