-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add full/warp sync configuration on fullnode (#291)
* feat: add full/warp sync option * test: add newest parameters to cli test * chore: add value validaiton * chore: fix comments * refactor: throw exception on unexpected value
- Loading branch information
Showing
7 changed files
with
79 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
package com.limechain.cli; | ||
|
||
import com.limechain.sync.SyncMode; | ||
|
||
/** | ||
* Hold successfully parsed cli arguments | ||
* | ||
* @param network the network | ||
* @param dbPath the DB path | ||
* @param dbRecreate flag for recreating the database for current network | ||
* @param nodeKey HEX for secret Ed25519 key | ||
* @param legacyProtocols | ||
* @param network the network | ||
* @param dbPath the DB path | ||
* @param dbRecreate flag for recreating the database for current network | ||
* @param nodeKey HEX for secret Ed25519 key | ||
* @param noLegacyProtocols flag for disabling legacy protocols | ||
* @param syncMode the sync mode | ||
*/ | ||
public record CliArguments(String network, String dbPath, boolean dbRecreate, String nodeKey, String nodeRole, | ||
boolean noLegacyProtocols) { | ||
boolean noLegacyProtocols, SyncMode syncMode) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.limechain.sync; | ||
|
||
public enum SyncMode { | ||
WARP, | ||
FULL | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/com/limechain/sync/fullsync/FullSyncMachine.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.limechain.sync.fullsync; | ||
|
||
import com.limechain.network.Network; | ||
import lombok.Getter; | ||
|
||
//TODO: Implement FullSyncMachine | ||
@Getter | ||
public class FullSyncMachine { | ||
private final Network networkService; | ||
|
||
public FullSyncMachine(final Network networkService) { | ||
this.networkService = networkService; | ||
} | ||
|
||
public void start() { | ||
networkService.sendNeighbourMessages(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters