Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deweb cli metadatas #395

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions docs/deweb/cli/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,34 @@ Here’s a sample `deweb_cli_config.json` setup:
"wallet_path": "your-wallet.yaml",
"node_url": "https://mainnet.massa.net/api/v2",
"chunk_size": 64000
"metadata": {
"TITLE": "My Website",
"DESCRIPTION": "This is my website",
"KEYWORD1": "deweb",
"KEYWORD2": "massa",
}
}
```

Here’s a breakdown of each field:

- **`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.
- **`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`.
- **`metadata`**: An optional field that allows you to specify metadata for your website.
This metadata will be stored on the Massa blockchain and can be accessed by anyone.
:::tip About Metadata
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).
:::

:::info Note
:::info 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.
Expand Down
18 changes: 14 additions & 4 deletions docs/deweb/cli/upload.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,17 @@ Alternatively, specify configurations directly in the command line for a one-tim

`deweb-cli` will detect the `SECRET_KEY` variable automatically.

## Step 2: Run the Upload Command
## Step 2: Add Metadata

Add the following metadata to your config file to help index your website:

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

For more information on the metadata fields and CLI config file, refer to the [CLI Configuration](./config) page.

## Step 3: Run the Upload Command

With your configuration in place, run the `upload` command to deploy your website:

Expand All @@ -124,11 +134,11 @@ you can simply use the `--address` flag to specify the smart contract address of

This command will begin the upload process.

## Step 3: Confirm the Upload
## Step 4: Confirm the Upload

While the command is running, you will see estimated costs and be prompted to confirm the upload. Select `yes` to proceed.

## Step 4: Follow the Progress
## Step 5: Follow the Progress

The CLI will display the progress of the upload, including the number of chunks uploaded.

Expand All @@ -141,7 +151,7 @@ Website deployed at AS12v...2UgLS
This message confirms that your website has been successfully deployed on the Massa blockchain.
The output address (`AS12v...2UgLS` in this example) represents the address where your website is hosted.

## Step 5: Access Your Website
## Step 6: Access Your Website

To be able to access your website, you need to associate it with a Massa domain. Follow the instructions in [Assigning a MNS to your website](../upload/mns) to link your deployed website address to a custom Massa domain.

Expand Down
Loading