Skip to content

Conversation

@turuslan
Copy link
Contributor

@turuslan turuslan commented Sep 26, 2025

  • qlean generate-genesis (genesis-directory) (validator-count) (shadow?) command
    • generates "genesis/config.yaml", "genesis/nodes.yaml", "genesis/validators.yaml", "genesis/validator-config.yaml", "genesis/{node_id}.key"

Signed-off-by: turuslan <[email protected]>
@turuslan turuslan requested review from kamilsa and xDimon October 22, 2025 07:34
@kamilsa kamilsa requested a review from Copilot October 22, 2025 07:44
Copy link
Contributor

Copilot AI left a 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-genesis command 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 SamplePeer utility 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]>
@turuslan turuslan changed the title generate and read genesis files generate genesis files Oct 22, 2025
exit 2
fi

# Resolve absolute paths using Python for macOS portability (realpath -f is not standard)
Copy link
Member

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")"
Copy link
Member

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

@turuslan turuslan merged commit 76efda5 into master Nov 11, 2025
2 checks passed
@kamilsa kamilsa deleted the feature/genesis branch November 11, 2025 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants