Skip to content

Commit 85e4c3b

Browse files
flcl42rjnrohit
authored andcommitted
Add schema to configs (#7493)
1 parent 4aa70aa commit 85e4c3b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+540
-96
lines changed

src/Nethermind/Nethermind.Config/JsonConfigSource.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ namespace Nethermind.Config;
1212

1313
public class JsonConfigSource : IConfigSource
1414
{
15+
private const string SchemaKey = "$schema";
16+
1517
public JsonConfigSource(string configFilePath)
1618
{
1719
LoadJsonConfig(configFilePath);
@@ -22,7 +24,7 @@ private void ApplyJsonConfig(string jsonContent)
2224
try
2325
{
2426
using var json = JsonDocument.Parse(jsonContent);
25-
foreach (var moduleEntry in json.RootElement.EnumerateObject())
27+
foreach (var moduleEntry in json.RootElement.EnumerateObject().Where(o => o.Name != SchemaKey))
2628
{
2729
LoadModule(moduleEntry.Name, moduleEntry.Value);
2830
}
@@ -72,7 +74,7 @@ private void LoadModule(string moduleName, JsonElement configItems)
7274
{
7375
var itemsDict = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
7476

75-
foreach (var configItem in configItems.EnumerateObject())
77+
foreach (var configItem in configItems.EnumerateObject().Where(o => o.Name != SchemaKey))
7678
{
7779
var key = configItem.Name;
7880
if (!itemsDict.ContainsKey(key))

src/Nethermind/Nethermind.Runner/configs/AuraTest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/NethermindEth/core-scripts/refs/heads/main/schemas/config.json",
23
"Init": {
34
"ChainSpecPath": "chainspec/AuRaTest.json",
45
"GenesisHash": "0xa13552e2290059c2736d101e945071a5f3768bc3338c73724184b0606eb8df1d",

src/Nethermind/Nethermind.Runner/configs/base-mainnet.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/NethermindEth/core-scripts/refs/heads/main/schemas/config.json",
23
"Init": {
34
"ChainSpecPath": "chainspec/base-mainnet.json",
45
"GenesisHash": "0xf712aa9241cc24369b143cf6dce85f0902a9731e70d66818a3a5845b296c73dd",
@@ -38,4 +39,4 @@
3839
"Optimism": {
3940
"SequencerUrl": "https://mainnet-sequencer.base.org"
4041
}
41-
}
42+
}

src/Nethermind/Nethermind.Runner/configs/base-mainnet_archive.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/NethermindEth/core-scripts/refs/heads/main/schemas/config.json",
23
"Init": {
34
"ChainSpecPath": "chainspec/base-mainnet.json",
45
"GenesisHash": "0xf712aa9241cc24369b143cf6dce85f0902a9731e70d66818a3a5845b296c73dd",

src/Nethermind/Nethermind.Runner/configs/base-sepolia.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/NethermindEth/core-scripts/refs/heads/main/schemas/config.json",
23
"Init": {
34
"ChainSpecPath": "chainspec/base-sepolia.json",
45
"GenesisHash": "0x0dcc9e089e30b90ddfc55be9a37dd15bc551aeee999d2e2b51414c54eaf934e4",
@@ -38,4 +39,4 @@
3839
"Optimism": {
3940
"SequencerUrl": "https://sepolia-sequencer.base.org"
4041
}
41-
}
42+
}

src/Nethermind/Nethermind.Runner/configs/base-sepolia_archive.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/NethermindEth/core-scripts/refs/heads/main/schemas/config.json",
23
"Init": {
34
"ChainSpecPath": "chainspec/base-sepolia.json",
45
"GenesisHash": "0x0dcc9e089e30b90ddfc55be9a37dd15bc551aeee999d2e2b51414c54eaf934e4",

src/Nethermind/Nethermind.Runner/configs/chiado.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/NethermindEth/core-scripts/refs/heads/main/schemas/config.json",
23
"Init": {
34
"MemoryHint": 768000000,
45
"ChainSpecPath": "chainspec/chiado.json",
@@ -19,7 +20,7 @@
1920
"PivotNumber": 13540000,
2021
"PivotHash": "0x9caa530d8ecba3d2ae14ede428b6814ee98861d272db473f5a0ffeb7bb57ccf0",
2122
"PivotTotalDifficulty": "231708131825107706987652208063906496124457284",
22-
"FastSyncCatchUpHeightDelta": "10000000000",
23+
"FastSyncCatchUpHeightDelta": 10000000000,
2324
"UseGethLimitsInFastBlocks": false
2425
},
2526
"Blocks": {
@@ -56,4 +57,4 @@
5657
16
5758
]
5859
}
59-
}
60+
}

src/Nethermind/Nethermind.Runner/configs/chiado_archive.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/NethermindEth/core-scripts/refs/heads/main/schemas/config.json",
23
"Init": {
34
"MemoryHint": 768000000,
45
"ChainSpecPath": "chainspec/chiado.json",

src/Nethermind/Nethermind.Runner/configs/energyweb.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/NethermindEth/core-scripts/refs/heads/main/schemas/config.json",
23
"Init": {
34
"ChainSpecPath": "chainspec/energyweb.json",
45
"GenesisHash": "0x0b6d3e680af2fc525392c720666cce58e3d8e6fe75ba4b48cb36bcc69039229b",
@@ -32,4 +33,4 @@
3233
"Merge": {
3334
"Enabled": false
3435
}
35-
}
36+
}

src/Nethermind/Nethermind.Runner/configs/energyweb_archive.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/NethermindEth/core-scripts/refs/heads/main/schemas/config.json",
23
"Init": {
34
"ChainSpecPath": "chainspec/energyweb.json",
45
"GenesisHash": "0x0b6d3e680af2fc525392c720666cce58e3d8e6fe75ba4b48cb36bcc69039229b",

0 commit comments

Comments
 (0)