omgnetwork / elixir-omg

OMG-Network repository of Watcher and Watcher Info
https://omg.network
Apache License 2.0
211 stars 59 forks source link

Being able to archive and restore Watcher data #878

Open pnowosie opened 5 years ago

pnowosie commented 5 years ago

The idea is to provision new Watcher instance from other Watcher's Pg dump file. First, I give ease restore mechanism, then speeds syncing time of new Watchers and reduces round trips to ch-ch.

This requires of recreating leveldb data from Pg (not investigated). Maybe Watcher would need to store a little more data in Pg to allow this?

pdobacz commented 5 years ago

Why not use the blocks stored in leveldb for this instead? Postgres (WatcherDB) might hold a filtered/truncated set of transactions, and as such should not be relied upon for recovery.

Also note how this feature would interact with child chain checkpoints (which set out to achieve a similar result).

pnowosie commented 5 years ago

Oh, absolutely @pdobacz I got biased by that it's uneasy to backup lvldb in dockerized env.