feat: add nlean consensus client support#137
Conversation
There was a problem hiding this comment.
Pull request overview
Adds NLEAN-specific local devnet assets so spin-node.sh can launch an NLEAN-only topology using lean-quickstart’s client-cmd contract and a dedicated validator-config.
Changes:
- Added
local-devnet-nlean/genesis/validator-config.yamldefining a 4-node NLEAN local topology (ports, keys, aggregator selection). - Added
client-cmds/nlean-cmd.shimplementing the lean-quickstart client command contract for running NLEAN via binary or Docker.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| local-devnet-nlean/genesis/validator-config.yaml | Introduces an NLEAN-only validator topology for local deployments. |
| client-cmds/nlean-cmd.sh | Adds NLEAN client runner wiring (binary/docker) compatible with spin-node.sh. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| validators: | ||
| - name: "nlean_0" | ||
| privkey: "2e9be3f1b0d32ca3a4d62017fbfafe3950b7e90fed6802ff8bd2e0f8c4e2ca91" | ||
| enrFields: | ||
| ip: "127.0.0.1" | ||
| quic: 9101 | ||
| metricsPort: 18081 | ||
| httpPort: 5052 | ||
| count: 1 |
There was a problem hiding this comment.
does nlean use both apiPort and httpPort? @GrapeBaBa
|
|
||
| # Set API port flag if explicitly configured | ||
| api_port_flag="" | ||
| nlean_api_port="${NLEAN_API_PORT:-${httpPort:-}}" |
| enable_metrics="${enableMetrics:-false}" | ||
|
|
||
| enable_metrics=$(echo "$enable_metrics" | tr '[:upper:]' '[:lower:]') | ||
| if [[ "$enable_metrics" != "true" && "$enable_metrics" != "false" ]]; then | ||
| enable_metrics="false" | ||
| fi | ||
|
|
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_ATTESTATIONS=${NLEAN_DEBUG_DUMP_ATTESTATIONS}" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_DIR:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_DIR=${NLEAN_DEBUG_DUMP_DIR}" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_BLOCKS:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_BLOCKS=${NLEAN_DEBUG_DUMP_BLOCKS}" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_BLOCK_DIR:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_BLOCK_DIR=${NLEAN_DEBUG_DUMP_BLOCK_DIR}" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_OBSERVED_PROOFS:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_OBSERVED_PROOFS=${NLEAN_DEBUG_DUMP_OBSERVED_PROOFS}" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_OBSERVED_PROOFS_DIR:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_OBSERVED_PROOFS_DIR=${NLEAN_DEBUG_DUMP_OBSERVED_PROOFS_DIR}" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_OBSERVED_BLOCKS:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_OBSERVED_BLOCKS=${NLEAN_DEBUG_DUMP_OBSERVED_BLOCKS}" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_OBSERVED_BLOCKS_DIR:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_OBSERVED_BLOCKS_DIR=${NLEAN_DEBUG_DUMP_OBSERVED_BLOCKS_DIR}" |
- Add apiPort to validator-config.yaml for leanpoint health-check URLs - Use apiPort instead of httpPort for --api-port flag in nlean-cmd.sh - Always enable client metrics endpoint (enableMetrics only controls external stack) - Use Docker -e VAR (inherit) instead of -e VAR=value to avoid colon-breaking issues
- Add apiPort to validator-config.yaml for leanpoint health-check URLs - Use apiPort instead of httpPort for --api-port flag in nlean-cmd.sh - Use Docker -e VAR (inherit) instead of -e VAR=value to avoid colon-breaking issues
bc982a4 to
10ded38
Compare
- Add apiPort to validator-config.yaml for leanpoint health-check URLs - Use apiPort instead of httpPort for --api-port flag in nlean-cmd.sh - Use Docker -e VAR (inherit) instead of -e VAR=value to avoid colon-breaking issues
10ded38 to
f130d9d
Compare
There was a problem hiding this comment.
Pull request overview
Adds nlean consensus client integration to the lean-quickstart ecosystem, providing both a client-cmd contract script and a matching 4-node local devnet validator configuration.
Changes:
- Added
client-cmds/nlean-cmd.shimplementing the quickstart client-cmd contract for nlean (binary/docker), including support for aggregator, checkpoint sync, API port, metrics, and log-level configuration via env/flags. - Added
local-devnet-nlean/genesis/validator-config.yamldefining a 4-node local nlean devnet topology (ports, metrics, API, hash-sig keys, active epoch).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| local-devnet-nlean/genesis/validator-config.yaml | New 4-node nlean local devnet validator config aligned to quickstart topology/ports. |
| client-cmds/nlean-cmd.sh | New nlean client-cmd contract script supporting binary/docker execution and quickstart-provided per-node settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| log_level="${log_level#${log_level%%[![:space:]]*}}" | ||
| log_level="${log_level%${log_level##*[![:space:]]}}" | ||
| log_level_arg="" | ||
| if [[ -n "$log_level" ]]; then | ||
| log_level_arg="--log ${log_level}" | ||
| fi |
|
|
||
| # Set API port flag if explicitly configured | ||
| api_port_flag="" | ||
| nlean_api_port="${NLEAN_API_PORT:-${apiPort:-}}" |
| if [[ -n "${NLEAN_DEBUG_DUMP_ATTESTATIONS:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_ATTESTATIONS" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_DIR:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_DIR" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_BLOCKS:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_BLOCKS" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_BLOCK_DIR:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_BLOCK_DIR" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_OBSERVED_PROOFS:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_OBSERVED_PROOFS" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_OBSERVED_PROOFS_DIR:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_OBSERVED_PROOFS_DIR" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_OBSERVED_BLOCKS:-}" ]]; then | ||
| nlean_docker_extra_env+=" -e NLEAN_DEBUG_DUMP_OBSERVED_BLOCKS" | ||
| fi | ||
| if [[ -n "${NLEAN_DEBUG_DUMP_OBSERVED_BLOCKS_DIR:-}" ]]; then |
| # choose either binary or docker | ||
| node_setup="${NLEAN_QUICKSTART_SETUP:-binary}" |
- Add apiPort to validator-config.yaml for leanpoint health-check URLs - Use apiPort instead of httpPort for --api-port flag in nlean-cmd.sh - Use Docker -e VAR (inherit) instead of -e VAR=value to avoid colon-breaking issues
f130d9d to
6c1e88a
Compare
Add nlean consensus client integration for lean-quickstart.
Changes
Tested