cs-codex-dist-tests/GethPlugin/GethPlugin.cs

43 lines
1.0 KiB
C#
Raw Normal View History

2023-09-15 10:36:35 +00:00
using Core;
namespace GethPlugin
{
public class GethPlugin : IProjectPlugin, IHasLogPrefix, IHasMetadata
{
2023-09-15 13:52:02 +00:00
private readonly GethStarter starter;
2023-09-15 10:36:35 +00:00
public GethPlugin(IPluginTools tools)
{
2023-09-15 13:52:02 +00:00
starter = new GethStarter(tools);
2023-09-15 10:36:35 +00:00
}
public string LogPrefix => "(Geth) ";
public void Announce()
{
//tools.GetLog().Log($"Loaded with Codex ID: '{codexStarter.GetCodexId()}'");
}
public void AddMetadata(IAddMetadata metadata)
{
//metadata.Add("codexid", codexStarter.GetCodexId());
}
public void Decommission()
{
}
2023-09-19 09:51:59 +00:00
public IGethStartResult StartGeth(Action<IGethSetup> setup)
2023-09-15 13:52:02 +00:00
{
var startupConfig = new GethStartupConfig();
setup(startupConfig);
return starter.StartGeth(startupConfig);
}
2023-09-19 09:51:59 +00:00
public IGethNode WrapGethContainer(IGethStartResult startResult)
{
return starter.WrapGethContainer(startResult);
}
2023-09-15 10:36:35 +00:00
}
}