Skip to content

feat(cli): wire invoke and account commands to native flows - #54

Merged
P3az3 merged 1 commit into
MillestoneX:mainfrom
peterexcel494-oss:feat/issue-34-invoke-account-native-flows
Jul 28, 2026
Merged

feat(cli): wire invoke and account commands to native flows#54
P3az3 merged 1 commit into
MillestoneX:mainfrom
peterexcel494-oss:feat/issue-34-invoke-account-native-flows

Conversation

@peterexcel494-oss

@peterexcel494-oss peterexcel494-oss commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #34

Wires up the two remaining CLI stubs identified in issue #34 so they call into native Stellar/Soroban tooling instead of printing "NOT yet implemented" banners.


What changed

milestonex-cli invoke <method> [args...] — was a stub, now fully wired

  • Shells out to stellar contract invoke with the correct flags.
  • Resolves contract ID from (in priority order): CONTRACT_ID env var → SOROBAN_CONTRACT_ID.milestonex_contract_id file written by make deploy-testnet.
  • Resolves signing source from SOROBAN_SOURCESTELLAR_SECRET_KEY.
  • Reads SOROBAN_NETWORK (default: testnet).
  • Uses serde_json to validate JSON args before passing to stellar-cli; warns if an arg looks like malformed JSON.
  • Prints a rich usage block listing all canonical milestonex-campaign analytics methods (version, get_dashboard_metrics, get_campaign_report, get_platform_summary, etc.).

milestonex-cli account — upgraded deprecation + transparent delegation

  • Replaced single-line deprecation warning with a prominent box-drawing banner.
  • account create → transparently delegates to keypair generate-master (with banner).
  • account fund <addr> <xlm> → transparently delegates to keypair fund (with banner).
  • Unknown sub-commands print a clear redirect to the keypair namespace.

docs/deployment.md CLI status table

Command Before After
invoke <method> ⚠️ Stub ✅ Implemented — env var instructions included
account / account create / account fund ⚠️ Deprecated (warning) ⚠️ Deprecated (banner + transparent delegation)

README.md

  • Removed invoke from the list of stubs.
  • Updated quick-start Step 4 to show milestonex-cli invoke version and milestonex-cli invoke get_dashboard_metrics 1 directly.
  • Troubleshooting section no longer lists invoke as a stub command.

Acceptance criteria (issue #34)

  • invoke works against CampaignContract::version and CampaignContract::get_dashboard_metrics (wired to stellar contract invoke which targets the canonical campaign contract).
  • account create|fund aliases transparently to keypair generate-master|fund with deprecation warning.
  • Updated CLI help table (docs/deployment.md + print_available_commands() in main.rs).

Affected files

  • crates/tools/src/main.rs
  • docs/deployment.md
  • README.md

Dependencies

Depends on the serde_json crate, which was already present in crates/tools/Cargo.toml. No new dependencies added.

Closes #34

…neX#34)

- handle_invoke: replace stub with full stellar contract invoke shell-out
  - resolves CONTRACT_ID from env var, SOROBAN_CONTRACT_ID, or .milestonex_contract_id
  - resolves source from SOROBAN_SOURCE or STELLAR_SECRET_KEY
  - validates JSON args via serde_json before passing to stellar-cli
  - prints friendly usage with canonical campaign contract method list
- handle_account: upgrade deprecation from warning line to prominent banner box
  - account create → transparently delegates to keypair generate-master
  - account fund   → transparently delegates to keypair fund
- docs/deployment.md: update CLI status table
  - invoke: ⚠️ Stub → ✅ Implemented with env var instructions
  - account rows: reflect 'deprecation banner' and 'Transparently delegates'
- README.md: remove invoke from stub list, update quick-start Step 4

Closes MillestoneX#34
@P3az3

P3az3 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@peterexcel494-oss resolve conflicts

@peterexcel494-oss

Copy link
Copy Markdown
Contributor Author

@P3az3 Please kindly review

1 similar comment
@peterexcel494-oss

Copy link
Copy Markdown
Contributor Author

@P3az3 Please kindly review

@peterexcel494-oss

Copy link
Copy Markdown
Contributor Author

@P3az3 Please kindly review........

@P3az3 P3az3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@P3az3
P3az3 merged commit f68b6b8 into MillestoneX:main Jul 28, 2026
4 checks passed
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.

Wire up milestonex-cli invoke / milestonex-cli account to native flows

2 participants