/// <inheritdoc /> public void SaveCheckpoint(string targetDirectory) { using (var checkpoint = m_store.Checkpoint()) { checkpoint.Save(targetDirectory); } }
public static void CreateCheckpoint(RocksDb db, string checkPointFileName, uint network, byte addressVersion, UInt160 scriptHash) { if (File.Exists(checkPointFileName)) { throw new ArgumentException("checkpoint file already exists", nameof(checkPointFileName)); } var tempPath = GetTempPath(); try { { using var checkpoint = db.Checkpoint(); checkpoint.Save(tempPath); } { using var stream = File.OpenWrite(GetAddressFilePath(tempPath)); using var writer = new StreamWriter(stream); writer.WriteLine(network); writer.WriteLine(addressVersion); writer.WriteLine(scriptHash.ToAddress(addressVersion)); } ZipFile.CreateFromDirectory(tempPath, checkPointFileName); } finally { Directory.Delete(tempPath, true); } }
public void CheckPoint(string path) { using (var checkpoint = db.Checkpoint()) { checkpoint.Save(path); } }
public void CreateCheckPoint() { _db.Checkpoint(); }