forest
forest copied to clipboard
Offer to download snapshots if Forest is run with an old or missing database
Issue summary
Forest will not even attempt to sync to the FileCoin network if the database is too old or missing altogether. We only support network version >=16 and Forest knows attempts to sync from an earlier version will fail: https://github.com/ChainSafe/forest/blob/57599f7cf3051d92dec05107691b75afb5ccd944/forest/src/daemon.rs#L190-L208
To bypass this issue, users have to download a recent snapshot and use it to initialize the Forest database. To make Forest easier to use, it should ask the user for permission to automatically download and import a snapshot when necessary.
Task summary
- [ ] Use methods from #1846 to fetch the appropriate snapshots.
- [ ] Implement
--assume-yesand--assume-no.
Acceptance Criteria
- [ ] When stdin is a tty and the database is not recent enough, ask to download the appropriate snapshot (either calibnet or mainnet).
- [ ] When stdin is not a tty, assume the user said no.
- [ ] When stdin is not a tty and
--assume-yesis given, assume the user said yes.
Other information and links
Blocked by #1846