Skip to content

Commit

Permalink
Basic readme (#64)
Browse files Browse the repository at this point in the history
* Update binary name in Taskfile.yml to deweb-...

* Add first README

* Fix artifact upload in build workflow

* Update README with note about SSR not supported

* Apply suggestions from code review

Co-authored-by: ASAPSegfault <45430752+ASAPSegfault@users.noreply.github.com>

---------

Co-authored-by: ASAPSegfault <45430752+ASAPSegfault@users.noreply.github.com>
  • Loading branch information
thomas-senechal and ASAPSegfault authored Aug 6, 2024
1 parent 51284f6 commit 53a5faa
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
74 changes: 73 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,73 @@
# DeWeb
# 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 <wallet_nickname> <website_zip_file_path>
```

- `<wallet_nickname>`: The nickname of your Massa Wallet, downloadable from the Massa Station plugins store.
- `<website_zip_file_path>`: 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 <wallet_nickname> <website_sc_address> <website_zip_file_path>
```

- `<wallet_nickname>`: The nickname of your Massa Wallet.
- `<website_sc_address>`: The smart contract address of the website you want to edit (deployed using the `upload` command).
- `<website_zip_file_path>`: 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
```
6 changes: 3 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}'
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 53a5faa

Please sign in to comment.