Skip to content

Commit 99b2dfa

Browse files
committed
Added docs to build webnode
1 parent 33fc594 commit 99b2dfa

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ _Currently in **public beta**, join our [Discord community](https://discord.com/
2121
### Building from Source
2222

2323
- [Rust Node](/docs/building-from-source-guide.md#how-to-build-and-launch-a-node-from-source) and [Dashboards](./docs/building-from-source-guide.md#how-to-launch-the-ui)
24+
- [Web Node](/docs/local-webnode.md)
2425

2526
### Run Node on Devnet via Docker
2627

docs/local-webnode.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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

Comments
 (0)