Skip to content

Commit

Permalink
Updates to Getting Started Docs (#674)
Browse files Browse the repository at this point in the history
* Update soroban output to current 21.x state

* Fix naming for HelloContractClient

* Consistent directory names

* formatting and link

---------

Co-authored-by: Bri <92327786+briwylde08@users.noreply.github.com>
  • Loading branch information
pselle and briwylde08 authored Jun 14, 2024
1 parent 7b235e8 commit 991a4ae
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/smart-contracts/getting-started/create-an-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You're going to need [Node.js](https://nodejs.org/en/download/package-manager/)

We want to initialize our current project as an Astro project. To do this, we can again turn to the `soroban contract init` command, which has a `--frontend-template` flag that allows us to pass the url of a frontend template repository. As we learned in [Storing Data](storing-data.mdx#adding-the-increment-contract), `soroban contract init` will not overwrite existing files, and is safe to use to add to an existing project.

From our `getting-started-tutorial` directory, run the following command to add the Astro template files.
From our `soroban-hello-world` directory, run the following command to add the Astro template files.

```sh
soroban contract init ./ \
Expand Down
6 changes: 3 additions & 3 deletions docs/smart-contracts/getting-started/hello-world.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Once you've [set up](./setup.mdx) your development environment, you're ready to

## Create a New Project

Create a new project using the `init` command to create a `getting-started-tutorial` project.
Create a new project using the `init` command to create a `soroban-hello-world` project.

```sh
soroban contract init soroban-hello-world
Expand Down Expand Up @@ -260,10 +260,10 @@ The contract is registered with the environment using the contract type. Contrac
let contract_id = env.register_contract(None, Contract);
```

All public functions within an `impl` block that is annotated with the `#[contractimpl]` attribute have a corresponding function generated in a generated client type. The client type will be named the same as the contract type with `Client` appended. For example, in our contract the contract type is `Contract`, and the client is named `ContractClient`.
All public functions within an `impl` block that is annotated with the `#[contractimpl]` attribute have a corresponding function generated in a generated client type. The client type will be named the same as the contract type with `Client` appended. For example, in our contract the contract type is `HelloContract`, and the client is named `HelloContractClient`.

```rust
let client = ContractClient::new(&env, &contract_id);
let client = HelloContractClient::new(&env, &contract_id);
let words = client.hello(&symbol_short!("Dev"));
```

Expand Down
13 changes: 7 additions & 6 deletions docs/smart-contracts/getting-started/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,28 +105,29 @@ soroban
$ soroban
Build, deploy, & interact with contracts; set identities to sign with; configure networks; generate keys; and more.

Intro: https://soroban.stellar.org
CLI Reference: https://github.com/stellar/soroban-tools/tree/main/docs/soroban-cli-full-docs.md
Stellar Docs: https://developers.stellar.org
CLI Full Hep Docs: https://github.com/stellar/soroban-cli/tree/main/FULL_HELP_DOCS.md

Usage: soroban [OPTIONS] <COMMAND>

Commands:
completion Print shell completion code for the specified shell
config Deprecated, use `soroban keys` and `soroban network` instead
contract Tools for smart contract developers
events Watch the network for contract events
keys Create and manage identities including keys and addresses
lab Experiment with early features and expert tools
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 "soroban_cli::log::footprint=debug" or off "=off". Can also use env var `RUST_LOG`
-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. `soroban-hello`
--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

Expand Down
4 changes: 2 additions & 2 deletions docs/smart-contracts/getting-started/storing-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This tutorial assumes that you've already completed the previous steps in Gettin

The `soroban contract init` command allows us to initialize a new project with any of the example contracts from the [soroban-examples](https://github.com/stellar/soroban-examples) repo, using the `--with-example` (or `-w`) flag.

It will not overwrite existing files, so we can also use this command to add a new contract to an existing project. Run the command again with a `--with-example` flag to add an `increment` contract to our project. From inside our `getting-started-tutorial` directory, run:
It will not overwrite existing files, so we can also use this command to add a new contract to an existing project. Run the command again with a `--with-example` flag to add an `increment` contract to our project. From inside our `soroban-hello-world` directory, run:

```sh
soroban contract init ./ --with-example increment
Expand Down Expand Up @@ -138,7 +138,7 @@ For now, it's worth knowing that there are three kinds of storage: `Persistent`,

### Build the contract

From inside `getting-started-tutorial`, run:
From inside `soroban-hello-world`, run:

```sh
soroban contract build
Expand Down

0 comments on commit 991a4ae

Please sign in to comment.