Skip to content

Commit fbd8923

Browse files
ElliotFriendfnando
andauthored
change cookbook docs links (#2231)
Co-authored-by: Nando Vieira <me@fnando.com>
1 parent 4b99a25 commit fbd8923

29 files changed

Lines changed: 1916 additions & 2238 deletions

.cargo-husky/hooks/pre-commit

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22

33
set -ex
44

5-
cargo fmt --check || (cargo fmt && exit 1)
6-
make generate-full-help-doc
5+
make docs > /dev/null
6+
make fmt > /dev/null
7+
8+
set +x
9+
git diff --exit-code > /dev/null || (echo "\nERROR: Staged files were modified by hooks. Please review and stage the changes." && exit 1)

.cargo-husky/hooks/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ cargo clippy --all -- -Dwarnings
1010

1111
cargo build
1212
cargo test --all || (echo "might need to rebuild make build-snapshot" && exit 1)
13-
make generate-full-help-doc
13+
make docs

.github/copilot-instructions.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,27 @@
77
Stellar CLI is a Rust-based command-line tool for interacting with the Stellar network. It's organized as a Cargo workspace with multiple crates and uses both Cargo and Make for build automation.
88

99
### Bootstrap and Build
10+
1011
- Install system dependencies: `sudo apt-get update && sudo apt-get install -y libudev-dev libdbus-1-dev build-essential`
1112
- Install Rust toolchain: `rustup update` (Rust 1.89.0+ required)
1213
- Add WebAssembly target: `rustup target add wasm32v1-none`
1314
- Build main CLI: `cargo build --bin stellar` -- takes 45 seconds. NEVER CANCEL.
1415
- Install CLI: `make install` -- takes 3 minutes with potential network timeouts. NEVER CANCEL. Set timeout to 10+ minutes.
1516

1617
### Core Development Commands
18+
1719
- Format code: `make fmt` -- takes 2 seconds
1820
- Run linting: `make check` -- takes 7 minutes. NEVER CANCEL. Set timeout to 15+ minutes.
1921
- Build main CLI only: `cargo build --bin stellar` -- takes 45 seconds. Use this for quick iterations.
2022

2123
### Testing
24+
2225
- Test main soroban-cli library: `cargo test --package soroban-cli --lib` -- takes 52 seconds. NEVER CANCEL.
2326
- Test individual crates: `cargo test --package <crate-name>` -- typically takes 40 seconds per crate.
2427
- **WARNING**: Full test suite via `make test` requires building WebAssembly test fixtures and consumes significant memory and disk space. It may fail with "No space left on device" in constrained environments.
2528

2629
### CLI Usage and Validation
30+
2731
- Test CLI installation: `stellar --version`
2832
- Basic CLI validation: `stellar --help`
2933
- Generate test keys: `stellar keys generate <name>`
@@ -39,6 +43,7 @@ Stellar CLI is a Rust-based command-line tool for interacting with the Stellar n
3943
## Common Tasks
4044

4145
### Repository Structure
46+
4247
```
4348
/home/runner/work/stellar-cli/stellar-cli/
4449
├── cmd/
@@ -55,6 +60,7 @@ Stellar CLI is a Rust-based command-line tool for interacting with the Stellar n
5560
```
5661

5762
### Key Commands Reference
63+
5864
```bash
5965
# Development workflow
6066
cargo build --bin stellar # Quick build (45s)
@@ -74,6 +80,7 @@ stellar keys address test # Test key operations
7480
```
7581

7682
### Build Time Expectations
83+
7784
- **NEVER CANCEL** any build or test command before these timeouts:
7885
- `cargo build --bin stellar`: 2 minutes timeout minimum
7986
- `make install`: 10 minutes timeout (network issues common)
@@ -82,25 +89,30 @@ stellar keys address test # Test key operations
8289
- Core library tests: 5 minutes timeout minimum
8390

8491
### Known Issues
92+
8593
- **Network timeouts**: `make install` frequently encounters network timeouts with crates.io. This is normal in CI environments.
8694
- **Memory constraints**: Full workspace build and test may fail with OOM or "No space left on device" errors in constrained environments.
87-
- **Documentation generation**: `make generate-full-help-doc` may fail due to disk space constraints.
95+
- **Documentation generation**: `make docs` may fail due to disk space constraints.
8896

8997
### Working Around Constraints
98+
9099
- Use `cargo build --bin stellar` instead of full workspace build for development
91100
- Test individual packages with `cargo test --package <name>` instead of full test suite
92101
- Use `cargo install --force --locked --path ./cmd/stellar-cli` as alternative to `make install`
93102

94103
## Critical Warnings
104+
95105
- **NEVER CANCEL builds or tests** before the specified timeout periods
96106
- **Always validate changes** by building and testing the CLI before committing
97107
- **Network issues are common** - retry `make install` if it fails with timeouts
98108
- **Use surgical builds** when possible to avoid memory/disk issues
99109

100110
## CI/CD Integration
111+
101112
The project uses GitHub Actions with workflows in `.github/workflows/`:
113+
102114
- `rust.yml`: Main CI pipeline with formatting, linting, building, and testing
103115
- `e2e.yml`: End-to-end system tests
104116
- `binaries.yml`: Multi-platform binary builds
105117

106-
Always run `make fmt` and `make check` locally before pushing to ensure CI passes.
118+
Always run `make fmt` and `make check` locally before pushing to ensure CI passes.

.github/workflows/docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
pull_request:
77

88
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
9+
group:
10+
${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
1011
cancel-in-progress: true
1112

1213
jobs:

.github/workflows/rust.yml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ jobs:
3131
if: always()
3232
needs:
3333
[
34-
fmt,
3534
cargo-deny,
36-
check-generated-full-help-docs,
35+
check,
3736
build-and-test,
3837
build-and-test-macos,
3938
build-and-test-windows,
@@ -42,18 +41,9 @@ jobs:
4241
]
4342
runs-on: ubuntu-latest
4443
steps:
45-
- if:
46-
contains(needs.*.result, 'failure') || contains(needs.*.result,
47-
'cancelled')
44+
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
4845
run: exit 1
4946

50-
fmt:
51-
runs-on: ubuntu-latest-8-cores
52-
steps:
53-
- uses: actions/checkout@v5
54-
- run: rustup update
55-
- run: cargo fmt --all --check
56-
5747
cargo-deny:
5848
runs-on: ubuntu-latest
5949
strategy:
@@ -67,15 +57,15 @@ jobs:
6757
with:
6858
command: check ${{ matrix.check }}
6959

70-
check-generated-full-help-docs:
60+
check:
7161
runs-on: ubuntu-latest-8-cores
7262
steps:
7363
- uses: actions/checkout@v5
7464
- uses: stellar/actions/rust-cache@main
75-
- run: rustup update
7665
- run: sudo apt update && sudo apt install -y libudev-dev libdbus-1-dev
77-
- run: make generate-full-help-doc
78-
- run: git add -N . && git diff HEAD --exit-code
66+
- run: rustup update
67+
- run: npm install
68+
- run: make check
7969

8070
build-and-test:
8171
strategy:
@@ -96,9 +86,7 @@ jobs:
9686
rust-version: ${{ matrix.rust }}
9787

9888
build-and-test-macos:
99-
if:
100-
github.ref == 'refs/heads/main' || startsWith(github.ref,
101-
'refs/heads/release/') || startsWith(github.head_ref, 'release/')
89+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.head_ref, 'release/')
10290
strategy:
10391
fail-fast: false
10492
matrix:
@@ -117,9 +105,7 @@ jobs:
117105
rust-version: ${{ matrix.rust }}
118106

119107
build-and-test-windows:
120-
if:
121-
github.ref == 'refs/heads/main' || startsWith(github.ref,
122-
'refs/heads/release/') || startsWith(github.head_ref, 'release/')
108+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.head_ref, 'release/')
123109
strategy:
124110
fail-fast: false
125111
matrix:

CONTRIBUTING.md

Lines changed: 38 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,84 +2,76 @@
22

33
Thanks for taking the time to improve stellar-cli!
44

5-
The following is a set of guidelines for contributions and may change over time.
6-
Feel free to suggest improvements to this document in a pull request.We want to make it as easy as possible to contribute changes that help the Stellar network grow and
7-
thrive. There are a few guidelines that we ask contributors to follow so that we can merge your
8-
changes quickly.
5+
The following is a set of guidelines for contributions and may change over time. Feel free to suggest improvements to this document in a pull request.We want to make it as easy as possible to contribute changes that help the Stellar network grow and thrive. There are a few guidelines that we ask contributors to follow so that we can merge your changes quickly.
96

107
## Getting Started
118

12-
* Make sure you have a [GitHub account](https://github.com/signup/free).
13-
* Create a GitHub issue for your contribution, assuming one does not already exist.
14-
* Clearly describe the issue including steps to reproduce if it is a bug.
15-
* Fork the repository on GitHub.
9+
- Make sure you have a [GitHub account](https://github.com/signup/free).
10+
- Create a GitHub issue for your contribution, assuming one does not already exist.
11+
- Clearly describe the issue including steps to reproduce if it is a bug.
12+
- Fork the repository on GitHub.
1613

1714
## Setting up development environment
1815

1916
There are 2 ways to begin developing stellar-cli:
2017

21-
### Installing all required dependencies
18+
### Installing all required dependencies
2219

23-
You may want to install all required dependencies locally. This includes installing `rustup`, `make`, `libudev`, `jq` from your package manager. After all dependencies are installed, you can start with running `make install` to build `stellar-cli` and install it!
20+
You may want to install all required dependencies locally. This includes installing `rustup`, `make`, `libudev`, `jq` from your package manager. After all dependencies are installed, you can start with running `make install` to build `stellar-cli` and install it!
2421

2522
### Using `nix`
2623

2724
If you don't want to install necessary dependencies from above, you can run development shell using [nix](https://nixos.org/guides/how-nix-works/) (make sure to [install](https://nixos.org/download/) version above 2.20). After installing `nix`, simply run `nix develop` that will start new `bash` session in your current terminal. If you want to use different shell (e.g. `zsh`) you can run `nix develop -c zsh`
2825

2926
This session will have:
27+
3028
1. All required dependencies installed
3129
2. `stellar` alias (overwriting your existing `stellar` installed via cargo, if any)
3230
3. Configured auto-complete for the working git branch
3331

3432
You can add extra configuration in your `local.sh` file (for example, if you want to export some extra variables for your devshell you can put following in your `local.sh`:
33+
3534
```shell
3635
#!/usr/bin/env bash
3736
export STELLAR_NETWORK=testnet
3837
```
39-
Note that all of dependencies and configurations mentioned above is available only in your local development shell, not outside of it.
4038

39+
Note that all of dependencies and configurations mentioned above is available only in your local development shell, not outside of it.
4140

4241
### Minor Changes
4342

4443
#### Documentation
4544

46-
For small changes to comments and documentation, it is not
47-
always necessary to create a new GitHub issue. In this case, it is
48-
appropriate to start the first line of a commit with 'doc' instead of
49-
an issue number.
45+
For small changes to comments and documentation, it is not always necessary to create a new GitHub issue. In this case, it is appropriate to start the first line of a commit with 'doc' instead of an issue number.
5046

5147
## Finding things to work on
5248

53-
The first place to start is always looking over the current GitHub issues for the project you are
54-
interested in contributing to. Issues marked with [help wanted][help-wanted] are usually pretty
55-
self-contained and a good place to get started.
49+
The first place to start is always looking over the current GitHub issues for the project you are interested in contributing to. Issues marked with [help wanted][help-wanted] are usually pretty self-contained and a good place to get started.
5650

57-
Stellar.org also uses these same GitHub issues to keep track of what we are working on. If you see
58-
any issues that are assigned to a particular person or have the `in progress` label, that means
59-
someone is currently working on that issue this issue in the next week or two.
51+
Stellar.org also uses these same GitHub issues to keep track of what we are working on. If you see any issues that are assigned to a particular person or have the `in progress` label, that means someone is currently working on that issue this issue in the next week or two.
6052

6153
Of course, feel free to create a new issue if you think something needs to be added or fixed.
6254

63-
6455
## Making Changes
6556

66-
* Fork the stellar-cli repo to your own Github account
57+
- Fork the stellar-cli repo to your own Github account
58+
59+
- List the current configured remote repository for your fork. Your git remote should initially look like this.
60+
61+
```
62+
$ git remote -v
63+
> origin https://github.com/YOUR_USERNAME/stellar-cli.git (fetch)
64+
> origin https://github.com/YOUR_USERNAME/stellar-cli.git (push)
65+
```
6766

68-
* List the current configured remote repository for your fork. Your git remote
69-
should initially look like this.
70-
```
71-
$ git remote -v
72-
> origin https://github.com/YOUR_USERNAME/stellar-cli.git (fetch)
73-
> origin https://github.com/YOUR_USERNAME/stellar-cli.git (push)
74-
```
67+
- Set the `stellar/stellar-cli` repo as the remote upstream repository that will sync with your fork.
7568

76-
* Set the `stellar/stellar-cli` repo as the remote upstream repository that will
77-
sync with your fork.
7869
```
7970
git remote add upstream https://github.com/stellar/stellar-cli.git
8071
```
8172

82-
* Verify the new upstream repository you've specified for your fork.
73+
- Verify the new upstream repository you've specified for your fork.
74+
8375
```
8476
$ git remote -v
8577
> origin https://github.com/YOUR_USERNAME/stellar-cli.git (fetch)
@@ -88,38 +80,33 @@ sync with your fork.
8880
> upstream https://github.com/stellar/stellar-cli.git (push)
8981
```
9082

91-
* Add git hooks for commits and pushes so that checks run before pushing:
83+
- Add git hooks for commits and pushes so that checks run before pushing:
84+
9285
```
9386
./install_githooks.sh
9487
```
9588

96-
* Create a topic branch for your changes in your local repo. When you push you should be able
97-
to create PR based on upstream stellar/stellar-cli.
98-
99-
* Make sure you have added the necessary tests for your changes and make sure all tests pass.
89+
- Create a topic branch for your changes in your local repo. When you push you should be able to create PR based on upstream stellar/stellar-cli.
10090

91+
- Make sure you have added the necessary tests for your changes and make sure all tests pass.
10192

10293
## Submitting Changes
10394

104-
* All content, comments, pull requests and other contributions must comply with the
105-
[Stellar Code of Conduct][coc].
106-
* Push your changes to a topic branch in your fork of the repository.
107-
* Submit a pull request to the repo in the Stellar organization.
108-
* Include a descriptive [commit message][commit-msg].
109-
* Changes contributed via pull request should focus on a single issue at a time.
110-
* Rebase your local changes against the master branch. Resolve any conflicts that arise.
111-
95+
- All content, comments, pull requests and other contributions must comply with the [Stellar Code of Conduct][coc].
96+
- Push your changes to a topic branch in your fork of the repository.
97+
- Submit a pull request to the repo in the Stellar organization.
98+
- Include a descriptive [commit message][commit-msg].
99+
- Changes contributed via pull request should focus on a single issue at a time.
100+
- Rebase your local changes against the master branch. Resolve any conflicts that arise.
112101

113-
At this point you're waiting on us. We like to at least comment on pull requests within three
114-
business days (typically, one business day). We may suggest some changes, improvements or
115-
alternatives.
102+
At this point you're waiting on us. We like to at least comment on pull requests within three business days (typically, one business day). We may suggest some changes, improvements or alternatives.
116103

117104
# Additional Resources
118105

119-
* #dev-discussion channel on [Discord](https://discord.gg/BYPXtmwX)
106+
- #dev-discussion channel on [Discord](https://discord.gg/BYPXtmwX)
120107

121108
This document is inspired by:
122109

123-
[help-wanted]: https://github.com/stellar/stellar-cli/contribute
110+
[help-wanted]: https://github.com/stellar/stellar-cli/contribute
124111
[commit-msg]: https://github.com/erlang/otp/wiki/Writing-good-commit-messages
125112
[coc]: https://github.com/stellar/.github/blob/master/CODE_OF_CONDUCT.md

0 commit comments

Comments
 (0)