This document explains how to run Juno locally.
Before you begin developing and contributing to Juno, ensure the following tools are installed on your machine:
- Node.js (Website)
- Rust and Cargo (Installation)
- Docker (Windows, MacOS, or Linux)
- Clone the repository and install dependencies:
git clone https://github.com/junobuild/juno
cd juno
npm run bootstrap:ci- Start the emulator: This command runs a local emulator that replicates the behavior of the Internet Computer blockchain, deploying necessary smart contracts using a custom Docker image (repo) developed specifically for Juno.
npm run emulator- Launch the front-end administration console: Open another terminal window and start the console, which is configured to interact with the emulator.
npm run devTip
Both the emulator and the front-end server support live reloading, facilitating a smoother development experience.
Note
In addition to Cargo, a few additional tools are required to build the modules. See Required Tools for details.
You can manually build the smart contracts using standard Rust and Cargo commands targeting wasm32-unknown-unknown. For example:
cargo build --target wasm32-unknown-unknown -p console --releaseHowever, these commands do not instruct the emulator to redeploy the resulting builds. Therefore, to automate both build and deployment, we provide the following npm commands:
npm run build:console
npm run build:observatory
npm run build:satellite
npm run build:mission-control
npm run build:orbiterThe following additional tools are required when building the modules:
Note
The script ./docker/bootstrap takes care of installing Rustup, the toolchain, and the following tools.
candid-extractor is needed to extract Candid interfaces. Install it with:
cargo install candid-extractorwasi2ic is required to convert the Wasm of the Sputnik crate for compatibility with the Internet Computer. This is necessary because this module must be built with the wasm32-wasip1 target.
cargo install wasi2icWhen developing features for Juno — especially for the Console — you may need to generate data, such as creating users or adding entries in a Satellite's datastore or storage.
You can achieve this by running a sample app locally, connecting it to a Satellite, and signing in as a user would normally do.
To do so, follow these steps:
- Create or use a sample app:
npm create juno@latestOr clone the examples repo and use frontend/vanilla/vite-typescript.
- Configure the app to use a dev Satellite:
Open the juno.config file at the project root.
Replace <DEV_SATELLITE_ID> with the Satellite ID created in the Console.
- Run the app locally:
npm run dev- Interact as a normal user:
Users, datastore, and storage will be automatically created. Inspect/manage through the Console.