feat: add Soroban vault operations CLI#465
Draft
carrion256 wants to merge 16 commits into
Draft
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| return Ok(()); | ||
| } | ||
| match response { | ||
| Response::Message { message } => println!("{message}"), |
| Response::Message { message } => println!("{message}"), | ||
| Response::Command { stdout, stderr } => { | ||
| if !stdout.is_empty() { | ||
| println!("{stdout}"); |
| println!("{stdout}"); | ||
| } | ||
| if !stderr.is_empty() { | ||
| eprintln!("{stderr}"); |
| } | ||
| } | ||
| Response::Status(status) => { | ||
| println!("Network: {}", status.network); |
| println!("Blend Adapters: not deployed"); | ||
| } else { | ||
| for adapter in &status.blend_adapters { | ||
| println!( |
| } | ||
| Response::Env(values) => { | ||
| for (key, value) in values { | ||
| println!("{key}={value}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
tmplr-soroban-vaultCLI crate for deploying and operating Soroban vault deployments through the Stellar CLI.The CLI includes typed deployment, curator, user, governance, share-token, and Blend adapter operations. It records deployment state in a manifest, reuses uploaded WASM by hash where possible, supports dry-run and machine-readable output modes, and adds a deployment-wide
extend-ttlcommand for every TTL-capable contract in the manifest.This also adds a Docker operator image at
tools/soroban-vault-cli/Dockerfile. The image includestmplr-soroban-vault,stellar-cliv26, Python for the runtime contractspec-strip step, and Rust toolchains/targets forstellar contract buildso operators can run deployment flows from a container.The curator proxy TTL gap is fixed: the proxy now has its own permissionless
extend_ttlentrypoint and refreshes its instance TTL when initialized config is read, matching the 4626 proxy liveness pattern.The CLI no longer requires or defaults a source account CLI argument. Operators can use the Stellar keystore/default identity via
stellar keys use <identity>, or pass a non-secret identity alias/public account with--source-account/SOROBAN_IDENTITY. Explicit source-account overrides are provided to childstellarcommands through a redactedSTELLAR_ACCOUNTenvironment override instead of--source-accountargv.The CLI rejects obvious raw secret keys and seed phrases passed to
--source-account, redacts source-account environment overrides from dry-run output and errors, zeroizes in-process override buffers after use, and scrubs source-account values from deployment manifests. If rawSTELLAR_ACCOUNTis set directly for signing, the CLI refuses to derive admin/caller addresses from it because that Stellar subcommand would require placing the secret in child argv; operators must pass explicit public--admin/--callervalues or use a keystore/default identity for that flow.This update also adds safer operator and automation surfaces:
--assets 1.25 --asset-decimals 7,--shares 10 --share-decimals manifest, and curator--amount 1.25 --asset-decimals 7convert to raw contract units without floating point.--assets-raw,--shares-raw, and--amount-raw.profile init <name>and--profile <name>can carry network/RPC/passphrase/state/workspace/config-dir/default public admin/caller/operator values without storing secrets.completions zsh|bash|fishandmangenerate shell completions and a roff manpage.--yesor interactive confirmation; JSON modes remain non-interactive.--jsonnow emits a stable envelope withtype,ok,network,manifest,commands,tx_hashes,warnings, and command-specificdataor structurederror.--json-linesemits the same newline-delimited envelope shape for automation that consumes long-running flows.missing_manifest_contract,mainnet_guard,secret_in_argv,invalid_args, andcommand_failed, including JSON parse-error output before clap exits.tools/soroban-vault-cli/schema/output.schema.json.This update also adds operator UX helpers:
doctorchecks Stellar CLI availability, configured network/passphrase/RPC, source identity availability without printing secrets, manifest writability, WASM artifact/build readiness, Docker mount health, and mainnet guard status.deploy plan stackanddeploy plan adaptersemit reuse/deploy/upload/manifest decisions and redacted Stellar command shapes without network writes or manifest changes.plan-accept,plan-submit-set-supply-queue, andplan-submit-set-timelock.queue,explain,accept-ready, andsubmit-and-waitflows with conservative decoding of pending proposal readiness.Operator impact
doctor.Validation
cargo fmt --package templar-curator-proxy-soroban --package templar-soroban-vault-cli --checkcargo fmt --package templar-soroban-vault-cli --checkcargo test -p templar-curator-proxy-soroban -- --nocapture(13 unit + 3 integration passed)cargo test -p templar-soroban-vault-cli -- --nocapture(45 passed)cargo clippy -p templar-curator-proxy-soroban --all-targets -- -D warningscargo clippy -p templar-soroban-vault-cli --all-targets -- -D warnings(exits 0; repo-levelunknown lint: clippy::ignore_without_reasonwarning remains)cargo run -q -p templar-soroban-vault-cli -- --json --source-account SC36XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX status(expected exit 2; emitssecret_in_argvJSON envelope)TEMPLAR_SOROBAN_VAULT_PROFILE_DIR=$(mktemp -d) cargo run -q -p templar-soroban-vault-cli -- profile init testnetcargo run -q -p templar-soroban-vault-cli -- completions bash > <tempfile>cargo run -q -p templar-soroban-vault-cli -- man > <tempfile>docker build --check -f tools/soroban-vault-cli/Dockerfile .docker build --network=host -f tools/soroban-vault-cli/Dockerfile -t templar/soroban-vault-cli:codex .docker run --rm --network=none templar/soroban-vault-cli:codex --helpsize-budget-checkpassed (123720 bytes)This change is