Skip to content

Commit

Permalink
Updating LinkedUp to work with 0.6.2 (#39)
Browse files Browse the repository at this point in the history
* feature: update to v0.6.1

* Updating LinkedUp to work with 0.6.2

* Update dfx.json

Co-authored-by: Eric Swanson <64809312+ericswanson-dfinity@users.noreply.github.com>

* Put webpack output in dist directory. (#40)

Copy assets from dist directory.
Update readme with new dfx command steps.

* docs: Refresh content for the LinkedUp readme (#37)

* Refresh content for the LinkedUp readme

* Fix typo in URL

* Remove ADOC notation

* Change dfx.json

* fix travis.yml file

* fix bootstrap.sh file

* change path in bootstrap.sh file

* Update .travis.yml

Co-authored-by: Eric Swanson <64809312+ericswanson-dfinity@users.noreply.github.com>

* fix canister id

* delete old encoding line

* remove uneeded id line

* remove ID line

* delete unused crc8 python script

Co-authored-by: Eric Swanson <64809312+ericswanson-dfinity@users.noreply.github.com>
Co-authored-by: Prithvi Shahi <50885601+p-shahi@users.noreply.github.com>
Co-authored-by: Prithvi Shahi <prithvi@dfinity.org>

* update package lock

* package lock

* remoe unused properties

Co-authored-by: Andrew Wylde <andrew.wylde@dfinity.org>
Co-authored-by: Eric Swanson <64809312+ericswanson-dfinity@users.noreply.github.com>
Co-authored-by: Lisa Gunn <44206363+lsgunnlsgunn@users.noreply.github.com>
Co-authored-by: Prithvi Shahi <50885601+p-shahi@users.noreply.github.com>
Co-authored-by: Prithvi Shahi <prithvi@dfinity.org>
  • Loading branch information
6 people authored Aug 11, 2020
1 parent 6ac43e6 commit 84b1b57
Show file tree
Hide file tree
Showing 14 changed files with 259 additions and 243 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ build/
canisters/
crc8.pyc
node_modules/
dist/
nohup.out
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ install:
- export PATH=/home/$USER/bin:$PATH
script:
- sh bootstrap.sh
- ID=$(xxd -p canisters/linkedup/_canister.id)
- CRC=$(python2 -c "import crc8;h=crc8.crc8();h.update('$ID'.decode('hex'));print(h.hexdigest())")
- wget -O index.html http://127.0.0.1:8000/?canisterId=ic:$ID$CRC
- wget -O index.html http://127.0.0.1:8000/?canisterId=$(dfx canister id linkedup_assets)
- cat index.html
80 changes: 61 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,71 @@
## An open professional network.
# LinkedUp - An open professional network.

[![Build Status](https://travis-ci.org/dfinity-lab/linkedup.svg?branch=master)](https://travis-ci.org/dfinity-lab/linkedup?branch=master)

[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/dfinity-lab/linkedup)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/dfinity-lab/linkedup)

### Demo
The LinkedUp sample application provides a simple implementation of an open professional network that demonstrates how to use **inter-canister calls** within a project.

Install the required Node modules (only needed the first time).
In the LinkedUp sample application, there are two canisters:

```bash
npm install
```
* The `linkedup` canister creates and stores basic profile information for a user, including work experience and educational background.
* The `connectd` canister creates and stores a user's connections.

Start the replica, then build and install the canisters.
## Before you begin

```bash
dfx start --background
dfx build
dfx canister install --all
```
Before building the sample application, verify the following:

Open the canister frontend in your web browser.
* You have downloaded and installed the DFINITY Canister SDK as described in [Download and install](https://sdk.dfinity.org/docs/quickstart/quickstart.html#download-and-install).
* You have stopped any Internet Computer network processes running on the local computer.

```bash
ID=$(xxd -u -p canisters/linkedup/_canister.id)
CRC=$(python2 -c "import crc8;h=crc8.crc8();h.update('$ID'.decode('hex'));print(h.hexdigest().upper())")
xdg-open "http://127.0.0.1:8000/?canisterId=ic:$ID$CRC"
```
## Demo

1. Clone the `linkedup` repository.

2. Change to the local `linkedup` working directory.

```bash
cd linkedup
```

3. Install the required node modules (only needed the first time).

```bash
npm install
```

4. Open the `dfx.json` file in a text editor and verify the `dfx` setting has same the version number as the `dfx` executable you have installed.

5. Start the replica.

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

6. Register unique canister identifiers for the `linkedup` project by running the following command:

```bash
dfx canister create --all
```

7. Build the application by running the following command:

```bash
dfx build
```

8. Deploy the application on the local network by running the following command:

```bash
dfx canister install --all
```

9. Copy the canister identifier for the `linkedup_assets` canister (you can use `dfx canister id linkedup_assets`).

10. Open the `linkedup_assets` canister frontend in your web browser.

For example, if using the default localhost address and port number, the URL looks similar to this:

```bash
http://localhost:8000/?canisterId=7kncf-oidaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q
```
1 change: 1 addition & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
npm install
nohup dfx start &
sleep 5
dfx canister create --all
dfx build
dfx canister install --all
151 changes: 0 additions & 151 deletions crc8.py

This file was deleted.

31 changes: 22 additions & 9 deletions dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,34 @@
"main": "src/connectd/main.mo"
},
"linkedup": {
"main": "src/linkedup/main.mo",
"main": "src/linkedup/main.mo"
},
"linkedup_assets": {
"dependencies": ["linkedup"],
"frontend": {
"entrypoint": "src/linkedup/public/main.js",
"assets": ["src/linkedup/public/*.html", "src/linkedup/public/*.css"]
}
"entrypoint": "src/linkedup/public/main.js"
},
"type": "assets",
"source": [
"src/linkedup/public",
"dist/linkedup_assets"
]
}
},
"defaults": {
"build": {
"output": "canisters"
"packtool": ""
}
},
"networks": {
"tungsten": {
"providers": ["https://gw.dfinity.network"],
"type": "persistent"
},
"start": {
"address": "127.0.0.1",
"port": 8000
"local": {
"bind": "0.0.0.0:8000",
"type": "ephemeral"
}
},
"dfx": "0.5.7"
"dfx": "0.6.2"
}
Loading

0 comments on commit 84b1b57

Please sign in to comment.