diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b13d26d..eeca5f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,8 +63,8 @@ jobs: - name: Upload CLI artifact uses: actions/upload-artifact@v4 with: - name: cli-${{ matrix.target }}-${{ matrix.arch }}-${{ env.VERSION }} - path: build/cli${{ matrix.ext }} + name: cli-${{ matrix.target }}-${{ matrix.arch }} + path: build/deweb-cli${{ matrix.ext }} - name: Build Server shell: bash @@ -76,5 +76,5 @@ jobs: - name: Upload Server artifact uses: actions/upload-artifact@v4 with: - name: server-${{ matrix.target }}-${{ matrix.arch }}-${{ env.VERSION }} - path: build/server${{ matrix.ext }} + name: server-${{ matrix.target }}-${{ matrix.arch }} + path: build/deweb-server${{ matrix.ext }} diff --git a/README.md b/README.md index f703510..0fffbf4 100644 --- a/README.md +++ b/README.md @@ -1 +1,73 @@ -# DeWeb \ No newline at end of file +# DeWeb: On-chain Decentralized Web Gateway + +DeWeb is your gateway to the decentralized web, enabling seamless access to websites stored on-chain from any device, anywhere in the world. + +## Description + +DeWeb revolutionizes web accessibility by providing tools to upload, edit, and view websites directly on the blockchain. The project includes two binaries: +- `deweb-cli`: A command-line tool for deploying and managing on-chain websites. +- `deweb-server`: A server application that allows users to access websites stored on-chain through a web browser. + +## Getting Started + +### Prerequisites + +Ensure you have `task` installed. Follow the instructions [here](https://taskfile.dev/installation/). + +### Installation + +1. Install required tools: + ```bash + task install + ``` + +2. Build both binaries: + ```bash + task build + ``` + + Alternatively, you can build them separately: + ```bash + task build:cli + task build:server + ``` + +3. The binaries will be stored in the `./build` directory. + +## CLI Usage + +The `DeWeb CLI` allows you to upload and edit websites directly from the terminal. + +### Upload a Website + +To upload a website to the blockchain: +```bash +deweb-cli upload +``` + +- ``: The nickname of your Massa Wallet, downloadable from the Massa Station plugins store. +- ``: Relative or absolute path to the zip file containing your website. + +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: +```bash +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 a Website + +To edit an existing website on the blockchain: +```bash +deweb-cli edit +``` + +- ``: The nickname of your Massa Wallet. +- ``: The smart contract address of the website you want to edit (deployed using the `upload` command). +- ``: Relative or absolute path to the zip file containing your updated website. + +For more information on other available commands, use the CLI help: +```bash +deweb-cli --help +``` diff --git a/Taskfile.yml b/Taskfile.yml index 1b2b753..cec6e6e 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -25,7 +25,7 @@ tasks: silent: true - cmd: 'echo Version: {{.VERSION | default "Development"}}' silent: true - - cmd: go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}{{.BIN_EXT}} ./cmd/{{.APP_NAME}} + - cmd: go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/deweb-{{.APP_NAME}}{{.BIN_EXT}} ./cmd/{{.APP_NAME}} vars: # We need this check for nil and empty string because a simple check for empty string doesn't work as expected VERSION_FLAG: '{{if ne .VERSION nil}}{{if ne .VERSION ""}}-X github.com/massalabs/DeWeb/int/config.Version=v{{.VERSION}}{{end}}{{end}}' @@ -53,11 +53,11 @@ tasks: run:cli: cmds: - - cmd: ./build/cli + - cmd: ./build/deweb-cli run:server: cmds: - - cmd: ./build/server + - cmd: ./build/deweb-server clean: cmds: