Skip to content

Commit 2c01ce2

Browse files
committed
load data dir on load snapshot
1 parent b4e59bb commit 2c01ce2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

local/snapshot.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,14 @@ func (ln *localNetwork) loadSnapshot(
281281
return err
282282
}
283283
}
284-
return fmt.Errorf("PEPE")
285284
// load data dir
286285
for _, nodeConfig := range networkConfig.NodeConfigs {
287-
sourceDBDir := filepath.Join(v0SnapshotDBDir, nodeConfig.Name)
288-
targetDBDir := filepath.Join(filepath.Join(ln.rootDir, nodeConfig.Name), defaultDBSubdir)
289-
if err := dircopy.Copy(sourceDBDir, targetDBDir); err != nil {
290-
return fmt.Errorf("failure loading node %q db dir: %w", nodeConfig.Name, err)
286+
sourceDataDir := filepath.Join(snapshotDir, nodeConfig.Name)
287+
targetDataDir := filepath.Join(ln.rootDir, nodeConfig.Name)
288+
if err := dircopy.Copy(sourceDataDir, targetDataDir); err != nil {
289+
return fmt.Errorf("failure loading node %q data dir: %w", nodeConfig.Name, err)
291290
}
292-
nodeConfig.Flags[config.DBPathKey] = targetDBDir
291+
nodeConfig.Flags[config.DataDirKey] = targetDataDir
293292
}
294293
// replace binary path
295294
if binaryPath != "" {

0 commit comments

Comments
 (0)