/ask-hide

Primary LanguageTypeScriptMIT LicenseMIT

ASK HiDE

This program developped based by haruxx

Thanks to Kristofer Lund, kristofer@fmckl.se. Really helpful to understand ICP and Ethereum connections with React/NEXT envirement. His code is this https://github.com/kristoferlund/ic-wall

Purpose

This program handling Question and Answer among community member. current version designed for HiDE(hide.ac). but you can use it more commonly.

Run locally

1. Prerequisites

Make sure you have the following installed:

node
npm
git

2. Install DFINITY Canister SDK

Download and install the DFINITY Canister SDK package by running the following command:

DFX_VERSION=0.7.1 sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"

3. Install Rust / Cargo

The app backend is written in Rust. The commands below install Rust, the package manager Cargo, etc.

curl https://sh.rustup.rs -sSf | sh
rustup update
rustup target add wasm32-unknown-unknown
sudo apt-get -y install cmake
cargo install ic-cdk-optimizer --root target
export PATH="./target/bin:$PATH"

4. Clone this repo, install dependencies

git clone https://github.com/kristoferlund/ic-wall.git
npm install

5. Run!

Terminal 1

Start Internet Computer

dfx start

Terminal 2

Alt 1. Development mode with hot reload

  • Deploy backend canisters
  • Run next.js frontend in dev mode
dfx deploy wall
npm run dev

Access on http://localhost:3000

Alt 2. Production mode

  • Export static production version of next.js frontend
  • Deploy all canisters
dfx deploy wall
npm run export
dfx deploy ui

Access on http://localhost:8000

In case you receive "Could not find Canister ID from Request":

  • Get UI canister ID
dfx canister id ui

Access on http://localhost:8000/?canisterId={id received in previous step}

License

MIT