Skip to content

Commit

Permalink
Merge pull request #109 from notV4l/sozo-profile
Browse files Browse the repository at this point in the history
add docs for sozo common options (profile/offline)
  • Loading branch information
ponderingdemocritus authored Nov 29, 2023
2 parents fe55772 + 9143973 commit 40c13b4
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
- [Dojoup](./toolchain/dojoup.md)
- [Sozo](./toolchain/sozo/overview.md)
- [Reference](./toolchain/sozo/reference.md)
- [profile](./toolchain/sozo/common-options/profile.md)
- [offline](./toolchain/sozo/common-options/offline.md)
- [init](./toolchain/sozo/project-commands/init.md)
- [build](./toolchain/sozo/project-commands/build.md)
- [test](./toolchain/sozo/project-commands/test.md)
Expand All @@ -69,7 +71,8 @@
- [Reference](./toolchain/torii/reference.md)
- [Graphql](./toolchain/torii/graphql.md)
- [Slot](./toolchain/slot/overview.md)
- [Referrence](./toolchain/slot/reference.md)
- [Reference](./toolchain/slot/reference.md)
- [Deployments](./toolchain/slot/deployments-commands/deployments.md)

# Deploying

Expand Down
18 changes: 18 additions & 0 deletions src/toolchain/sozo/common-options/offline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# offline
## use sozo offline

`--offline`
    Run without accessing the network.
    [env: SOZO_OFFLINE=]

### USAGE

```sh
sozo --offline [COMMAND]
```

For example

```sh
sozo --offline build
```
41 changes: 41 additions & 0 deletions src/toolchain/sozo/common-options/profile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## use sozo profiles

Profiles can be convenient when dealing with multiple environments (dev, staging, prod)

`--profile`
    Specify profile to use by name.

`--dev`
    Use dev profile.

`--release`
    Use release profile.


### USAGE

Multiple profiles can be defined in Scarb.toml

```sh
[profile.dev.tool.dojo.env]
rpc_url = "http://localhost:5050"
account_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
private_key = "0x1800000000300000180000000000030000000000003006001800006600"

[profile.staging.tool.dojo.env]
rpc_url = "https://api.cartridge.gg/x/mydojoproject/katana"
account_address = "0x5686a647a9cdd63ade617e0baf3b364856b813b508f03903eb58a7e622d5855"
private_key = "0x33003003001800009900180300d206308b0070db00121318d17b5e6262150b"
```

Then used with sozo commands

```sh
sozo --profile dev migrate
```

is equivalent to

```sh
sozo migrate --rpc-url http://localhost:5050 --account-address 0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973 --private-key 0x1800000000300000180000000000030000000000003006001800006600
```
6 changes: 6 additions & 0 deletions src/toolchain/sozo/project-commands/migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ sozo migrate --name ohayo --rpc-url http://localhost:5050
```sh
sozo migrate --world 0x123456
```

3. Deploying your World using [profile options](../common-options/profile-options.md)

```sh
sozo --profile dev migrate
```
5 changes: 5 additions & 0 deletions src/toolchain/sozo/reference.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## sozo reference

### Common options

- [profile](./common-options/profile.md)
- [offline](./common-options/offline.md)

### Project Commands

- [init](./project-commands/init.md)
Expand Down

0 comments on commit 40c13b4

Please sign in to comment.