Skip to content

Commit

Permalink
Update stellar cli command in rpc admin guide (#727)
Browse files Browse the repository at this point in the history
* Update stellar cli command in rpc admin guide

* Remove friendbot funding

* Update mdx format
  • Loading branch information
janewang authored Jun 28, 2024
1 parent e50156b commit 98a275c
Showing 1 changed file with 9 additions and 33 deletions.
42 changes: 9 additions & 33 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:
Then generate a unique identity (public/private keypair) and to fund it using:

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

:::tip Test-only Identities
Expand All @@ -76,22 +76,10 @@ 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)"
```

:::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.

:::

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 +88,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,19 +118,13 @@ 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"
```

Replace `testnet` in that command with the name of your choice if you want to leave the name `testnet` available for use with a public RPC provider (see below). Or make clever use of `--global` configs for public providers and local configs (made with the undecorated `network add` command above) for local nodes.

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)"
```

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.

### Futurenet
Expand All @@ -161,19 +143,13 @@ 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"
```

Replace `futurenet` in that command with the name of your choice, if you want to leave the name `futurenet` available for use with a public RPC provider (see below). Or make clever use of `--global` configs for public providers and local configs (made with the undecorated `network add` command above) for local nodes.

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)"
```

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.

## Deploy Your Own RPC Instance
Expand Down Expand Up @@ -526,15 +502,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

0 comments on commit 98a275c

Please sign in to comment.