Skip to content

Commit

Permalink
Update contributing guide and clean flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Ifropc committed Aug 9, 2024
1 parent c91dc0c commit 0742afc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ snapshot.json
test_snapshots
.vscode/settings.json
.idea
local.sh
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,31 @@ changes quickly.
* Clearly describe the issue including steps to reproduce if it is a bug.
* Fork the repository on GitHub.

## Setting up development environment

There are 2 ways to being developing stellar-cli:

### Installing all required dependencies

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 build` to build `stellar-cli` on your machine!

### Using `nix`

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`

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

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`:
```shell
#!/usr/bin/env bash
export STELLAR_NETWORK=testnet
```
Note that all of dependencies and configurations mentioned above is available only in your local development shell, not outside of it.


### Minor Changes

#### Documentation
Expand Down
6 changes: 2 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@
''
echo "Using `nix --version`"
alias stellar="cargo run --bin stellar --"
SOROBAN_SECRET_KEY=SBPXU3OP65M2DQPRM4YFZ5NME66NWWH5DHN44IBDYAN4TFKKY7CS4OHY stellar keys add dev_key
export STELLAR_NETWORK=testnet
export STELLAR_ACCOUNT=dev_key
shell=$0
[ -f ./local.sh ] && source ./local.sh
shell=$0
shell=`basename $SHELL`
source <(stellar completion --shell $shell)
'';
Expand Down

0 comments on commit 0742afc

Please sign in to comment.