Skip to content

Commit

Permalink
fix: Fix an issue where the genesis key changes every time the applic…
Browse files Browse the repository at this point in the history
…ation runs
  • Loading branch information
s2quake committed Jul 15, 2024
1 parent dfe895d commit de9a6a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/console/LibplanetConsole.Consoles/ApplicationBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Libplanet.Types.Blocks;
using LibplanetConsole.Common;
using LibplanetConsole.Common.Serializations;
using LibplanetConsole.Consoles.Serializations;
Expand Down Expand Up @@ -55,7 +56,7 @@ protected ApplicationBase(ApplicationOptions options)
};
GenesisOptions = new()
{
GenesisKey = new(),
GenesisKey = (AppPrivateKey)BlockChainUtility.AppProtocolKey,
GenesisValidators = [.. options.Nodes.Select(item => item.PublicKey)],
Timestamp = DateTimeOffset.UtcNow,
};
Expand Down
2 changes: 1 addition & 1 deletion src/node/LibplanetConsole.Nodes/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public Node(IServiceProvider serviceProvider, ApplicationOptions options, ILogge
{
GenesisOptions = new GenesisOptions
{
GenesisKey = new(),
GenesisKey = (AppPrivateKey)BlockChainUtility.AppProtocolKey,
GenesisValidators = options.GenesisValidators,
Timestamp = DateTimeOffset.UtcNow,
},
Expand Down

0 comments on commit de9a6a0

Please sign in to comment.