Skip to content

Conversation

@iostat
Copy link
Contributor

@iostat iostat commented Dec 8, 2025

Description

Makes the webnode launch/run again. This PR ended up being unusually "complex" due to multiple factors coinciding while reviving the webnode.

  • I had to upgrade wasm-bindgen to support the latest nightly version.
  • After getting wasm loading, I had to work around a CORS issue when fetching seed nodes (now resolved). In the process though, I added some functionality to inject config at launch of docker frontend.
  • When documenting and setting up the node for myself, I've added a (hopefully) temporary flag to mina misc mina-key-pair to simplify testing and deployment. It's still unclear why the webnode needs keys at web-node-secrets.json when the first thing we do when interacting with it is supply a set of keys. Once that requirement is removed, we can remove the corresponding documentation and flag.

There is some future work that will need to be planned to make the webnode truly functional/usable, but this is a good place to start given it's been neglected for a while. Note that there aren't any functional peers at the moment, so you'll likely be unable to get past 99% when launching. However, the logs in console do show that the Rust code is running and attempting to act like a real node!.

Related Issue(s)

Parent issue: #1474
Closes: #1839
Closes: #1840

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Build-related changes (deps updated)
  • This change requires a documentation update

Testing

You can test this by following a slightly modified version of the instructions added to the website section in website/docs/node-operators/webnode/local-webnode-docker.md. These modifications are necessary since there is currently no published Docker image containing this PR.

  1. Clone a clean copy of this repo/branch. This avoids any untracked/ignored files you have locally interfering with the build.
git clone [email protected]:o1-labs/mina-rust -b io/fix-docker-webnode my-clean-mina-rust
cd my-clean-mina-rust/
  1. Build the frontend docker image locally. Take note of the generated image name as it
    may change if commits are added to the PR
make download-circuits
make docker-build-frontend
# take note of a line somewhere near the end of output:
# => => naming to docker.io/o1labs/mina-rust-frontend:b9e1bd61
  1. Instead of running Step 1 in docs using docker, invoke mina misc mina-key-pair using cargo directly. (this is just faster than building the non-frontend image)
cargo run -r --bin mina -- misc mina-key-pair --web-node-secrets > $HOME/web-node-key-pair.json
  1. Substitute the tag in Step 2 of docs with the image you built in step 2 of this test procedure. e.g., in the example above use o1labs/mina-rust-frontend:b9e1bd61 instead of o1labs/mina-rust-frontend:latest
  2. After supplying a BP key you can open the devtools console and see a bunch of logging. Note that the node is not currently expected to progress past 99% as you will likely be unable to connect to any peers running WebRTC.
image
  1. If you get lucky though, the Continue button should turn white and you should see the dashboard
image

Changelog Entry

Added

  • Web Node: fix webnode build, add quality-of-life improvements when running
    webnode in Docker. (#1778)
  • Website: Document running the webnode in Docker (#1778)

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

OCaml Reference Validation Results

Repository: https://github.com/MinaProtocol/mina.git
Branch: compatible
Status: ❌ Validation failed

Click to see full validation output
Checking OCaml references against https://github.com/MinaProtocol/mina.git (branch: compatible)
Fetching current commit from compatible...
Current OCaml commit: af319d69b044c043ace8b2cf3c8a73cd1b20c496

Validating references...
========================
✓ VALID: ledger/src/account/account.rs -> src/lib/mina_base/account.ml L:201-224
  ⚠ STALE COMMIT: fc6be4c58091c761f827c858229c2edf9519e941 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)
❌ INVALID: ledger/src/scan_state/transaction_logic/for_tests.rs
   Code at L:2285-2285 differs between commit 5da42ccd72e791f164d4d200cf1ce300262873b3 and current branch
   Referenced: https://github.com/MinaProtocol/mina/blob/5da42ccd72e791f164d4d200cf1ce300262873b3/src/lib/transaction_logic/mina_transaction_logic.ml#L2285-L2285
   Current:    https://github.com/MinaProtocol/mina/blob/compatible/src/lib/transaction_logic/mina_transaction_logic.ml#L2285-L2285
❌ INVALID: ledger/src/scan_state/transaction_logic/for_tests.rs
   Code at L:2351-2356 differs between commit 5da42ccd72e791f164d4d200cf1ce300262873b3 and current branch
   Referenced: https://github.com/MinaProtocol/mina/blob/5da42ccd72e791f164d4d200cf1ce300262873b3/src/lib/transaction_logic/mina_transaction_logic.ml#L2351-L2356
   Current:    https://github.com/MinaProtocol/mina/blob/compatible/src/lib/transaction_logic/mina_transaction_logic.ml#L2351-L2356
❌ INVALID: ledger/src/scan_state/transaction_logic/for_tests.rs
   Code at L:2407 differs between commit 5da42ccd72e791f164d4d200cf1ce300262873b3 and current branch
   Referenced: https://github.com/MinaProtocol/mina/blob/5da42ccd72e791f164d4d200cf1ce300262873b3/src/lib/transaction_logic/mina_transaction_logic.ml#L2407-L2407
   Current:    https://github.com/MinaProtocol/mina/blob/compatible/src/lib/transaction_logic/mina_transaction_logic.ml#L2407-L2407
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/transaction_status.ml L:9-51
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/transaction_status.ml L:452-454
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/with_status.ml L:6-10
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/fee_transfer.ml L:76-80
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/fee_transfer.ml L:68-69
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/coinbase.ml L:17-21
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/transaction/transaction.ml L:8-11
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/signed_command_payload.ml L:34-48
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/stake_delegation.ml L:11-13
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/signed_command_payload.ml L:179-181
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/signed_command_payload.ml L:239-243
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/signed_command_payload.ml L:352-362
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: af319d69b044c043ace8b2cf3c8a73cd1b20c496)

Summary
=======
Total references found: 16
Valid references: 13
Invalid references: 3
Stale commits: 13

❌ Validation failed: 3 invalid reference(s) found

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

✓ Code Reference Verification Passed

All code references in the documentation have been verified successfully!

Total references checked: 1
Valid references: 1

The documentation is in sync with the codebase on the develop branch.

@iostat iostat force-pushed the io/fix-docker-webnode branch from 8ceaf90 to afa920e Compare December 10, 2025 16:24
@iostat
Copy link
Contributor Author

iostat commented Dec 10, 2025

Obligatory "works on my machine":
IMG_0165

@iostat iostat marked this pull request as ready for review December 10, 2025 19:59
@iostat iostat changed the title [WIP] Resurrect the webnode Resurrect the webnode Dec 10, 2025
Copy link
Contributor

@richardpringle richardpringle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of questions, a couple of nits... for me, a "nit" is your choice whether or not to take the suggestion. You can just resolve the ones you disgree with, though I do appreciate a comment reply too.

@dannywillems dannywillems moved this to In Review in Rust node Dec 10, 2025
Copy link
Member

@dannywillems dannywillems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass done, see above.

```sh
# Using the latest version of the Rust node, generate a keypair.
# The --web-node-secrets flag formats the generated keypair into JSON the webnode can use.
docker run --rm o1labs/mina-rust:latest misc mina-key-pair --web-node-secrets > $HOME/web-node-key-pair.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we open a follow-up to have this command tested in the CI? It does require a new release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just added it as a test that runs on build -- if it exists in the binary, it'll always get tested. And that way, after this is merged it should always work on latest Docker.

```sh
# Launch the latest version of the frontend in webnode configuration.
# We mount the keypair generated in step 1, and bind port 4200 on the host to 80 (http) in the container
docker run \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have this in a bash scripts, and we import the content please?

description: How to deploy and launch a webnode using Docker images
---

# Deploying and launching a webnode using Docker
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: could we have a consistent naming convention for the webnode? Sometimes we use WebNode, sometimes webnode or even web-node. Feel free to pick the one you prefer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's open an issue to correct this after, it's gonna touch a lot of places to make this naming consistent.

items: [
'node-operators/alpha-testing',
'node-operators/webnode/local-webnode',
'node-operators/webnode/local-webnode-docker',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be in favor of having this part moved to Node Operations or something else soon. It can be done in a follow-up. Can you open an issue, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will open post merge

@iostat iostat force-pushed the io/fix-docker-webnode branch from 1abbb67 to 7dfc539 Compare December 10, 2025 21:36
@iostat iostat force-pushed the io/fix-docker-webnode branch from 7dfc539 to 347635b Compare December 10, 2025 21:45
Copy link
Contributor

@richardpringle richardpringle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, leaving for @dannywillems to have final approval

@iostat iostat force-pushed the io/fix-docker-webnode branch from 9395f97 to 26431d7 Compare December 11, 2025 17:20
@iostat iostat force-pushed the io/fix-docker-webnode branch from c8d87e7 to e2bcc80 Compare December 11, 2025 17:53
@iostat iostat force-pushed the io/fix-docker-webnode branch from e2bcc80 to f1d849f Compare December 11, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

[Webnode revamp] Document how to run the webnode in Docker [Webnode revamp] Resurrect the webnode

4 participants