Skip to content

chore: migrate rust/stake_neuron_from_cli to icp-cli#1417

Draft
marc0olo wants to merge 1 commit into
masterfrom
chore/migrate-rust-stake-neuron-to-icp-cli
Draft

chore: migrate rust/stake_neuron_from_cli to icp-cli#1417
marc0olo wants to merge 1 commit into
masterfrom
chore/migrate-rust-stake-neuron-to-icp-cli

Conversation

@marc0olo

Copy link
Copy Markdown
Member

Summary

  • Converts the dfx-based CLI binary (ic-agent + tokio + clap) into an icp-cli canister that performs NNS neuron staking via inter-canister calls
  • Replaces dfx.json + setup_and_run.sh with icp.yaml (@dfinity/rust@v3.3.0) and a workspace Cargo.toml
  • Adds backend/lib.rs using ic-cdk 0.20 (Call::bounded_wait) with two public endpoints: compute_subaccount (query) and stake_neuron (update)
  • Adds Makefile with local-testable assertions on compute_subaccount; stake_neuron requires mainnet NNS canisters (noted in README and Makefile)
  • Adds CI workflow (.github/workflows/stake_neuron_from_cli.yml) using ghcr.io/dfinity/icp-dev-env-rust:1.0.0; removes old dfx-based workflow
  • README preserves all educational NNS domain knowledge (subaccount computation, two-step staking flow, fee/amount requirements)

Test plan

  • cargo check --target wasm32-unknown-unknown passes (verified locally)
  • CI workflow rust-stake_neuron_from_cli runs icp deploy + make test which exercises compute_subaccount locally
  • stake_neuron endpoint is documented as mainnet-only and tested manually on IC mainnet with a funded canister

🤖 Generated with Claude Code

Converts the dfx-based CLI binary into an icp-cli canister example.
Replaces ic-agent/tokio/clap with ic-cdk inter-canister calls, adds
icp.yaml (rust@v3.3.0), Makefile with local compute_subaccount tests,
CI workflow, and updated README preserving the educational NNS staking
domain knowledge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant