DeWeb CLI
The DeWeb CLI is a command-line tool designed for deploying, editing, and deleting decentralized websites on the DeWeb platform.
Downloading the CLI tool
You can download the DeWeb CLI tool from the DeWeb Releases Page.
On macOS or Linux run chmod +x deweb-cli_{targetOS}
command before ./deweb-cli_{targetOS}
to allow execution.
On Windows, use deweb-cli_{targetOS}.exe
instead of ./deweb-cli_{targetOS}
Usage
You can use the deweb-cli
command to interact with the DeWeb. Below is the basic usage syntax:
deweb-cli [global options] command [command options] [arguments...]
Global Options
--wallet_nickname, -w
: Specify the wallet nickname to use.--node_url, -n
: Specify the node URL.--config, -c
: Load configuration from a specified file path (default:./deweb_cli_config.yaml
).
Commands
upload
Uploads a new website to the DeWeb.
deweb-cli upload [global options] <website_zip_file_path>
Arguments
<website_zip_file_path>
: Path to the zip file containing the website to be uploaded.
Example
deweb-cli upload -w myWallet -n https://mainnet.massa.net/api/v2 ./website.zip
The zip file should contain an index.html
at its root. For example, if you build an app and the output is in a directory (usually build
or dist
), you can zip it using the following command from the output directory:
zip {name}.zip -r ./*
This should result in a zip file with all the files from the output directory, with the index.html
at its root.
Note: Server Side Rendering (SSR) is not supported at this time. Ensure your website is fully client-side rendered.
edit
Edits an existing website on the DeWeb.
deweb-cli edit [global options] <website_sc_address> <website_zip_file_path>
Arguments
<website_sc_address>
: Smart contract address of the website to be edited.<website_zip_file_path>
: Path to the zip file containing the updated website.
Example
deweb-cli edit -w myWallet -n http://node-url.com <website_sc_address> ./updated_website.zip
delete
Deletes an existing website from the DeWeb.
deweb-cli delete [global options] <website_sc_address>
Arguments
<website_sc_address>
: Smart contract address of the website to be deleted.
Example
deweb-cli delete -w myWallet -n http://node-url.com <website_sc_address>
Configuration
The CLI can be configured using a YAML file. By default, it looks for deweb_cli_config.yaml
in the current directory. You can specify a different configuration file using the --config
flag.
Sample Configuration (deweb_cli_config.yaml
)
wallet_config:
wallet_nickname: "alice"
node_url: "https://buildnet.massa.net/api/v2"
sc_config:
minimal_fees: 0
max_gas: 0
max_coins: 0
expiry: 0
Logging
The CLI logs its output to ./deweb-cli.log
. Logging is initialized automatically when the application starts.
The CLI section of the documentation is a work in progress. A complete documentation is coming soon. We appreciate your patience and feedback.