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

docs(portal): update the portal deployment docs #228

Merged
Merged
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
52 changes: 36 additions & 16 deletions docs/walrus-sites/portal.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,39 @@ future.
The stable branch of Walrus Sites is `testnet`.
```

## Configuring the portal

There are two main locations where the portal needs to be configured: The `constants.ts` file and
the environment variables.

You can find the `constants.ts` file in the `portal/common/lib` directory. It holds key
configuration parameters for the portal. Typically, you won't need to modify these, but if you do,
here are the explanations for each parameter:

- `NETWORK`: The Sui network to be used for fetching the Walrus Sites objects. Currently, we
use Sui `testnet`.
- `AGGREGATOR`: The URL of the [aggregator](../usage/web-api.md) from which the portal will
fetch the Walrus blobs.
- `SITE_PACKAGE`: The Sui object ID of the Walrus Sites package.
- `MAX_REDIRECT_DEPTH`: The number of [redirects](./redirects.md) the portal will follow
before stopping.
- `SITE_NAMES`: Hard coded `name: objectID` mappings, to override the SuiNS names. For development
Tzal3x marked this conversation as resolved.
Show resolved Hide resolved
only. Use this at your own risk, may render some sites with legitimate SuiNS names unusable.

Next, the environment variables are set in the `.env.local`. To just run a simple instance of the
portal, you can just use the environment variables specified in the `.env.example` file.
Tzal3x marked this conversation as resolved.
Show resolved Hide resolved

```sh
cp ./portal/server/.env.example ./portal/server/.env.local
```

Likewise, if you want to run the service-worker portal, you can copy the `.env.example` file to
`.env.local` in the `portal/worker` directory.

```sh
cp ./portal/worker/.env.example ./portal/worker/.env.local
```

## Running the portal locally

You can run a portal locally if you want to browse Walrus Sites without accessing
Expand Down Expand Up @@ -59,21 +92,8 @@ pnpm serve:dev:server
pnpm serve:dev:worker
```

to serve one of the portals. Typically, you will find it served at `localhost:8080` (but check the
output of the serve command).
to serve one of the portals. Typically, you will find it served at `localhost:3000` (for the server
side portal) or `localhost:8080` for the service worker (but check the output of the serve
command).

For the production versions, use the `prod` commands: `serve:prod:server` and `serve:prod:worker`.

## Configuring the portal

The most important configuration parameters for the portal are in `portal/common/lib/constants.ts`:

- `NETWORK`: The Sui network to be used for fetching the Walrus Sites objects. Currently, we
use Sui `testnet`.
- `AGGREGATOR`: The URL of the [aggregator](../usage/web-api.md) from which the portal will
fetch the Walrus blobs.
- `SITE_PACKAGE`: The Sui object ID of the Walrus Sites package.
- `MAX_REDIRECT_DEPTH`: The number of [redirects](./redirects.md) the portal will follow
before stopping.
- `SITE_NAMES`: Hard coded `name: objectID` mappings, to override the SuiNS names. For development
only.
Loading