Skip to main content

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 typically 64000, but it can be adjusted based on your needs and network conditions.

  • wallet_password: The password for your Massa wallet file, used when wallet_path is 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 to wallet_password and wallet_path.

  • 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 Metadatas

    The 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).
Note on Wallet Credentials

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. 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.

info

If you encounter issues, please visit our GitHub Issues page for troubleshooting or to report problems.