2023-09-15 14:27:08 +00:00
|
|
|
|
using Core;
|
|
|
|
|
using GethPlugin;
|
|
|
|
|
|
|
|
|
|
namespace CodexContractsPlugin
|
|
|
|
|
{
|
|
|
|
|
public class CodexContractsPlugin : IProjectPlugin, IHasLogPrefix, IHasMetadata
|
|
|
|
|
{
|
|
|
|
|
private readonly IPluginTools tools;
|
|
|
|
|
private readonly CodexContractsStarter starter;
|
|
|
|
|
|
|
|
|
|
public CodexContractsPlugin(IPluginTools tools)
|
|
|
|
|
{
|
|
|
|
|
this.tools = tools;
|
|
|
|
|
starter = new CodexContractsStarter(tools);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string LogPrefix => "(CodexContracts) ";
|
|
|
|
|
|
|
|
|
|
public void Announce()
|
|
|
|
|
{
|
2023-09-19 11:58:45 +00:00
|
|
|
|
tools.GetLog().Log($"Loaded Codex-Marketplace SmartContracts");
|
2023-09-15 14:27:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddMetadata(IAddMetadata metadata)
|
|
|
|
|
{
|
2023-09-19 11:58:45 +00:00
|
|
|
|
metadata.Add("codexcontractsid", CodexContractsContainerRecipe.DockerImage);
|
2023-09-15 14:27:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Decommission()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-22 05:58:08 +00:00
|
|
|
|
public CodexContractsDeployment DeployContracts(CoreInterface ci, IGethNode gethNode)
|
2023-09-15 14:27:08 +00:00
|
|
|
|
{
|
2023-09-22 05:58:08 +00:00
|
|
|
|
return starter.Deploy(ci, gethNode);
|
2023-09-20 07:16:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-20 08:13:29 +00:00
|
|
|
|
public ICodexContracts WrapDeploy(CodexContractsDeployment deployment)
|
2023-09-20 07:16:57 +00:00
|
|
|
|
{
|
2023-09-20 08:13:29 +00:00
|
|
|
|
deployment = SerializeGate.Gate(deployment);
|
|
|
|
|
return starter.Wrap(deployment);
|
2023-09-15 14:27:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|