-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add genesis config option for Node #4017
Conversation
439d3da
to
557e951
Compare
} | ||
finally | ||
{ | ||
if (File.Exists(tempFilePath)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indent level can be reduced by one if the following code is used.
https://github.com/s2quake/libplanet-console/blob/main/src/common/LibplanetConsole.Common/IO/TempFile.cs
However, it's unfortunate that the code is not available in libplanet.node
[Description( | ||
$"The path of the genesis configuration, which can be a file path or a URI." + | ||
$"This property cannot be used with {nameof(GenesisKey)} and {nameof(GenesisBlockPath)}.")] | ||
public string GenesisConfigurationPath { get; set; } = string.Empty; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are many ways to create Genesis blocks, it may be better to create a type variable rather than increase the properties.
If the properties increase, the complexity will increase because the exception handling code must be implemented.
For example,
enum GenesisBlockType
{
Binary,
BinaryUrl,
Json,
JsonUrl
}
I don't know what the best way is, but I think it's worth considering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this suggestion should be dealt in one separated PR
@@ -8,7 +8,7 @@ | |||
<ItemGroup> | |||
<PackageReference Include="Cocona.Lite" Version="2.0.*" /> | |||
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" /> | |||
<PackageReference Include="System.Text.Json" Version="7.0.0" /> | |||
<PackageReference Include="System.Text.Json" Version="9.0.*" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bumping to the latest version is always welcome. At least for me. 😀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vulnerability in 7.0 causes failure in build 😢
This provides genesis base state configuration option.
Use "Genesis:GenesisConfigurationPath" and pass JSON represented base genesis state.
The structure of the JSON file is:
For more detail, please take a look at
sdk/node/Libplanet.Node.Tests/Services/BlockChainServiceTest.cs