Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Nethermind/Nethermind.Api/IInitConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public interface IInitConfig : IConfig
[ConfigItem(Description = "The hash of the genesis block. If not specified, the genesis block validity is not checked which is useful in the case of ad hoc test/private networks.", DefaultValue = "null")]
string? GenesisHash { get; set; }

[ConfigItem(Description = "The network id. If not specified, taken from the chain spec file.", DefaultValue = "null", HiddenFromDocs = true)]
ulong? NetworkId { get; set; }

[ConfigItem(Description = "The path to the static nodes file.", DefaultValue = "static-nodes.json")]
string StaticNodesPath { get; set; }

Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Nethermind.Api/InitConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class InitConfig : IInitConfig
public string BaseDbPath { get; set; } = "db";
public string LogFileName { get; set; } = "log.txt";
public string? GenesisHash { get; set; }
public ulong? NetworkId { get; set; }
public string StaticNodesPath { get; set; } = "static-nodes.json";
public string TrustedNodesPath { get; set; } = "trusted-nodes.json";
public string? KzgSetupPath { get; set; } = null;
Expand Down
7 changes: 7 additions & 0 deletions src/Nethermind/Nethermind.Runner/Ethereum/Api/ApiBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ private ChainSpec LoadChainSpec(IJsonSerializer ethereumJsonSerializer)

var loader = new ChainSpecFileLoader(ethereumJsonSerializer, _logger);
ChainSpec chainSpec = loader.LoadEmbeddedOrFromFile(_initConfig.ChainSpecPath);

//overwriting NetworkId which is useful for some devnets (like bloatnet)
if (_initConfig.NetworkId is not null)
{
chainSpec.NetworkId = (ulong)_initConfig.NetworkId;
}

return chainSpec;
}

Expand Down