Skip to content

Commit

Permalink
Forc deploy docs update (FuelLabs#1306)
Browse files Browse the repository at this point in the history
* Update example text for forc deploy

* Update forc deploy

* Better link to page
  • Loading branch information
bing authored Apr 21, 2022
1 parent d17a848 commit 505984d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
16 changes: 3 additions & 13 deletions docs/src/forc/commands/forc_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,8 @@ Whether to compile using the original (pest based) parser

## EXAMPLES:

Deploy contract project. Crafts a contract deployment transaction then sends it to a running node.
You can use `forc deploy`, which triggers a contract deployment transaction and sends it to a running node.

Alternatively, you could deploy your contract programmatically using our SDK:
Alternatively, you can deploy your Sway contract programmatically using [fuels-rs](https://github.com/FuelLabs/fuels-rs), our Rust SDK.

```rust
// Build the contract
let salt: [u8; 32] = rng.gen();
let salt = Salt::from(salt);
let compiled = Contract::compile_sway_contract("./", salt).unwrap();

// Launch a local network and deploy the contract
let compiled = Contract::compile_sway_contract("./", salt).unwrap();
let client = Provider::launch(Config::local_node()).await.unwrap();
let contract_id = Contract::deploy(&compiled, &client).await.unwrap();
```
You can find an example within our [fuels-rs book](https://fuellabs.github.io/fuels-rs/latest/getting-started/basics.html#deploying-a-sway-contract).
16 changes: 3 additions & 13 deletions scripts/forc-documenter/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,11 @@ You can find an example under the [Testing with Rust](../../testing/testing-with
"#;

pub static FORC_DEPLOY_EXAMPLE: &str = r#"
Deploy contract project. Crafts a contract deployment transaction then sends it to a running node.
You can use `forc deploy`, which triggers a contract deployment transaction and sends it to a running node.
Alternatively, you could deploy your contract programmatically using our SDK:
Alternatively, you can deploy your Sway contract programmatically using [fuels-rs](https://github.com/FuelLabs/fuels-rs), our Rust SDK.
```rust
// Build the contract
let salt: [u8; 32] = rng.gen();
let salt = Salt::from(salt);
let compiled = Contract::compile_sway_contract("./", salt).unwrap();
// Launch a local network and deploy the contract
let compiled = Contract::compile_sway_contract("./", salt).unwrap();
let client = Provider::launch(Config::local_node()).await.unwrap();
let contract_id = Contract::deploy(&compiled, &client).await.unwrap();
```
You can find an example within our [fuels-rs book](https://fuellabs.github.io/fuels-rs/latest/getting-started/basics.html#deploying-a-sway-contract).
"#;

pub static FORC_PARSE_BYTECODE_EXAMPLE: &str = r#"
Expand Down

0 comments on commit 505984d

Please sign in to comment.