Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update soroban's help output. #695

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 54 additions & 17 deletions docs/smart-contracts/getting-started/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,33 @@ Report issues and share feedback about the Stellar CLI [here](https://github.com

### Usage

Run the `stellar` command and you should see output like below.

```sh
stellar
```
Run the `stellar --help` command and you should see output like below.

```console
$ stellar
$ 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 Reference: https://github.com/stellar/stellar-cli/blob/main/FULL_HELP_DOCS.md
CLI Full Hep Docs: https://github.com/stellar/stellar-cli/tree/main/FULL_HELP_DOCS.md
fnando marked this conversation as resolved.
Show resolved Hide resolved

The easiest way to get started is to generate a new identity:

stellar config identity generate alice
fnando marked this conversation as resolved.
Show resolved Hide resolved

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] <COMMAND>

Expand All @@ -121,18 +136,40 @@ Commands:
cache Cache for tranasctions and contract specs
fnando marked this conversation as resolved.
Show resolved Hide resolved

Options:
--global Use global config
-f, --filter-logs <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 more with '--help')
-V, --version Print version
--global
Use global config

-f, --filter-logs <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 <CONFIG_DIR> Location of config directory, default is "."
--config-dir <CONFIG_DIR>
Location of config directory, default is "."
```

:::tip
Expand Down
Loading