| Crates.io | stellar-registry-cli |
| lib.rs | stellar-registry-cli |
| version | 0.0.10 |
| created_at | 2025-05-13 13:07:00.720404+00 |
| updated_at | 2025-09-11 17:26:41.228074+00 |
| description | Stellar CLI plugin for publishing and deploying contracts |
| homepage | https://github.com/ahalabs/scaffold-stellar |
| repository | https://github.com/ahalabs/scaffold-stellar/tree/main/crates/stellar-registry-cli |
| max_upload_size | |
| id | 1671880 |
| size | 177,591 |
Command line interface for managing smart contract deployments through the Stellar Registry system. This tool enables publishing, deploying, and installing contracts that have been published to the Stellar Registry.
Install from cargo:
cargo install stellar-registry-cli
Or cargo-binstall:
cargo binstall stellar-registry-cli
Publish a compiled contract to the Stellar Registry:
stellar registry publish \
--wasm <PATH_TO_WASM> \
[--author <AUTHOR_ADDRESS>] \
[--wasm-name <NAME>] \
[--binver <VERSION>] \
[--dry-run]
Options:
--wasm: Path to the compiled WASM file (required)--author (-a): Author address (optional, defaults to the configured source account)--wasm-name: Name for the published contract (optional, extracted from contract metadata if not provided)--binver: Binary version (optional, extracted from contract metadata if not provided)--dry-run: Simulate the publish operation without actually executing it (optional)Deploy a published contract with optional initialization parameters:
stellar registry deploy \
--contract-name <NAME> \
--wasm-name <NAME> \
[--version <VERSION>] \
-- \
[CONSTRUCTOR_FUNCTION] [CONSTRUCTOR_ARGS...]
Options:
--contract-name: Name to give this contract instance (required)--wasm-name: Name of the published contract to deploy (required)--version: Specific version of the published contract to deploy (optional, defaults to most recent version)CONSTRUCTOR_FUNCTION: Optional constructor function name if contract implements initializationCONSTRUCTOR_ARGS: Optional arguments for the constructor functionNote: Use -- to separate CLI options from constructor function and arguments.
Install a deployed contract as an alias to be used by stellar-cli:
stellar registry install <CONTRACT_NAME>
Options:
CONTRACT_NAME: Name of the deployed contract to install (required)stellar-cli provides a way to use a default config for accounts and networks:
stellar keys use alice
stellar network use testnet
The CLI can be configured through environment variables:
STELLAR_REGISTRY_CONTRACT_ID: Override the default registry contract IDSTELLAR_NETWORK: Network to use (e.g., "testnet", "mainnet")STELLAR_RPC_URL: Custom RPC endpoint (default: https://soroban-testnet.stellar.org:443)STELLAR_NETWORK_PASSPHRASE: Network passphrase (default: Test SDF Network ; September 2015)STELLAR_ACCOUNT: Source account to useThese variables can also be in a .env file in the current working directory.
stellar registry publish \
--wasm path/to/my_token.wasm \
--wasm-name token \
--binver "1.0.0"
stellar registry deploy \
--contract-name my-token \
--wasm-name token \
--version "1.0.0" \
-- \
initialize \
--name "My Token" \
--symbol "MTK" \
--decimals 7
stellar registry install my-token
Then can interact with the contract with stellar-cli:
stellar contract invoke --id my-token -- --help
Before you are ready to publish and deploy your contract on mainnet you need to be confident that it is safe.
Make sure you are following security best practices recommended by the stellar docs.
You can use scout soroban to statically analyze your code for potential security issues.
For an additional level of security you can get your contract audited. Stellar has an Audit Bank that will help connect you with experienced audit providers and help cover the costs of the audit. See here if you qualify.
Once you are satisfied with your contract you can publish and deploy on Mainnet.
The first step is adding Mainnet to your stellar-cli. See the recommended list of RPC providers here
Then you must add it with the following command:
stellar network add mainnet --network-passphrase "Public Global Stellar Network ; September 2015" --rpc-url <FROM_LIST>
Then make it your default
stellar network use mainnet
or if using a bash like shell to set it for just the current session:
export STELLAR_NETWORK=mainnet
or if while in the current directory:
echo STELLAR_NETWORK=mainnet >> .env
Publishing and deploying are exactly the same as other networks, except now you use real lumens!