Site builder commands

We now describe in more detail the commands available through the site builder.

Tip

In general, the --help flag is your friend, you can add it to get further details for the whole CLI (site-builder --help) or individual commands (e.g. site-builder update --help).

publish

The publish command, as described in the previous section, publishes a new site on Sui. The command takes a directory as input and creates a new Walrus Site from the resources contained within.

The --epochs flag allows you to specify for how long the site data will be stored on Walrus. By default, this is set to 1 epoch.

Epoch duration on Walrus Testnet

On Walrus Testnet, one epoch will last 1 day. Therefore, consider storing your site for a large number of epochs if you want to make it available for the following months! The maximum duration is set to 200 epochs.

If you are just uploading raw files without an index.html, you may want to use the --list-directory flag, which will automatically create an index page to browse the files. See for example https://bin.blob.store.

The publish command will also respect the instructions in the ws-resources.json configuration file. To know more, see the section on specifying headers and routing.

update

This command is the equivalent of publish, but for updating an existing site. It takes the same arguments, with the addition of the Sui object ID of the site to update.

Note

The wallet you are using to call update must be the owner of the Walrus Site object to be able to update it.

convert

The convert command converts an object ID in hex format to the equivalent Base36 format. This command is useful if you have the Sui object ID of a Walrus Site, and want to know the subdomain where you can browse it.

site-map

The sitemap command shows the resources that compose the Walrus Site at the given object ID.

list-directory

With list-directory, you can obtain the index.html file that would be generated by running publish or update with the --list-directory flag. This is useful to see how the index page would look like before publishing it—and possibly editing to make it look nicer!