Skip to main content

Workdir Conventions

Workdir Conventions

Suibase define a few conventions to coordinate among SDKs, apps and user.


This section present more advanced subjects. If just starting to use Suibase scripts, then you may want to skip it.

Filesystem Path Convention

There are 5 <WORKDIR>: active, localnet, devnet, testnet and mainnet

Each <WORKDIR> has the following components:

sui-execScript for any app to call the right sui client+config combination for this workdir. Use it like you would use the "sui" client from Mysten Labs.
configDirectory with Mysten Labs files needed to run the sui client (client.yaml and sui.keystore).
sui-repoLocal repo of Mysten Labs sui code for building the client binary. Provides also the matching Rust SDK crates.
published-dataInfo about last package published from this <WORKDIR>. Can be retrieved through JSON files or suibase SDK helpers.
workdir-execScript allowing any app to call the right "workdir script".
Example: $ ~/suibase/workdirs/localnet/workdir-exec update is equivalent to the shortcut $ localnet update

Applications can expect the components to be always at these fix locations:

     └─ workdirs/
          └─ <WORKDIR>/
                ├── sui-exec
                ├── workdir-exec
                ├── config
                │      ├── client.yaml
                │      └── sui.keystore
                ├── sui-repo
                │      ├── crates/
                │      ├── target/
                │      └── ... complete sui repo (debug built) ...
                └── published-data
                       └─ <package name>
                               └─ ... various JSON information ...
Official and Complete Path List

What is the publish-output.json?

It is the output of a publish command.

Example, type $ cd ~/suibase/rust/demo-app && localnet publish). This will create a publish-output.json file in ~/suibase/workdirs/localnet/published-data/demo/most-recent

The published-output.json can then be parsed by your app to get package and object IDs of the published module(s).

That info is also available in two convenient JSON files: package-id.json and created-objects.json.

See Suibase Helper for convenient SDKs to find and read these JSON files.

Last update: