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

45 lines
1.3 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 GethBootstrapNodeInfo
{
2023-05-03 08:21:15 +00:00
public GethBootstrapNodeInfo(RunningContainers runningContainers, AllGethAccounts allAccounts, string pubKey, Port discoveryPort)
2023-04-14 07:54:07 +00:00
{
RunningContainers = runningContainers;
2023-05-03 08:21:15 +00:00
AllAccounts = allAccounts;
Account = allAccounts.Accounts[0];
PubKey = pubKey;
DiscoveryPort = discoveryPort;
2023-04-14 07:54:07 +00:00
}
public RunningContainers RunningContainers { get; }
2023-05-03 08:21:15 +00:00
public AllGethAccounts AllAccounts { get; }
public GethAccount Account { get; }
public string PubKey { get; }
public Port DiscoveryPort { get; }
2023-04-25 09:31:15 +00:00
public NethereumInteraction StartInteraction(BaseLog log)
{
var ip = RunningContainers.RunningPod.Cluster.IP;
var port = RunningContainers.Containers[0].ServicePorts[0].Number;
var account = Account;
2023-05-03 08:21:15 +00:00
var creator = new NethereumInteractionCreator(log, ip, port, account.PrivateKey);
return creator.CreateWorkflow();
}
2023-04-14 07:54:07 +00:00
}
2023-05-03 08:21:15 +00:00
public class AllGethAccounts
{
public GethAccount[] Accounts { get; }
public AllGethAccounts(GethAccount[] accounts)
{
Accounts = accounts;
}
}
2023-04-14 07:54:07 +00:00
}