migrate: add time to migrate and compaction log message

This commit is contained in:
Braydon Fuller 2019-04-02 20:31:06 -07:00
parent f3e517c3c0
commit 8337176e07
No known key found for this signature in database
GPG Key ID: F24F232D108B3AD4
2 changed files with 4 additions and 3 deletions

View File

@ -14,9 +14,9 @@ To do this you can run:
node ./migrate/chaindb4to5.js /path/to/bcoin/chain
```
The block data will now be stored at `/path/to/bcoin/blocks`, after
the data has been moved the chain database will be compacted to free
disk space.
The migration will take 1-3 hours, depending on hardware. The block data
will now be stored at `/path/to/bcoin/blocks`, after the data has been moved
the chain database will be compacted to free disk space.
Alternatively, you can also sync the chain again, however the above
migration will be faster as additional network bandwidth won't be used

View File

@ -129,6 +129,7 @@ async function migrateBlocks() {
await migrateUndoBlocks();
await updateVersion();
console.log('Compacting database');
await db.compactRange();
await db.close();
await blockStore.close();