Skip to content

Commit

Permalink
Update BeaconClientOptions.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
uink45 committed Oct 9, 2024
1 parent 10986d1 commit 7dee80d
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions src/Lantern.Beacon/BeaconClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ public class BeaconClientOptions

public int TargetNodesToFind { get; set; } = 100;

public int MaxParallelDials { get; set; } = 1;
public int MaxParallelDials { get; set; } = 10;

public int DialTimeoutSeconds { get; set; } = 5;
public int DialTimeoutSeconds { get; set; } = 10;

public int TcpPort { get; set; } = 9001;

Expand Down Expand Up @@ -51,7 +51,29 @@ public static BeaconClientOptions Parse(string[] args)
throw new ArgumentException("Missing value for --network");
}
break;


case "--genesis-time":
if (i + 1 < argsList.Count && ulong.TryParse(argsList[++i], out var genesisTime))
{
options.SyncProtocolOptions.GenesisTime = genesisTime;
}
else
{
throw new ArgumentException("Invalid or missing value for --genesis-time");
}
break;

case "--genesis-validators-root":
if (i + 1 < argsList.Count)
{
options.SyncProtocolOptions.GenesisValidatorsRoot = GetTrustedBlockRootBytes(argsList[++i]);
}
else
{
throw new ArgumentException("Missing value for --genesis-validators-root");
}
break;

case "--block-root":
if (i + 1 < argsList.Count)
{
Expand Down Expand Up @@ -148,6 +170,7 @@ public static BeaconClientOptions Parse(string[] args)
options.Bootnodes.Add(argsList[++i]);
}
break;

case "--enable-discovery":
if (i + 1 < argsList.Count && bool.TryParse(argsList[++i], out var enableDiscovery))
{
Expand All @@ -172,7 +195,6 @@ private static NetworkType GetNetworkType(string network)
return network.ToLower() switch
{
"mainnet" => NetworkType.Mainnet,
"holesky" => NetworkType.Holesky,
_ => throw new ArgumentException($"Unsupported network type: {network}")
};
}
Expand Down

0 comments on commit 7dee80d

Please sign in to comment.