Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7746 jwtfile path correction #7765

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.JsonRpc/JsonRpcConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public int WebSocketsPort
public long? MaxRequestBodySize { get; set; } = 30000000;
public int MaxLogsPerResponse { get; set; } = 20_000;
public int? EthModuleConcurrentInstances { get; set; } = null;
public string JwtSecretFile { get; set; } = "keystore/jwt-secret";
public string JwtSecretFile { get; set; }
ssonthal marked this conversation as resolved.
Show resolved Hide resolved
public bool UnsecureDevNoRpcAuthentication { get; set; }
public int? MaxLoggedRequestParametersCharacters { get; set; } = null;
public string[]? MethodsLoggingFiltering { get; set; } =
Expand Down
10 changes: 10 additions & 0 deletions src/Nethermind/Nethermind.Runner/Ethereum/Steps/StartRpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-3.0-only

using System.Linq;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Nethermind.Api;
Expand All @@ -14,6 +15,7 @@
using Nethermind.Logging;
using Nethermind.Runner.JsonRpc;
using Nethermind.Serialization.Json;
using Nethermind.KeyStore.Config;

namespace Nethermind.Runner.Ethereum.Steps
{
Expand All @@ -30,6 +32,14 @@ public StartRpc(INethermindApi api)
public async Task Execute(CancellationToken cancellationToken)
{
IJsonRpcConfig jsonRpcConfig = _api.Config<IJsonRpcConfig>();
IKeyStoreConfig keyStoreConfig = _api.Config<IKeyStoreConfig>();

// Update the JWT secret path based on the data directory.
if (string.IsNullOrEmpty(jsonRpcConfig.JwtSecretFile))
ssonthal marked this conversation as resolved.
Show resolved Hide resolved
{
jsonRpcConfig.JwtSecretFile = Path.Combine(keyStoreConfig.KeyStoreDirectory, "jwt-secret");
}

ILogger logger = _api.LogManager.GetClassLogger();

if (jsonRpcConfig.Enabled)
Expand Down