2023-10-23 13:28:20 +00:00
|
|
|
|
using GethPlugin;
|
|
|
|
|
using KubernetesWorkflow;
|
2023-09-15 14:27:08 +00:00
|
|
|
|
|
|
|
|
|
namespace CodexContractsPlugin
|
|
|
|
|
{
|
|
|
|
|
public class CodexContractsContainerRecipe : ContainerRecipeFactory
|
|
|
|
|
{
|
2023-10-20 06:31:23 +00:00
|
|
|
|
public static string DockerImage { get; } = "codexstorage/codex-contracts-eth:sha-1854dfb-dist-tests";
|
2023-09-19 11:58:45 +00:00
|
|
|
|
|
2023-09-15 14:27:08 +00:00
|
|
|
|
public const string MarketplaceAddressFilename = "/hardhat/deployments/codexdisttestnetwork/Marketplace.json";
|
|
|
|
|
public const string MarketplaceArtifactFilename = "/hardhat/artifacts/contracts/Marketplace.sol/Marketplace.json";
|
|
|
|
|
|
|
|
|
|
public override string AppName => "codex-contracts";
|
2023-09-19 11:58:45 +00:00
|
|
|
|
public override string Image => DockerImage;
|
2023-09-15 14:27:08 +00:00
|
|
|
|
|
|
|
|
|
protected override void Initialize(StartupConfig startupConfig)
|
|
|
|
|
{
|
|
|
|
|
var config = startupConfig.Get<CodexContractsContainerConfig>();
|
|
|
|
|
|
2023-10-23 13:28:20 +00:00
|
|
|
|
var containerPort = config.GethNode.StartResult.Container.GetContainerPort(GethContainerRecipe.HttpPortTag);
|
|
|
|
|
|
2023-09-21 08:56:48 +00:00
|
|
|
|
var ip = config.GethNode.StartResult.Container.Pod.PodInfo.Ip;
|
2023-10-23 13:28:20 +00:00
|
|
|
|
var port = containerPort.InternalAddress.Port;
|
2023-09-15 14:27:08 +00:00
|
|
|
|
|
|
|
|
|
AddEnvVar("DISTTEST_NETWORK_URL", $"http://{ip}:{port}");
|
|
|
|
|
AddEnvVar("HARDHAT_NETWORK", "codexdisttestnetwork");
|
|
|
|
|
AddEnvVar("KEEP_ALIVE", "1");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|