Closed yayitswei closed 6 years ago
All databases and other node info are located in the path set in the node configs which defaults to [HOME_DIR]/.bcoin/[BITCOIN_NETWORK]
.
Is it safe to copy the spv file directly while bcoin is running?
When we used lmdb we would use the mdb_copy
utility to back up both the wallet and spvchain, but since lmdb is being deprecated I'm looking for a similar functionality with leveldb.
To be honest, I'm not sure. @nodar-chkuaselidze an ideas?
Copying Chain file while bcoin is running is not guaranteed to succeed. Most likely you will end up with db corruption. Leveldb can't/shouldn't be accessed by multiple processes at the same time. (Even though its safe to access it from the same process) https://github.com/google/leveldb/blob/master/doc/index.md#concurrency
@BluSyn Have you dealt with this ?
Hey @yayitswei, sorry for the delay. The best way to deal with backups and avoid downtime is to have redundant nodes setup. From what I understand, leveldb apparently does a lot of compression and optimizations in the background which is why it's unsafe to run other processes concurrently. Since the blockchain is essentially one giant distributed backup, the trade-off to get the ability to do those concurrent backups wasn't really worth it.
Hi, thanks for making bcoin.
For backing up the wallet db, we have the backup route. Is there a similar method to back up the spvchain db?