-
Notifications
You must be signed in to change notification settings - Fork 3
generate genesis files #23
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
Conversation
Signed-off-by: turuslan <[email protected]>
0e06cbc to
f47ca0a
Compare
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.
Pull Request Overview
This PR adds functionality to generate genesis configuration files for a blockchain network. The command qlean generate-genesis creates a directory structure with configuration files for network validators and nodes, including cryptographic keys and ENR (Ethereum Node Records).
Key changes:
- Introduced
generate-genesiscommand that creates genesis configuration files (config.yaml, nodes.yaml, validators.yaml, validator-config.yaml, and node key files) - Enhanced ENR encoding/decoding with signature verification and support for custom IP addresses
- Updated
SamplePeerutility to support both localhost and shadow network IP configurations
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vcpkg-overlay/leanp2p/portfile.cmake | Updated leanp2p dependency to newer commit reference |
| src/utils/sample_peer.hpp | Refactored to support shadow network IPs and proper ENR generation |
| src/serde/enr.hpp | Added IP utilities, signature support, and updated encode function signature |
| src/serde/enr.cpp | Implemented signature verification/generation and refactored encoding logic |
| src/executable/lean_node.cpp | Integrated generate-genesis command handler |
| src/commands/generate_genesis.hpp | New command implementation for genesis file generation |
| src/app/configurator.cpp | Updated help text to include new command |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
| exit 2 | ||
| fi | ||
|
|
||
| # Resolve absolute paths using Python for macOS portability (realpath -f is not standard) |
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.
You can use canonical_path + file existence check to avoid call python.
| printf " ip_addr: %s\n" "$ip" | ||
| printf " processes:\n" | ||
| printf " - path: %s\n" "$QLEAN_PATH_ABS" | ||
| printf " args: \"%s\"\n" "$(yaml_escape "$joined")" |
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.
Better to build list of args: it mor resistant to spaces in paths and special characters
qlean generate-genesis (genesis-directory) (validator-count) (shadow?)command