2023-04-14 07:54:07 +00:00
|
|
|
|
using KubernetesWorkflow;
|
2023-04-18 13:33:12 +00:00
|
|
|
|
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];
|
2023-04-17 08:31:14 +00:00
|
|
|
|
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; }
|
2023-04-17 08:31:14 +00:00
|
|
|
|
public string PubKey { get; }
|
|
|
|
|
public Port DiscoveryPort { get; }
|
2023-04-18 13:33:12 +00:00
|
|
|
|
|
2023-06-01 07:35:18 +00:00
|
|
|
|
public NethereumInteraction StartInteraction(TestLifecycle lifecycle)
|
2023-04-18 13:33:12 +00:00
|
|
|
|
{
|
2023-06-01 07:35:18 +00:00
|
|
|
|
var address = lifecycle.Configuration.GetAddress(RunningContainers.Containers[0]);
|
2023-04-18 13:33:12 +00:00
|
|
|
|
var account = Account;
|
|
|
|
|
|
2023-06-01 07:35:18 +00:00
|
|
|
|
var creator = new NethereumInteractionCreator(lifecycle.Log, address.Host, address.Port, account.PrivateKey);
|
2023-04-18 13:33:12 +00:00
|
|
|
|
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
|
|
|
|
}
|