diff --git a/docs/build/smart-contracts/getting-started/_stellar_cli_help.mdx b/docs/build/smart-contracts/getting-started/_stellar_cli_help.mdx new file mode 100644 index 000000000..14f52e50d --- /dev/null +++ b/docs/build/smart-contracts/getting-started/_stellar_cli_help.mdx @@ -0,0 +1,75 @@ +```console +$ stellar --help +Build, deploy, & interact with contracts; set identities to sign with; configure networks; generate keys; and more. + +Stellar Docs: https://developers.stellar.org +CLI Full Help Docs: https://github.com/stellar/stellar-cli/tree/main/FULL_HELP_DOCS.md + +The easiest way to get started is to generate a new identity: + + stellar keys generate alice + +You can use identities with the `--source` flag in other commands later. + +Commands that relate to smart contract interactions are organized under the `contract` subcommand. List them: + + stellar contract --help + +A Soroban contract has its interface schema types embedded in the binary that gets deployed on-chain, making it possible to dynamically generate a custom CLI for each. The invoke subcommand makes use of this: + + stellar contract invoke --id CCR6QKTWZQYW6YUJ7UP7XXZRLWQPFRV6SWBLQS4ZQOSAF4BOUD77OTE2 --source alice --network testnet -- --help + +Anything after the `--` double dash (the "slop") is parsed as arguments to the contract-specific CLI, generated on-the-fly from the embedded schema. For the hello world example, with a function called `hello` that takes one string argument `to`, here's how you invoke it: + + stellar contract invoke --id CCR6QKTWZQYW6YUJ7UP7XXZRLWQPFRV6SWBLQS4ZQOSAF4BOUD77OTE2 --source alice --network testnet -- hello --to world + + +Usage: stellar [OPTIONS] + +Commands: + completion Print shell completion code for the specified shell + contract Tools for smart contract developers + events Watch the network for contract events + keys Create and manage identities including keys and addresses + xdr Decode and encode XDR + network Start and configure networks + version Print version information + tx Sign, Simulate, and Send transactions + cache Cache for transactions and contract specs + +Options: + --global + Use global config + + -f, --filter-logs + Filter logs output. To turn on "stellar_cli::log::footprint=debug" or off "=off". Can also use env var `RUST_LOG` + + -q, --quiet + Do not write logs to stderr including `INFO` + + -v, --verbose + Log DEBUG events + + --very-verbose + Log DEBUG and TRACE events + + [aliases: vv] + + --list + List installed plugins. E.g. `stellar-hello` + + --no-cache + Do not cache your simulations and transactions + + [env: STELLAR_NO_CACHE=] + + -h, --help + Print help (see a summary with '-h') + + -V, --version + Print version + +TESTING_OPTIONS: + --config-dir + Location of config directory, default is "." +``` diff --git a/docs/build/smart-contracts/getting-started/setup.mdx b/docs/build/smart-contracts/getting-started/setup.mdx index cb9f9f1e1..dd0c93d1b 100644 --- a/docs/build/smart-contracts/getting-started/setup.mdx +++ b/docs/build/smart-contracts/getting-started/setup.mdx @@ -4,6 +4,8 @@ title: Setup description: Install and configure Rust and CLI to deploy smart contracts. --- +import StellarCliHelp from "./_stellar_cli_help.mdx"; + Install and configure Rust to deploy smart contracts. @@ -114,80 +116,7 @@ Report issues and share feedback about the Stellar CLI [here](https://github.com Run the `stellar --help` command and you should see output like below. -```console -$ stellar --help -Build, deploy, & interact with contracts; set identities to sign with; configure networks; generate keys; and more. - -Stellar Docs: https://developers.stellar.org -CLI Full Help Docs: https://github.com/stellar/stellar-cli/tree/main/FULL_HELP_DOCS.md - -The easiest way to get started is to generate a new identity: - - stellar keys generate alice - -You can use identities with the `--source` flag in other commands later. - -Commands that relate to smart contract interactions are organized under the `contract` subcommand. List them: - - stellar contract --help - -A Soroban contract has its interface schema types embedded in the binary that gets deployed on-chain, making it possible to dynamically generate a custom CLI for each. The invoke subcommand makes use of this: - - stellar contract invoke --id CCR6QKTWZQYW6YUJ7UP7XXZRLWQPFRV6SWBLQS4ZQOSAF4BOUD77OTE2 --source alice --network testnet -- --help - -Anything after the `--` double dash (the "slop") is parsed as arguments to the contract-specific CLI, generated on-the-fly from the embedded schema. For the hello world example, with a function called `hello` that takes one string argument `to`, here's how you invoke it: - - stellar contract invoke --id CCR6QKTWZQYW6YUJ7UP7XXZRLWQPFRV6SWBLQS4ZQOSAF4BOUD77OTE2 --source alice --network testnet -- hello --to world - - -Usage: stellar [OPTIONS] - -Commands: - completion Print shell completion code for the specified shell - contract Tools for smart contract developers - events Watch the network for contract events - keys Create and manage identities including keys and addresses - xdr Decode and encode XDR - network Start and configure networks - version Print version information - cache Cache for tranasctions and contract specs - -Options: - --global - Use global config - - -f, --filter-logs - Filter logs output. To turn on "stellar_cli::log::footprint=debug" or off "=off". Can also use env var `RUST_LOG` - - -q, --quiet - Do not write logs to stderr including `INFO` - - -v, --verbose - Log DEBUG events - - --very-verbose - Log DEBUG and TRACE events - - [aliases: vv] - - --list - List installed plugins. E.g. `stellar-hello` - - --no-cache - Do not cache your simulations and transactions - - [env: STELLAR_NO_CACHE=] - - -h, --help - Print help (see a summary with '-h') - - -V, --version - Print version - -TESTING_OPTIONS: - --config-dir - Location of config directory, default is "." -``` + :::tip