Skip to content

Commit

Permalink
Merge branch 'master' into severin/dfx-0.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sesi200 authored Feb 5, 2024
2 parents d695a84 + 3166fd3 commit dedcd53
Show file tree
Hide file tree
Showing 58 changed files with 884 additions and 1,087 deletions.
32 changes: 16 additions & 16 deletions hosting/godot-html5-template/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# Godot HTML5 Sample
# Godot HTML5 sample

## Overview
The example shows how to deploy a Godot HTML5 build on the IC in an asset canister. The Godot HTML5 build is deployed as frontend, no backend is needed in this sample.


## Installation
This example project can be cloned, installed and deployed locally, for learning and testing purposes. The instructions are based on running the example on either macOS or Linux, but when using WSL2 on Windows, the instructions will be the same.

### Prerequisites
The example project requires the following installed:
## Prerequisites

This example requires an installation of:

- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/).

- git
- dfx
- [x] Download and install [git](https://git-scm.com/downloads).

git can be installed from various package managers. DFX can be installed following the instructions [here](https://internetcomputer.org/docs/current/developer-docs/build/install-upgrade-remove).
## Install

### Download the code
Clone the example dapp project:

```bash
$ git clone https://github.com/dfinity/examples
$ cd examples/hosting/godot-html5-template
git clone https://github.com/dfinity/examples
cd examples/hosting/godot-html5-template
```

## Deployment
The local network is started by running this command:
The local replica is started by running this command:

```bash
$ dfx start --background
dfx start --background
```

When the local network is up and running, run this command to deploy the canisters:
When the local replica is up and running, run this command to deploy the canisters:

```bash
$ dfx deploy
dfx deploy
```

If you get error code 500 after deploying to the IC mainnet, try to use `raw` keyword in the URL like this: `https://\<canister-id\>.raw.ic0.app`.

## License
This project is licensed under the Apache 2.0 license, see LICENSE.md for details. See CONTRIBUTE.md for details about how to contribute to this project.
This project is licensed under the Apache 2.0 license, see `LICENSE.md` for details. See `CONTRIBUTE.md` for details about how to contribute to this project.
40 changes: 18 additions & 22 deletions hosting/photo-storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,31 @@
The example shows how to store photos on the IC in an asset canister with the `@dfinity/assets` package. The photo
storage app is deployed as a frontend in an asset canister which is also used for photo upload.

## Installation

This example project can be cloned, installed and deployed locally, for learning and testing purposes. The instructions
are based on running the example on either macOS or Linux, but when using WSL2 on Windows, the instructions will be the
same.

### Prerequisites
## Prerequisites

The example project requires the following installed:
This example requires an installation of:

- git
- dfx
- npm
- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/).

git and npm can be installed from various package managers. DFX can be installed following the
instructions [here](https://internetcomputer.org/docs/current/developer-docs/build/install-upgrade-remove).
- [x] Download and install [git](https://git-scm.com/downloads).

### Download the code
- [x] Download and install [Node.js](https://nodejs.org/en).
## Install

Clone the example dapp project:

```bash
$ git clone https://github.com/dfinity/examples
$ cd examples/hosting/photo-storage
git clone https://github.com/dfinity/examples
cd examples/hosting/photo-storage
```

## React build

The React frontend is build by running this command:
The React frontend is built by running:

```bash
npm install
Expand All @@ -40,34 +36,34 @@ npm run build

## Deployment

The local network is started by running this command:
The local replica is started by running:

```bash
$ dfx start --clean --background
dfx start --clean --background
```

When the local network is up and running, run this command to deploy the canisters:
When the local replica is up and running, run this command to deploy the canisters:

```bash
$ dfx deploy
dfx deploy
```

## Authorization

To authorize the identity from this example project on a local network to upload files, it must be authorized first:
To authorize an identity to upload files, it must be authorized first:

```bash
dfx canister call photo-storage authorize '(principal "535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe")'
```

Before deployment on the IC, the hardcoded identity (defined in `src/App.js`) should be replaced by an authentication
method e.g. Internet Identity.
Before deployment on ICP, the hardcoded identity (defined in `src/App.js`) should be replaced by an authentication
method such as Internet Identity.

## Cats
## Example photos

The example cat stock photos are from [Pexels](https://www.pexels.com/license/).

## License

This project is licensed under the Apache 2.0 license, see LICENSE.md for details. See CONTRIBUTE.md for details about
This project is licensed under the Apache 2.0 license, see `LICENSE.md` for details. See `CONTRIBUTE.md` for details about
how to contribute to this project.
30 changes: 14 additions & 16 deletions hosting/static-website/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Static website

## Overview
The example shows how to deploy a simple, static website on the IC in an asset canister. The website is very simple, it just shows the DFINITY logo and has a basic styling of the logo.

![Website](README_images/website.png)

## Introduction
The purpose of this example is to show how to deploy a static website in an asset canister. While the website in this example is very simple, the method would be the same for a more advanced static website, e.g. based on popular static site generators.

This example covers:
Expand All @@ -13,30 +14,27 @@ This example covers:
- Deploy the canister smart contract locally
- Test the frontend in browser

## Installation
This example project can be cloned, installed and deployed locally, for learning and testing purposes. The instructions are based on running the example on either macOS or Linux, but when using WSL2 on Windows, the instructions will be the same.
## Prerequisites

### Prerequisites
The example project requires the following installed:
This example requires an installation of:

- git
- dfx
- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/).

git can be installed from various package managers. DFX can be installed following the instructions [here](https://internetcomputer.org/docs/current/developer-docs/setup/deploy-locally).
- [x] Download and install [git](https://git-scm.com/downloads).

### Install
Install the example dapp project:

```bash
$ git clone https://github.com/dfinity/examples
$ cd examples/hosting/static-website
git clone https://github.com/dfinity/examples
cd examples/hosting/static-website
```

## Documentation
There are two parts in this dapp. One is the website and the other is `dfx.json`. Since there's no backend, there is not any benefit of using the `dfx new project_name` command to set up a template. The `dfx.json` file is all that is needed.

### Website
The website is really simple. It consists of an HTML file, a CSS file and a PNG file. The content of the HTML file looks like this:
The website is simple. It consists of an HTML file, a CSS file and a PNG file. The content of the HTML file looks like this:

```html
<!doctype html>
Expand Down Expand Up @@ -105,16 +103,16 @@ The `dfx.json` file is a configuration file which specifies the canister used fo
This is all needed for creating a canister smart contract for hosting a static website on the IC.

## Deployment
The local network is started by running this command:
The local replica is started by running:

```bash
$ dfx start --background
dfx start --background
```

When the local network is up and running, run this command to deploy the canisters:
When the local replica is up and running, run this command to deploy the canisters:

```bash
$ dfx deploy
dfx deploy
```


Expand All @@ -126,4 +124,4 @@ The URL for the frontend depends on the canister ID. Local canister IDs can be
![Candid UI](README_images/website.png)

## License
This project is licensed under the Apache 2.0 license, see LICENSE.md for details. See CONTRIBUTE.md for details about how to contribute to this project.
This project is licensed under the Apache 2.0 license, see `LICENSE.md` for details. See `CONTRIBUTE.md` for details about how to contribute to this project.
30 changes: 13 additions & 17 deletions hosting/unity-webgl-template/README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,39 @@
# Unity WebGL Sample
# Unity WebGL sample

The example shows how to deploy a simple Unity WebGL build on the IC in an asset canister. It just shows a Unity WebGL build with the URP template installed.

The Unity WebGL build is deployed as frontend, no backend is needed in this sample.

## Prerequisites

## Installation
This example project can be cloned, installed and deployed locally, for learning and testing purposes. The instructions are based on running the example on either macOS or Linux, but when using WSL2 on Windows, the instructions will be the same.
This example requires an installation of:

### Prerequisites
The example project requires the following installed:
- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/).

- git
- dfx
- [x] Download and install [git](https://git-scm.com/downloads).

git can be installed from various package managers. DFX can be installed following the instructions [here](https://internetcomputer.org/docs/current/developer-docs/setup/deploy-locally).

### Install
## Install
Install the example dapp project:

```bash
$ git clone https://github.com/dfinity/examples
$ cd examples/hosting/unity-webgl-template
git clone https://github.com/dfinity/examples
cd examples/hosting/unity-webgl-template
```

## Deployment
The local network is started by running this command:
The local replica is started by running this command:

```bash
$ dfx start --background
dfx start --background
```

When the local network is up and running, run this command to deploy the canisters:
When the local replica is up and running, run this command to deploy the canisters:

```bash
$ dfx deploy
dfx deploy
```

If you get error code 500 after deploying to the IC mainnet, try to use `raw` keyword in the URL like this: `https://\<canister-id\>.raw.ic0.app`.

## License
This project is licensed under the Apache 2.0 license, see LICENSE.md for details. See CONTRIBUTE.md for details about how to contribute to this project.
This project is licensed under the Apache 2.0 license, see `LICENSE.md` for details. See `CONTRIBUTE.md` for details about how to contribute to this project.
19 changes: 7 additions & 12 deletions motoko/actor_reference/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Actor references

![Compatibility](https://img.shields.io/badge/compatibility-0.7.0-blue)
[![Build Status](https://github.com/dfinity/examples/workflows/motoko-actor_reference-example/badge.svg)](https://github.com/dfinity/examples/actions?query=workflow%3Amotoko-actor_reference-example)

# Actor reference

## Overview
Expand Down Expand Up @@ -33,28 +28,28 @@ This example requires an installation of:

Begin by opening a terminal window.

### Step 1: Navigate into the folder containing the project's files and start a local instance of the Internet Computer with the command:
### Step 1: Navigate into the folder containing the project's files and start a local instance of the replica with the command:

```
```bash
cd examples/motoko/actor-reference
dfx start --background
```

### Step 2: Deploy the canister:

```
```bash
dfx deploy
```

### Step 3: Invoke the `burn` method of canister `actor_reference`:

```
```bash
dfx canister call actor_reference burn '()'
```

The output will resemble the following:

```
```bash
[Canister by6od-j4aaa-aaaaa-qaadq-cai] balance before: 3091661916488
[Canister by6od-j4aaa-aaaaa-qaadq-cai] cycles: 1538138650552
[Canister by6od-j4aaa-aaaaa-qaadq-cai] balance after: 1545830657728
Expand All @@ -65,6 +60,6 @@ The output will resemble the following:
- [Actors and sync data](https://internetcomputer.org/docs/current/motoko/main/actors-async).
- [Basic Motoko concepts and terms](https://internetcomputer.org/docs/current/motoko/main/basic-concepts).

# Security Considerations and Security Best Practices
# Security considerations best practices

If you base your application on this example, we recommend you familiarize yourself with and adhere to the [Security Best Practices](https://internetcomputer.org/docs/current/references/security/) for developing on the Internet Computer. This example may not implement all the best practices.
If you base your application on this example, we recommend you familiarize yourself with and adhere to the [Security Best Practices](https://internetcomputer.org/docs/current/references/security/) for developing on ICP. This example may not implement all the best practices.
8 changes: 4 additions & 4 deletions motoko/auth_client_demo/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Auth-Client Demo
# Auth-client

This is an example project, intended to demonstrate how an app developer might integrate with an [Internet Identity](https://identity.ic0.app).

Expand All @@ -23,7 +23,7 @@ Once deployed, start the development server with `npm start`.

You can now access the app at `http://127.0.0.1:5173/`.

## Multiple Versions
## Multiple versions

This demo has multiple versions, each of which demonstrates a different feature of the auth-client. `npm start` will run the vanilla JS version, but you can run the others by running `npm run start:version` where `version` is one of the following:

Expand All @@ -36,7 +36,7 @@ This demo has multiple versions, each of which demonstrates a different feature

To pull Internet Identity into your own project, you'll need to do the following:

1. Add Internet Identity to your `dfx.json` file:
- #### Step 1: Add Internet Identity to your `dfx.json` file:

```json
"internet-identity" : {
Expand All @@ -45,7 +45,7 @@ To pull Internet Identity into your own project, you'll need to do the following
}
```

2. Run the following commands to install the dependencies:
- #### Step 2: Run the following commands to install the dependencies:

```bash
dfx deps pull
Expand Down
Loading

0 comments on commit dedcd53

Please sign in to comment.