Restores marketplace test

This commit is contained in:
benbierens 2023-11-06 16:10:19 +01:00
parent 4f9c0e0ce7
commit 6672427565
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
5 changed files with 17 additions and 7 deletions

View File

@ -79,7 +79,7 @@ namespace KubernetesWorkflow
public string ExecuteCommand(RunningContainer container, string command, params string[] args) public string ExecuteCommand(RunningContainer container, string command, params string[] args)
{ {
var containerName = container.Name; var containerName = container.Recipe.Name;
var cmdAndArgs = $"{containerName}: {command} ({string.Join(",", args)})"; var cmdAndArgs = $"{containerName}: {command} ({string.Join(",", args)})";
log.Debug(cmdAndArgs); log.Debug(cmdAndArgs);

View File

@ -56,6 +56,13 @@ namespace KubernetesWorkflow
} }
return containerAddress.Address; return containerAddress.Address;
} }
public Address GetInternalAddress(string portTag)
{
var containerAddress = Addresses.Single(a => a.PortTag == portTag);
if (!containerAddress.IsInteral) throw new Exception(portTag + " refers to an external port");
return containerAddress.Address;
}
} }
public class ContainerAddress public class ContainerAddress

View File

@ -95,10 +95,10 @@ namespace CodexPlugin
{ {
var mconfig = config.MarketplaceConfig; var mconfig = config.MarketplaceConfig;
var gethStart = mconfig.GethNode.StartResult; var gethStart = mconfig.GethNode.StartResult;
var wsAddress = gethStart.Container.GetAddress(GethContainerRecipe.WsPortTag); var wsAddress = gethStart.Container.GetInternalAddress(GethContainerRecipe.WsPortTag);
var marketplaceAddress = mconfig.CodexContracts.Deployment.MarketplaceAddress; var marketplaceAddress = mconfig.CodexContracts.Deployment.MarketplaceAddress;
AddEnvVar("CODEX_ETH_PROVIDER", $"ws://{wsAddress.Host}:{wsAddress.Port}"); AddEnvVar("CODEX_ETH_PROVIDER", $"{wsAddress.Host.Replace("http://", "ws://")}:{wsAddress.Port}");
AddEnvVar("CODEX_MARKETPLACE_ADDRESS", marketplaceAddress); AddEnvVar("CODEX_MARKETPLACE_ADDRESS", marketplaceAddress);
AddEnvVar("CODEX_PERSISTENCE", "true"); AddEnvVar("CODEX_PERSISTENCE", "true");

View File

@ -1,13 +1,14 @@
using Core; using Core;
using KubernetesWorkflow; using KubernetesWorkflow;
using Newtonsoft.Json;
namespace GethPlugin namespace GethPlugin
{ {
public class GethDeployment : IHasContainer public class GethDeployment : IHasContainer
{ {
public GethDeployment(RunningContainer container, Port discoveryPort, Port httpPort, Port wsPort, GethAccount account, string pubKey) public GethDeployment(RunningContainers containers, Port discoveryPort, Port httpPort, Port wsPort, GethAccount account, string pubKey)
{ {
Container = container; Containers = containers;
DiscoveryPort = discoveryPort; DiscoveryPort = discoveryPort;
HttpPort = httpPort; HttpPort = httpPort;
WsPort = wsPort; WsPort = wsPort;
@ -15,7 +16,9 @@ namespace GethPlugin
PubKey = pubKey; PubKey = pubKey;
} }
public RunningContainer Container { get; } public RunningContainers Containers { get; }
[JsonIgnore]
public RunningContainer Container { get { return Containers.Containers.Single(); } }
public Port DiscoveryPort { get; } public Port DiscoveryPort { get; }
public Port HttpPort { get; } public Port HttpPort { get; }
public Port WsPort { get; } public Port WsPort { get; }

View File

@ -38,7 +38,7 @@ namespace GethPlugin
Log($"Geth node started."); Log($"Geth node started.");
return new GethDeployment(container, discoveryPort, httpPort, wsPort, account, pubKey); return new GethDeployment(containers, discoveryPort, httpPort, wsPort, account, pubKey);
} }
public IGethNode WrapGethContainer(GethDeployment startResult) public IGethNode WrapGethContainer(GethDeployment startResult)