Skip to content

Commit

Permalink
Fix/1759 followup (#1847)
Browse files Browse the repository at this point in the history
* Fix some spelling in cookbook

* Add friendbot doc link

* Replace public key in tx-new.mdx
  • Loading branch information
elizabethengelman authored Jan 22, 2025
1 parent f189a6a commit 27c9ad2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
15 changes: 7 additions & 8 deletions cookbook/tx-new.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ custom_edit_url: https://github.com/stellar/stellar-cli/edit/main/cookbook/tx-ne
---

So far the examples of the CLI interacting with the blockchain have been through the `contract` command. Uploading contracts, deploying contracts, and invoking them.
Each of these are different types of transactions, which must be signed and submitted to the network (and in the case of contract related transations simulated first).
Each of these are different types of transactions, which must be signed and submitted to the network (and in the case of contract related transactions simulated first).

Technically these three are different operations, of which a transaction can contain upto 100 operations. However, in the case of contract related operations a transaction is limited to just one.
Technically these three are different operations, of which a transaction can contain up to 100 operations. However, in the case of contract related operations a transaction is limited to just one.

So for all other transactions the CLI provides the `tx` subcommands. These are:

Expand All @@ -26,15 +26,14 @@ For the following examples we will use the following accounts:
stellar keys generate --fund alice --network testnet
stellar keys generate --no-fund bob
# You can add a public key to the keys
stellar keys add --public-key GCXLHURQS5LX77PBQWEGJLYDPXGVR2F5ME2OPBWQBGJKG2IOBBO2XY5O charlie
stellar keys add --public-key GBUG7QTBTT47XVDVE6RZYWRUZBPLOIO57INE6LYZDMIXMMDCREQRUQKI charlie
## and use testnet
stellar network use testnet
```

### Create Account

Creates and funds a new Stellar account. Above `alice` was funded by friendbot[citation here]. However,
`bob` and `charlie` were not. So we can use the `create-account` command to fund them.
Creates and funds a new Stellar account. Above `alice` was funded by [friendbot](https://developers.stellar.org/docs/learn/fundamentals/networks#friendbot). However, `bob` and `charlie` were not. So we can use the `create-account` command to fund them.

`bob` will receive 10 XLM and `charlie` will get 1 XLM.

Expand Down Expand Up @@ -89,7 +88,7 @@ Merge one account into another, transferring all XLM.
```sh
stellar tx new account-merge \
--source bob \
--account chalrie
--account charlie
```

Notes:
Expand All @@ -102,7 +101,7 @@ Modify authorization flags on a trustline:
```sh
stellar tx new set-trustline-flags \
--source alice \
--asset USDC:GCXLHURQS5LX77PBQWEGJLYDPXGVR2F5ME2OPBWQBGJKG2IOBBO2XY5O \
--asset USDC:GBUG7QTBTT47XVDVE6RZYWRUZBPLOIO57INE6LYZDMIXMMDCREQRUQKI \
--trustor charlie \
--set-authorize \
--set-authorize-to-maintain-liabilities \
Expand All @@ -125,7 +124,7 @@ Configure account settings:
```sh
stellar tx new set-options \
--source alice \
--inflation-dest GCXLHURQS5LX77PBQWEGJLYDPXGVR2F5ME2OPBWQBGJKG2IOBBO2XY5O \
--inflation-dest GBUG7QTBTT47XVDVE6RZYWRUZBPLOIO57INE6LYZDMIXMMDCREQRUQKI \
--home-domain "example.com" \
--master-weight 100 \
--med-threshold 100 \
Expand Down
2 changes: 1 addition & 1 deletion cookbook/tx-op-add.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Create stellar transactions using the Stellar CLI
custom_edit_url: https://github.com/stellar/stellar-cli/edit/main/cookbook/tx-op-add.mdx
---

As see before you can use pipes to pass a transaction envolope between commands. Before we have only been looking at transactions with one operation,
As seen before you can use pipes to pass a transaction envelope between commands. Before we have only been looking at transactions with one operation,
however, as mentioned there can be up to 100 operations in a single transaction.

To add an operation to a transaction you can use the `tx op add` command. This command takes the transaction envolope from the previous command and adds an operation to it.
Expand Down
4 changes: 2 additions & 2 deletions cookbook/tx-sign.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ custom_edit_url: https://github.com/stellar/stellar-cli/edit/main/cookbook/tx-si

The previous examples of using `tx new` showed how to create transactions. However, these transactions were immediately ready to be signed and submitted to the network.

To avoid this each of the subcommands has the `--build-only` argument, which as the name suggests only builds the transaction and prints the transaction envolope.
To avoid this each of the subcommands has the `--build-only` argument, which as the name suggests only builds the transaction and prints the transaction envelope.

## `tx sign`

Expand Down Expand Up @@ -44,7 +44,7 @@ This should output something like:
```sh
AAAAAgAAAADwSUp9CwmVlPN40mKX1I1j39y6DmYc36QS1aK2x6eYVQAAAGQAEcMsAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAACTMkzn1TwPo8SIhnKvnyuv9K2/aWjpX9NTYfyiA7vXaAAAAAAX14QAAAAAAAAAAAcenmFUAAABA2FCmaY4U8eFtqzJ1iEowvP1mashskYVxlqPjrM4miH0Q+QrF//A/NWflZPYzR+lySNrjJnRad851+4TbCekICw==
```
You can again [view it in lab and see that there is now a signature attached to the transaction envolope](AAAAAgAAAADwSUp9CwmVlPN40mKX1I1j39y6DmYc36QS1aK2x6eYVQAAAGQAEcMsAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAACTMkzn1TwPo8SIhnKvnyuv9K2/aWjpX9NTYfyiA7vXaAAAAAAX14QAAAAAAAAAAAcenmFUAAABA2FCmaY4U8eFtqzJ1iEowvP1mashskYVxlqPjrM4miH0Q+QrF//A/NWflZPYzR+lySNrjJnRad851+4TbCekICw==).
You can again [view it in lab and see that there is now a signature attached to the transaction envelope](AAAAAgAAAADwSUp9CwmVlPN40mKX1I1j39y6DmYc36QS1aK2x6eYVQAAAGQAEcMsAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAACTMkzn1TwPo8SIhnKvnyuv9K2/aWjpX9NTYfyiA7vXaAAAAAAX14QAAAAAAAAAAAcenmFUAAABA2FCmaY4U8eFtqzJ1iEowvP1mashskYVxlqPjrM4miH0Q+QrF//A/NWflZPYzR+lySNrjJnRad851+4TbCekICw==).

::tip
Or sign with lab! Though currently you must send it from lab and cannot return to the CLI (a work in progress!).
Expand Down

0 comments on commit 27c9ad2

Please sign in to comment.