Skip to main content

How to build and launch webnode from source

Steps

Install the rust and node:

# Install rustup and set the default Rust toolchain to 1.84 (newer versions work too)
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.84
# Setup the current shell with rustup
source "$HOME/.cargo/env"

# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"
# Download and install Node.js:
nvm install 21

Clone the repo

git clone https://github.com/openmina/openmina.git
cd openmina/

Build the web node, wasm-pack command should take a bit, around 10min

cargo install wasm-pack
cd node/web
rustup toolchain install nightly
rustup override set nightly
wasm-pack build --target web --out-dir pkg
cp -rf pkg ../../frontend/src/assets/webnode

Download circuit-blobs, from the root of project run:

cd frontend/src/assets/webnode
git clone --depth 1 https://github.com/openmina/circuit-blobs.git

And create web-node-secrets.json in frontend/src/assets/webnode it should be in following format:

{
"publicKey": "B62qk1UDzvtw82kiSznZEtSdFUg9oW8di5p53cVr2FxDBzjv9bW2Wf6",
"privateKey": "EKLf3tJd7aKegmhr5qyghagM25LQ98Cu413f1a5e18ubUMgGZY8x"
}

These keys can be generated by running:

cargo run -r --bin openmina -- misc mina-key-pair

Install frontend dependencies and run the webnode:

cd frontend
npm run start:webnode