-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update CLI docs * Fix misnamed category and improve providers display in sidebar * Add CLI Configuration documentation * Add CLI upload tutorial * Add DeWeb CLI overview * Add replace DeWeb upload/cli with upload/overview to redirect to the new CLI tutorial * Update DeWeb sidebar * Fix broken links * update homepage providers --------- Co-authored-by: thomas-senechal <[email protected]>
- Loading branch information
1 parent
e085c14
commit 488f3d3
Showing
8 changed files
with
221 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
title: CLI Configuration | ||
--- | ||
|
||
# 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: | ||
|
||
```json | ||
{ | ||
"wallet_password": "your-wallet-password", | ||
"wallet_path": "your-wallet.yaml", | ||
"node_url": "https://mainnet.massa.net/api/v2", | ||
"chunk_size": 64000 | ||
} | ||
``` | ||
|
||
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. | ||
- **`secret_key`**: The secret key for your Massa account. Use this as an alternative to `wallet_password` and `wallet_path`. | ||
|
||
:::info Note | ||
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: | ||
|
||
```bash | ||
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: | ||
|
||
```bash | ||
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](https://docs.massa.net/docs/massaStation/massa-wallet/account-backup). | ||
|
||
:::info | ||
If you encounter issues, please visit our [GitHub Issues page](https://github.com/massalabs/DeWeb/issues) for troubleshooting or to report problems. | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: DeWeb CLI Overview | ||
--- | ||
|
||
# DeWeb CLI Overview | ||
|
||
DeWeb CLI is a command-line tool designed for developers to manage website deployments on the Massa blockchain. | ||
It provides commands for uploading, managing, and debugging website files directly on the blockchain, simplifying the deployment process. | ||
|
||
## Requirements | ||
|
||
Before running the CLI, ensure you have: | ||
|
||
- **Node.js** (version 18.0 or higher) and **npm** installed. You can check your versions with: | ||
```bash | ||
node -v | ||
npm -v | ||
``` | ||
|
||
- **A Massa Wallet**: Either as a YAML wallet file or its secret key. | ||
Refer to the [Massa Wallet Documentation](/docs/massaStation/massa-wallet/account-backup) for instructions on creating or obtaining these. | ||
|
||
## Capabilities | ||
|
||
DeWeb CLI offers a range of capabilities for working with website stored on the Massa blockchain: | ||
|
||
- **Upload**: Uploads and edits your website to the blockchain. | ||
- **Delete**: Removes your website and its associated files from the blockchain. | ||
- **List Files**: Lists all files associated with a specific website, useful for verifying deployed content. | ||
- **View File Content**: Allows you to view the content of a specific file, | ||
providing a way to debug or inspect individual files directly on the blockchain. | ||
|
||
To explore these commands further, you can use the `--help` option: | ||
|
||
```bash | ||
npx @massalabs/deweb-cli --help | ||
``` | ||
|
||
## Quick Start | ||
|
||
Run DeWeb CLI with `npx` for instant access: | ||
|
||
```bash | ||
npx @massalabs/deweb-cli --help | ||
``` | ||
|
||
This command will display available options and commands, allowing you to dive into using the DeWeb CLI right away. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
title: Uploading a Website | ||
--- | ||
|
||
# Uploading a Website | ||
|
||
Follow these steps to upload a website to the Massa blockchain using the DeWeb CLI. | ||
You can configure settings using either a config file or command-line options. | ||
|
||
## Prerequisites | ||
|
||
Before you start, make sure you have the following: | ||
|
||
1. **Massa Wallet**: A wallet file in YAML format or a secret key. | ||
Refer to [Massa wallet documentation](/docs/massaStation/massa-wallet/account-backup) for guidance on obtaining these. | ||
2. **Node URL**: The URL for the Massa node you plan to use. | ||
3. **Website Files**: Build your website files in a directory on your local machine. | ||
|
||
## Step 1: Configure Access | ||
|
||
You have two ways to configure access for `deweb-cli`: by using a configuration file or by providing options directly on the command line. | ||
|
||
### Option A: Using a Config File | ||
|
||
For persistent settings, create a config file as described in the [CLI Configuration](./config) page. This file can store values for `node_url`, `wallet_path`, `wallet_password`, `chunk_size`, or `secret_key`. | ||
|
||
### Option B: Using Command-Line Options | ||
|
||
Alternatively, specify configurations directly in the command line for a one-time setup. | ||
|
||
- Use the following command to upload a website with command-line options: | ||
|
||
```bash | ||
npx @massalabs/deweb-cli upload <website_path> --node_url <your_node_url> --wallet <path_to_wallet> --password <your_password> | ||
``` | ||
|
||
- **Using a Secret Key**: If you prefer to use a secret key instead of a wallet file, set it as an environment variable: | ||
|
||
```bash | ||
export SECRET_KEY=<your_secret_key> | ||
``` | ||
|
||
`deweb-cli` will detect the `SECRET_KEY` variable automatically. | ||
|
||
## Step 2: Run the Upload Command | ||
|
||
With your configuration in place, run the `upload` command to deploy your website: | ||
|
||
```bash | ||
npx @massalabs/deweb-cli upload /path/to/website-build-directory | ||
``` | ||
|
||
:::note | ||
If you need to edit an existing website, | ||
you can simply use the `--address` flag to specify the smart contract address of the website you want to edit. | ||
::: | ||
|
||
This command will begin the upload process. | ||
|
||
## Step 3: 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 | ||
|
||
The CLI will display the progress of the upload, including the number of chunks uploaded. | ||
|
||
Once your website has been successfully uploaded, you will see a success message with the address where your website is hosted: | ||
|
||
```bash | ||
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 | ||
|
||
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. | ||
|
||
:::info | ||
If you encounter any issues or have suggestions, please let us know through our [issue tracker](https://github.com/massalabs/DeWeb/issues). | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
title: Overview | ||
--- | ||
|
||
# Overview | ||
|
||
To deploy a website on the Massa blockchain, you can use the DeWeb CLI by following the [Uploading a Website](../cli/upload) guide. | ||
This guide provides an overview of the process and the steps to upload your website. | ||
|
||
We are working on additional user-friendly tools to make website deployment accessible to all users, regardless of technical experience. | ||
These upcoming solutions will simplify the upload process, providing an intuitive interface for deploying websites on the Massa blockchain. | ||
|
||
Stay tuned for more updates! |
Oops, something went wrong.