Skip to content

Commit de432ce

Browse files
authored
add kiln network, add network option for fast-sync capable (hyperledger#3547)
* add kiln network, add network option for fast-sync capable Signed-off-by: garyschulte <[email protected]>
1 parent 50e9099 commit de432ce

File tree

3 files changed

+889
-2
lines changed

3 files changed

+889
-2
lines changed

besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,9 @@ private void configure() throws Exception {
18121812
syncMode =
18131813
Optional.ofNullable(syncMode)
18141814
.orElse(
1815-
genesisFile == null && !isPrivacyEnabled && network != NetworkName.DEV
1815+
genesisFile == null
1816+
&& !isPrivacyEnabled
1817+
&& Optional.ofNullable(network).map(NetworkName::canFastSync).orElse(false)
18161818
? SyncMode.FAST
18171819
: SyncMode.FULL);
18181820

besu/src/main/java/org/hyperledger/besu/cli/config/NetworkName.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public enum NetworkName {
2222
ROPSTEN("/ropsten.json", BigInteger.valueOf(3)),
2323
SEPOLIA("/sepolia.json", BigInteger.valueOf(11155111)),
2424
GOERLI("/goerli.json", BigInteger.valueOf(5)),
25-
DEV("/dev.json", BigInteger.valueOf(2018)),
25+
KILN("/kiln.json", BigInteger.valueOf(1337802), false),
26+
DEV("/dev.json", BigInteger.valueOf(2018), false),
2627
CLASSIC("/classic.json", BigInteger.valueOf(1)),
2728
KOTTI("/kotti.json", BigInteger.valueOf(6)),
2829
MORDOR("/mordor.json", BigInteger.valueOf(7)),
@@ -31,10 +32,18 @@ public enum NetworkName {
3132

3233
private final String genesisFile;
3334
private final BigInteger networkId;
35+
private final boolean canFastSync;
3436

3537
NetworkName(final String genesisFile, final BigInteger networkId) {
3638
this.genesisFile = genesisFile;
3739
this.networkId = networkId;
40+
this.canFastSync = true;
41+
}
42+
43+
NetworkName(final String genesisFile, final BigInteger networkId, final boolean canFastSync) {
44+
this.genesisFile = genesisFile;
45+
this.networkId = networkId;
46+
this.canFastSync = canFastSync;
3847
}
3948

4049
public String getGenesisFile() {
@@ -44,4 +53,8 @@ public String getGenesisFile() {
4453
public BigInteger getNetworkId() {
4554
return networkId;
4655
}
56+
57+
public boolean canFastSync() {
58+
return canFastSync;
59+
}
4760
}

0 commit comments

Comments
 (0)