cs-codex-dist-tests/DistTestCore/Marketplace/GethCompanionNodeInfo.cs

41 lines
1.1 KiB
C#
Raw Normal View History

2023-04-14 07:54:07 +00:00
using KubernetesWorkflow;
2023-04-25 09:31:15 +00:00
using Logging;
using NethereumWorkflow;
2023-04-14 07:54:07 +00:00
namespace DistTestCore.Marketplace
{
public class GethCompanionNodeInfo
{
2023-05-03 08:21:15 +00:00
public GethCompanionNodeInfo(RunningContainer runningContainer, GethAccount[] accounts)
2023-04-14 07:54:07 +00:00
{
RunningContainer = runningContainer;
Accounts = accounts;
2023-04-14 07:54:07 +00:00
}
public RunningContainer RunningContainer { get; }
2023-05-03 08:21:15 +00:00
public GethAccount[] Accounts { get; }
2023-05-03 08:21:15 +00:00
public NethereumInteraction StartInteraction(BaseLog log, GethAccount account)
{
var ip = RunningContainer.Pod.Cluster.IP;
var port = RunningContainer.ServicePorts[0].Number;
var privateKey = account.PrivateKey;
2023-05-03 08:21:15 +00:00
var creator = new NethereumInteractionCreator(log, ip, port, privateKey);
return creator.CreateWorkflow();
}
2023-04-14 07:54:07 +00:00
}
2023-05-03 08:21:15 +00:00
public class GethAccount
{
2023-05-03 08:21:15 +00:00
public GethAccount(string account, string privateKey)
{
Account = account;
PrivateKey = privateKey;
}
public string Account { get; }
public string PrivateKey { get; }
}
2023-04-14 07:54:07 +00:00
}