Skip to content

Commit

Permalink
Merge pull request #2299 from dfinity/enhance-frontend-canister-doc
Browse files Browse the repository at this point in the history
Add instructions for manually deploying frontend canister from Wasm
  • Loading branch information
jessiemongeon1 authored Dec 20, 2023
2 parents 435740a + 025b3da commit 781aacd
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions docs/developer-docs/frontend/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ sidebar_position: 1

## Overview

The Internet Computer allows you to host frontends built with standard web technologies for your dapps, using
our [JavaScript agent](https://www.npmjs.com/package/@dfinity/agent) as a communication layer. By using
the [asset canister](https://github.com/dfinity/sdk/tree/master/src/canisters/frontend/ic-frontend-canister) provided by `dfx` to upload static files to ICP,
A frontend canister, also referred to as an *asset canister**, is a type of canister used to host an application's frontend assets, such as the user interface, webpage, or dashboard for the dapp.

Frontend canisters utilize the [JavaScript agent](https://www.npmjs.com/package/@dfinity/agent) as a communication layer. By using
the [default frontend canister](https://github.com/dfinity/sdk/tree/master/src/canisters/frontend/ic-frontend-canister) provided by `dfx` to upload static files to ICP,
you will be able to run your entire application on decentralized technology. This section takes a closer look at the
default frontend template that is generated by running the `dfx new` command, configuring the frontend canister, and using other frameworks to
build the user interface for your projects.
Expand Down Expand Up @@ -264,3 +265,29 @@ with your bundler, the following steps should get you going:
- Alternately hardcode the canister ID if that is your preferred workflow

- #### Step 5: Commit the declarations and import them in your codebase.

## Deploying a frontend canister without building frontend dependencies

If you'd like to deploy a frontend asset canister without building the node or npm dependency packages, you can manually download the Wasm module dfx uses for its default frontend canister and install the canister manually.

- #### Step 1: Download the frontend asset canister's Wasm module.

```
wget https://github.com/dfinity/sdk/raw/0.15.2/src/distributed/assetstorage.wasm.gzand
```

- #### Step 2: Install the canister.

```
dfx canister install <id instead of name> --wasm assetstorage.wasm.gz
```

Using the canister ID, the canister will not sync automatically. If you want the canister to sync according to the configuration in `dfx.json`, then use the canister name instead of the canister ID:

```
dfx canister install frontend_canister --wasm assetstorage.wasm.gz
```

To sync assets to the canister manually, you can use `icx-asset sync`, but this package must be installed with Rust, `cargo install icx-asset`.


0 comments on commit 781aacd

Please sign in to comment.