Skip to content

Add networkId to stellar configuration#202

Open
LELOUCH-Vii wants to merge 1 commit into
Stellar-Ecosystem:mainfrom
LELOUCH-Vii:LELOUCH-Vii-patch-1-1
Open

Add networkId to stellar configuration#202
LELOUCH-Vii wants to merge 1 commit into
Stellar-Ecosystem:mainfrom
LELOUCH-Vii:LELOUCH-Vii-patch-1-1

Conversation

@LELOUCH-Vii

@LELOUCH-Vii LELOUCH-Vii commented Jun 22, 2026

Copy link
Copy Markdown

Closes #131
'stellar:testnet' as the network string for the x402 signer, instead of
reading it from config. This meant deploying Lodestar to mainnet would
silently keep signing with the testnet network ID, causing a network
mismatch that surfaced only as a generic 402 failure.
backend/src/config.js**: added stellar.networkId, a derived value
(stellar:${STELLAR_NETWORK}) built from the existing STELLAR_NETWORK
env var. Kept stellar.network (bare testnet/mainnet) unchanged for
existing consumers.

Summary by CodeRabbit

  • Chores
    • Updated backend network configuration to support dynamic identification of Stellar network environments based on deployment settings.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c04eb3b9-bf1a-4976-99e6-387dbece9e8c

📥 Commits

Reviewing files that changed from the base of the PR and between 5bbe6bd and dfbad8d.

📒 Files selected for processing (1)
  • backend/src/config.js

📝 Walkthrough

Walkthrough

A single field, networkId, is added to the config.stellar object in backend/src/config.js. It is computed as `stellar:${process.env.STELLAR_NETWORK ?? 'testnet'}` and included in the frozen config export alongside the existing Stellar fields.

Changes

Stellar networkId config field

Layer / File(s) Summary
Add stellar.networkId to frozen config
backend/src/config.js
Adds networkId to config.stellar, prefixing stellar: to the STELLAR_NETWORK env variable value with a 'testnet' fallback.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A single line hops into place,
stellar:testnet no longer hardcased,
The network string reads from the air,
One config field beyond compare,
🐇 Lodestar now knows where it goes!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR only adds the networkId field to config but does not address the primary objectives: replacing hardcoded network strings in demo.js, services.js, and agent.js; updating paymentConfig; adding startup assertions; or documenting the STELLAR_NETWORK variable. Complete the remaining objectives from issue #131: replace hardcoded 'stellar:testnet' strings with config values, update paymentConfig, add startup validation, and document STELLAR_NETWORK in .env.example files.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: adding a networkId field to stellar configuration in backend/src/config.js.
Out of Scope Changes check ✅ Passed The single line change adding networkId to config is directly in scope and aligned with the first step of issue #131's implementation plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@ritik4ever ritik4ever left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Adding stellar.networkId to the configuration is a useful first step, but by itself it doesn't fully resolve Issue #131.

The hardcoded network strings in the x402 signer/payment flow still need to be replaced with configuration-driven values, and the remaining requirements from the issue (startup validation, env documentation updates, related call-site updates, etc.) are not included in this PR.

Could you please expand the implementation to cover the full issue requirements, or alternatively narrow the PR scope and open a separate issue for the remaining work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants