|
| 1 | +# How to build and launch webnode from source |
| 2 | + |
| 3 | +## Steps |
| 4 | + |
| 5 | +Install the rust and node: |
| 6 | +```sh |
| 7 | +# Install rustup and set the default Rust toolchain to 1.84 (newer versions work too) |
| 8 | +curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.84 |
| 9 | +# Setup the current shell with rustup |
| 10 | +source "$HOME/.cargo/env" |
| 11 | + |
| 12 | +# Download and install nvm: |
| 13 | +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash |
| 14 | +# in lieu of restarting the shell |
| 15 | +\. "$HOME/.nvm/nvm.sh" |
| 16 | +# Download and install Node.js: |
| 17 | +nvm install 21 |
| 18 | +``` |
| 19 | + |
| 20 | +Clone the repo |
| 21 | +```sh |
| 22 | +git clone https://github.com/openmina/openmina.git |
| 23 | +cd openmina/ |
| 24 | +``` |
| 25 | + |
| 26 | +Build the web node, `wasm-pack` command should take a bit, around 10min |
| 27 | +```sh |
| 28 | +cargo install wasm-pack |
| 29 | +cd node/web |
| 30 | +rustup toolchain install nightly |
| 31 | +rustup override set nightly |
| 32 | +wasm-pack build --target web --out-dir pkg |
| 33 | +cp -rf pkg ../../frontend/src/assets/webnode |
| 34 | +``` |
| 35 | + |
| 36 | +Download `circuit-blobs`, from the root of project run: |
| 37 | +```sh |
| 38 | +cd frontend/src/assets/webnode |
| 39 | +git clone --depth 1 https://github.com/openmina/circuit-blobs.git |
| 40 | +``` |
| 41 | + |
| 42 | +And create `web-node-secrets.json` in `frontend/src/assets/webnode` it should be in following format: |
| 43 | +```json |
| 44 | +{ |
| 45 | + "publicKey": "B62qk1UDzvtw82kiSznZEtSdFUg9oW8di5p53cVr2FxDBzjv9bW2Wf6", |
| 46 | + "privateKey": "EKLf3tJd7aKegmhr5qyghagM25LQ98Cu413f1a5e18ubUMgGZY8x" |
| 47 | +} |
| 48 | +``` |
| 49 | + |
| 50 | +These keys can be generated by running: |
| 51 | +```sh |
| 52 | +cargo run -r --bin openmina -- misc mina-key-pair |
| 53 | +``` |
| 54 | + |
| 55 | +Install frontend dependencies and run the webnode: |
| 56 | +```sh |
| 57 | +cd frontend |
| 58 | +npm run start:webnode |
| 59 | +``` |
0 commit comments