CLI Configuration
The DeWeb CLI supports configuration via a JSON file, allowing users to manage essential settings like wallet credentials and node details for seamless website deployment on the Massa blockchain.
Config File Structureβ
Hereβs a sample deweb_cli_config.json setup:
{
"wallet_password": "your-wallet-password",
"wallet_path": "your-wallet.yaml",
"node_url": "https://mainnet.massa.net/api/v2",
"chunk_size": 64000,
"metadatas": {
"TITLE": "My Website",
"DESCRIPTION": "This is my website",
"KEYWORD1": "deweb",
"KEYWORD2": "massa",
}
}
Hereβs a breakdown of each field:
node_url: The URL of the Massa node where your website will be uploaded.chunk_size: Defines the size in bytes of each chunk for file upload. The default is typically64000, but it can be adjusted based on your needs and network conditions.wallet_password: The password for your Massa wallet file, used whenwallet_pathis specified.wallet_path: The file path to your Massa wallet in YAML format. Only YAML wallet files are supported.secret_key: The secret key for your Massa account. Use this as an alternative towallet_passwordandwallet_path.address: The address of an already deployed website.uploadthen edits this website instead of deploying a new one, andlist,show,metadatause it when no address is given on the command line.metadatas: An optional field that allows you to specify metadatas for your website. Those metadatas will be stored on the Massa blockchain and can be accessed by anyone.About MetadatasThe following metadata keys will be used for website indexing and decentralized search:
TITLE: The title of your website (max length of 50 characters).DESCRIPTION: A brief description of your website (max length of 250 characters).KEYWORD1,KEYWORD2,KEYWORD3,KEYWORD4,KEYWORD5: Keywords that describe your website (max length of 50 characters each).
If wallet_path + wallet_password and secret_key are used in the config file, secret_key will take precedence.
If the SECRET_KEY environment variable is set, it will take precedence over the secret_key and wallet fields in the config file.
Setting Configurations Directly on the Command Lineβ
If you prefer, you can bypass the config file and specify values directly on the command line. A value given on the command line takes precedence over the config file:
| Command-line option | Config file field |
|---|---|
-n, --node_url | node_url |
-w, --wallet | wallet_path |
-p, --password | wallet_password |
-a, --address (after upload or show) | address |
-s, --chunkSize (after upload) | chunk_size |
Use -c, --config <path> to read another config file than deweb_cli_config.json in the current
directory. For example:
npx @massalabs/deweb-cli upload <website_path> --node_url <your_node_url> --wallet <path_to_wallet> --password <your_password>
You can also set the secret key as an environment variable:
export SECRET_KEY=<your_secret_key>
Additional Resourcesβ
For instructions on obtaining a YAML wallet file or secret key, refer to the Massa Wallet Documentation.
If you encounter issues, please visit our GitHub Issues page for troubleshooting or to report problems.