Skip to content

Commit

Permalink
Add build instructions to readme (FuelLabs#282)
Browse files Browse the repository at this point in the history
* Add CI badge.

* Add community badge.

* Update readme.

* Fix typo.

* Fix typo.

* Install to Cargo bin.

* Heading.
  • Loading branch information
adlerjohn authored Sep 30, 2021
1 parent 1f66ee9 commit bd47dae
Showing 1 changed file with 46 additions and 5 deletions.
51 changes: 46 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,54 @@
# Sway

[![Compile and Test](https://github.com/FuelLabs/sway/actions/workflows/cargo_test.yml/badge.svg)](https://github.com/FuelLabs/sway/actions/workflows/cargo_test.yml)
[![Community](https://img.shields.io/badge/chat%20on-discord-orange?&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/xfpK4Pe)

Sway is a language developed for the Fuel blockchain. It is heavily inspired by Rust and aims to bring modern language development and performance to the blockchain ecosystem.

## Running the Compiler
## Documentation

For user documentation, see the Sway Book: <https://fuellabs.github.io/sway/latest/>.

## Building from Source

To run the compiler from this directory:
### Dependencies

```sh
cargo run --bin forc -- -p <path_to_project>
cargo run --bin forc -- build -p example_project/fuel_project
Sway is built in Rust. To begin, install the Rust toolchain following instructions at <https://www.rust-lang.org/tools/install>. Then configure your Rust toolchain to use Rust `stable`:

```console
rustup default stable
```

If not already done, add the Cargo bin directory to your `PATH` by adding the following line to `~/.profile` and restarting the shell session.

```console
export PATH="${HOME}/.cargo/bin:${PATH}"
```

To ensure access to all dependent repositories, [create](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) and [add](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account) SSH keys to your GitHub account.

### Building Sway

Clone the repository and build the Sway toolchain:

```console
git clone [email protected]:FuelLabs/sway.git
cd sway
cargo build
```

Confirm the Sway toolchain built successfully:

```console
cargo run --bin forc -- --help
# or
./target/debug/forc --help
```

To run `forc` from any directory, install `forc` to your local Cargo bin directory:

```console
cargo install --path forc
# Also install sway-server if using the IDE plugin
cargo install --path sway-server
```

0 comments on commit bd47dae

Please sign in to comment.