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 stellar cli help. #753

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
75 changes: 75 additions & 0 deletions docs/build/smart-contracts/getting-started/_stellar_cli_help.mdx
Original file line number Diff line number Diff line change
@@ -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] <COMMAND>

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>
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 "."
```
77 changes: 3 additions & 74 deletions docs/build/smart-contracts/getting-started/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: Setup
description: Install and configure Rust and CLI to deploy smart contracts.
---

import StellarCliHelp from "./_stellar_cli_help.mdx";

<head>
<title>Install and configure Rust to deploy smart contracts.</title>
<meta charSet="utf-8" />
Expand Down Expand Up @@ -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] <COMMAND>

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>
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 "."
```
<StellarCliHelp />

:::tip

Expand Down
Loading