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 command in rpc admin guide #727

Merged
merged 3 commits into from
Jun 28, 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
24 changes: 12 additions & 12 deletions docs/data/rpc/admin-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ curl "http://localhost:8000"
You can interact with this local node using the Stellar CLI. First, add it as a configured network:

```bash
soroban network add standalone \
stellar network add standalone \
--rpc-url "http://localhost:8000/soroban/rpc" \
--network-passphrase "Standalone Network ; February 2017"
```

Then generate a unique identity (public/private keypair) to use with it:

```bash
soroban keys generate alice
stellar keys generate alice
```

:::tip Test-only Identities
Expand All @@ -79,19 +79,19 @@ It's a good practice to never use the same keys for testing and development that
Finally, fund your new account on the local sandbox environment by making a request to the local Friendbot:

```bash
curl "http://localhost:8000/friendbot?addr=$(soroban keys address alice)"
curl "http://localhost:8000/friendbot?addr=$(stellar keys address alice)"
```

:::tip Command Expansion `$(...)`

This uses [command expansion](https://www.gnu.org/software/bash/manual/html_node/Command-Substitution.html), which only works with bash-compatible shells. If you are using Windows or some other shell, you will need to copy the output of `soroban config…` and paste it into the `curl` command, or figure out how command expansion works in your shell.
This uses [command expansion](https://www.gnu.org/software/bash/manual/html_node/Command-Substitution.html), which only works with bash-compatible shells. If you are using Windows or some other shell, you will need to copy the output of `stellar config…` and paste it into the `curl` command, or figure out how command expansion works in your shell.

:::

Now that you have a configured network and a funded identity, you can use these within other Stellar CLI commands. For example, deploying a contract:

```bash
soroban contract deploy \
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/[project_name].wasm \
--source alice \
--network standalone
Expand All @@ -100,7 +100,7 @@ soroban contract deploy \
Or invoking a contract:

```bash
soroban contract invoke \
stellar contract invoke \
--id C... \
--source alice \
--network standalone \
Expand Down Expand Up @@ -130,7 +130,7 @@ docker run --rm -it \
And you'll want to configure it for use with the `--network` flag in Stellar CLI:

```bash
soroban network add testnet \
stellar network add testnet \
--rpc-url "http://localhost:8000/soroban/rpc" \
--network-passphrase "Test SDF Network ; September 2015"
```
Expand All @@ -140,7 +140,7 @@ Replace `testnet` in that command with the name of your choice if you want to le
The `alice` identity suggested for your Standalone network will still work here, since it's just a public/private keypair, but you'll need to remember to fund it for the Testnet network:

```bash
curl "https://friendbot.stellar.org/?addr=$(soroban keys address alice)"
curl "https://friendbot.stellar.org/?addr=$(stellar keys address alice)"
janewang marked this conversation as resolved.
Show resolved Hide resolved
```

Now you can replace `--network standalone` with `--network testnet` (or whatever you named it) in all your commands that need a network, like the `deploy` and `invoke` commands shown above.
Expand All @@ -161,7 +161,7 @@ docker run --rm -it \
And you'll want to configure it for use with the `--network` flag in Stellar CLI:

```bash
soroban network add futurenet \
stellar network add futurenet \
--rpc-url "http://localhost:8000/soroban/rpc" \
--network-passphrase "Test SDF Future Network ; October 2022"
```
Expand All @@ -171,7 +171,7 @@ Replace `futurenet` in that command with the name of your choice, if you want to
The `alice` identity suggested for your Standalone and Testnet networks will still work here, since it's just a public/private keypair, but you'll need to remember to fund it for the Futurenet network:

```bash
curl "https://friendbot-futurenet.stellar.org/?addr=$(soroban keys address alice)"
curl "https://friendbot-futurenet.stellar.org/?addr=$(stellar keys address alice)"
```

Now you can replace `--network standalone` with `--network futurenet` (or whatever you named it) in all your commands that need a network, like the `deploy` and `invoke` commands shown above.
Expand Down Expand Up @@ -526,15 +526,15 @@ For all deployments, we recommend at least 10GB of disk/storage space.
You can configure Stellar CLI to use a remote RPC endpoint:

```bash
soroban network add --global testnet \
stellar network add --global testnet \
--rpc-url https://soroban-testnet.stellar.org:443 \
--network-passphrase 'Test SDF Network ; September 2015'
```

And fund your accounts/identities with the publicly hosted Friendbot:

```bash
curl "https://friendbot.stellar.org/?addr=$(soroban keys address alice)"
curl "https://friendbot.stellar.org/?addr=$(stellar keys address alice)"
```

See the tip above about command expansion (that's the note about `$(...)`) if you're not using a bash-based shell.
Expand Down
Loading