Removes genesis json.

This commit is contained in:
benbierens 2023-04-19 07:59:28 +02:00
parent 12d122ad83
commit 48ca6f41fa
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
7 changed files with 7 additions and 29 deletions

View File

@ -78,8 +78,8 @@ namespace DistTestCore
} }
catch (Exception e) catch (Exception e)
{ {
lifecycle.Log.Error($"Failed to start codex node: {e}"); lifecycle.Log.Error($"Failed to start codex node: {e}. Test infra failure.");
throw; throw new InvalidOperationException($"Failed to start codex node. Test infra failure.", e);
} }
} }
} }

View File

@ -23,14 +23,6 @@ namespace DistTestCore.Marketplace
return account; return account;
} }
public string ExtractGenesisJsonBase64()
{
var genesisJson = Retry(FetchGenesisJson);
if (string.IsNullOrEmpty(genesisJson)) throw new InvalidOperationException("Unable to fetch genesis-json for geth node. Test infra failure.");
return Convert.ToBase64String(Encoding.ASCII.GetBytes(genesisJson));
}
public string ExtractPubKey() public string ExtractPubKey()
{ {
var pubKey = Retry(FetchPubKey); var pubKey = Retry(FetchPubKey);
@ -78,11 +70,6 @@ namespace DistTestCore.Marketplace
} }
} }
private string FetchGenesisJson()
{
return workflow.ExecuteCommand(container, "cat", GethContainerRecipe.GenesisFilename);
}
private string FetchAccount() private string FetchAccount()
{ {
return workflow.ExecuteCommand(container, "cat", GethContainerRecipe.AccountFilename); return workflow.ExecuteCommand(container, "cat", GethContainerRecipe.AccountFilename);

View File

@ -6,11 +6,10 @@ namespace DistTestCore.Marketplace
{ {
public class GethBootstrapNodeInfo public class GethBootstrapNodeInfo
{ {
public GethBootstrapNodeInfo(RunningContainers runningContainers, string account, string genesisJsonBase64, string pubKey, string privateKey, Port discoveryPort) public GethBootstrapNodeInfo(RunningContainers runningContainers, string account, string pubKey, string privateKey, Port discoveryPort)
{ {
RunningContainers = runningContainers; RunningContainers = runningContainers;
Account = account; Account = account;
GenesisJsonBase64 = genesisJsonBase64;
PubKey = pubKey; PubKey = pubKey;
PrivateKey = privateKey; PrivateKey = privateKey;
DiscoveryPort = discoveryPort; DiscoveryPort = discoveryPort;
@ -18,7 +17,6 @@ namespace DistTestCore.Marketplace
public RunningContainers RunningContainers { get; } public RunningContainers RunningContainers { get; }
public string Account { get; } public string Account { get; }
public string GenesisJsonBase64 { get; }
public string PubKey { get; } public string PubKey { get; }
public string PrivateKey { get; } public string PrivateKey { get; }
public Port DiscoveryPort { get; } public Port DiscoveryPort { get; }

View File

@ -4,8 +4,6 @@ namespace DistTestCore.Marketplace
{ {
public class GethBootstrapNodeStarter : BaseStarter public class GethBootstrapNodeStarter : BaseStarter
{ {
private const string bootstrapGenesisJsonBase64 = "ewogICAgImNvbmZpZyI6IHsKICAgICAgImNoYWluSWQiOiA3ODk5ODgsCiAgICAgICJob21lc3RlYWRCbG9jayI6IDAsCiAgICAgICJlaXAxNTBCbG9jayI6IDAsCiAgICAgICJlaXAxNTVCbG9jayI6IDAsCiAgICAgICJlaXAxNThCbG9jayI6IDAsCiAgICAgICJieXphbnRpdW1CbG9jayI6IDAsCiAgICAgICJjb25zdGFudGlub3BsZUJsb2NrIjogMCwKICAgICAgInBldGVyc2J1cmdCbG9jayI6IDAsCiAgICAgICJpc3RhbmJ1bEJsb2NrIjogMCwKICAgICAgIm11aXJHbGFjaWVyQmxvY2siOiAwLAogICAgICAiYmVybGluQmxvY2siOiAwLAogICAgICAibG9uZG9uQmxvY2siOiAwLAogICAgICAiYXJyb3dHbGFjaWVyQmxvY2siOiAwLAogICAgICAiZ3JheUdsYWNpZXJCbG9jayI6IDAsCiAgICAgICJjbGlxdWUiOiB7CiAgICAgICAgInBlcmlvZCI6IDUsCiAgICAgICAgImVwb2NoIjogMzAwMDAKICAgICAgfQogICAgfSwKICAgICJkaWZmaWN1bHR5IjogIjEiLAogICAgImdhc0xpbWl0IjogIjgwMDAwMDAwMCIsCiAgICAiZXh0cmFkYXRhIjogIjB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMEFDQ09VTlRfSEVSRTAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiLAogICAgImFsbG9jIjogewogICAgICAiMHhBQ0NPVU5UX0hFUkUiOiB7ICJiYWxhbmNlIjogIjUwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiIH0KICAgIH0KICB9";
public GethBootstrapNodeStarter(TestLifecycle lifecycle, WorkflowCreator workflowCreator) public GethBootstrapNodeStarter(TestLifecycle lifecycle, WorkflowCreator workflowCreator)
: base(lifecycle, workflowCreator) : base(lifecycle, workflowCreator)
{ {
@ -23,20 +21,19 @@ namespace DistTestCore.Marketplace
var extractor = new ContainerInfoExtractor(workflow, bootstrapContainer); var extractor = new ContainerInfoExtractor(workflow, bootstrapContainer);
var account = extractor.ExtractAccount(); var account = extractor.ExtractAccount();
var genesisJsonBase64 = extractor.ExtractGenesisJsonBase64();
var pubKey = extractor.ExtractPubKey(); var pubKey = extractor.ExtractPubKey();
var privateKey = extractor.ExtractBootstrapPrivateKey(); var privateKey = extractor.ExtractBootstrapPrivateKey();
var discoveryPort = bootstrapContainer.Recipe.GetPortByTag(GethContainerRecipe.DiscoveryPortTag); var discoveryPort = bootstrapContainer.Recipe.GetPortByTag(GethContainerRecipe.DiscoveryPortTag);
LogEnd($"Geth bootstrap node started with account '{account}'"); LogEnd($"Geth bootstrap node started with account '{account}'");
return new GethBootstrapNodeInfo(containers, account, genesisJsonBase64, pubKey, privateKey, discoveryPort); return new GethBootstrapNodeInfo(containers, account, pubKey, privateKey, discoveryPort);
} }
private StartupConfig CreateBootstrapStartupConfig() private StartupConfig CreateBootstrapStartupConfig()
{ {
var config = new StartupConfig(); var config = new StartupConfig();
config.Add(new GethStartupConfig(true, bootstrapGenesisJsonBase64, null!)); config.Add(new GethStartupConfig(true, null!));
return config; return config;
} }
} }

View File

@ -34,7 +34,7 @@ namespace DistTestCore.Marketplace
private StartupConfig CreateCompanionNodeStartupConfig(GethBootstrapNodeInfo bootstrapNode) private StartupConfig CreateCompanionNodeStartupConfig(GethBootstrapNodeInfo bootstrapNode)
{ {
var config = new StartupConfig(); var config = new StartupConfig();
config.Add(new GethStartupConfig(false, bootstrapNode.GenesisJsonBase64, bootstrapNode)); config.Add(new GethStartupConfig(false, bootstrapNode));
return config; return config;
} }
} }

View File

@ -9,7 +9,6 @@ namespace DistTestCore.Marketplace
public const string WsPortTag = "ws_port"; public const string WsPortTag = "ws_port";
public const string DiscoveryPortTag = "disc_port"; public const string DiscoveryPortTag = "disc_port";
public const string AccountFilename = "account_string.txt"; public const string AccountFilename = "account_string.txt";
public const string GenesisFilename = "genesis.json";
public const string BootstrapPrivateKeyFilename = "bootstrap_private.key"; public const string BootstrapPrivateKeyFilename = "bootstrap_private.key";
protected override string Image => DockerImage; protected override string Image => DockerImage;
@ -21,7 +20,6 @@ namespace DistTestCore.Marketplace
var args = CreateArgs(config); var args = CreateArgs(config);
AddEnvVar("GETH_ARGS", args); AddEnvVar("GETH_ARGS", args);
AddEnvVar("GENESIS_JSON", config.GenesisJsonBase64);
} }
private string CreateArgs(GethStartupConfig config) private string CreateArgs(GethStartupConfig config)

View File

@ -2,15 +2,13 @@
{ {
public class GethStartupConfig public class GethStartupConfig
{ {
public GethStartupConfig(bool isBootstrapNode, string genesisJsonBase64, GethBootstrapNodeInfo bootstrapNode) public GethStartupConfig(bool isBootstrapNode, GethBootstrapNodeInfo bootstrapNode)
{ {
IsBootstrapNode = isBootstrapNode; IsBootstrapNode = isBootstrapNode;
GenesisJsonBase64 = genesisJsonBase64;
BootstrapNode = bootstrapNode; BootstrapNode = bootstrapNode;
} }
public bool IsBootstrapNode { get; } public bool IsBootstrapNode { get; }
public string GenesisJsonBase64 { get; }
public GethBootstrapNodeInfo BootstrapNode { get; } public GethBootstrapNodeInfo BootstrapNode { get; }
} }
} }