Skip to content

Commit

Permalink
feat: add support of incremental quicksync
Browse files Browse the repository at this point in the history
  • Loading branch information
brusherru committed Oct 14, 2024
1 parent b45cad6 commit c3c8b00
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
24 changes: 17 additions & 7 deletions desktop/NodeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,9 @@ class NodeManager extends AbstractManager {
};
};

private getNodeStateFile = (nodeData: string) =>
path.resolve(nodeData, 'state.sql');

private checkForPausedQuicksync = async (
nodeData: string
): Promise<PausedQuicksyncStatus | null> => {
Expand Down Expand Up @@ -912,13 +915,20 @@ class NodeManager extends AbstractManager {
}

const bin = getQuicksyncPath();
const args = [
'download',
'--node-data',
this.getNodeDataPath(),
'--go-spacemesh-path',
getNodePath(),
];

const nodeDataPath = this.getNodeDataPath();
const stateFile = this.getNodeStateFile(nodeDataPath);
const shouldDownloadEntire = !(await fse.pathExists(stateFile));

const args = shouldDownloadEntire
? [
'download',
'--node-data',
nodeDataPath,
'--go-spacemesh-path',
getNodePath(),
]
: ['partial', '-s', stateFile, '-j', '1'];

logger.log('runQuicksync:download', `${bin} ${args.join(' ')}`);

Expand Down
2 changes: 1 addition & 1 deletion node/use-version-quicksync
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.1.16
v0.2.0-alpha

0 comments on commit c3c8b00

Please sign in to comment.