Skip to content

Commit 632a48b

Browse files
authored
Merge pull request #1778 from o1-labs/io/fix-docker-webnode
Resurrect the webnode
2 parents b1b5f6a + 8e91415 commit 632a48b

File tree

22 files changed

+567
-101
lines changed

22 files changed

+567
-101
lines changed

.cargo/config.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,25 @@ rustflags = []
33

44
[target.aarch64-apple-darwin]
55
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"]
6+
7+
[target.wasm32-unknown-unknown]
8+
rustflags = [
9+
"-C",
10+
"target-feature=+atomics,+bulk-memory",
11+
"-C",
12+
"link-args=--shared-memory",
13+
"-C",
14+
"link-args=--import-memory",
15+
"-C",
16+
"link-args=--export-memory",
17+
"-C",
18+
"link-args=--max-memory=4294967296",
19+
"-C",
20+
"link-args=--export=__wasm_init_tls",
21+
"-C",
22+
"link-args=--export=__tls_size",
23+
"-C",
24+
"link-args=--export=__tls_align",
25+
"-C",
26+
"link-args=--export=__tls_base",
27+
]
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
# Test the mina misc mina-key-pair command
6+
7+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8+
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
9+
cd "$REPO_ROOT"
10+
11+
MINA_BIN="${MINA_BIN:-./target/release/mina}"
12+
13+
echo "Testing: mina misc mina-key-pair"
14+
echo ""
15+
16+
# Test 1: Basic mina-key-pair command
17+
echo "Test 1: mina misc mina-key-pair (basic)"
18+
if "$MINA_BIN" misc mina-key-pair > /dev/null 2>&1; then
19+
echo "✓ Command executed successfully"
20+
else
21+
echo "✗ Test failed: Command failed to execute"
22+
exit 1
23+
fi
24+
echo ""
25+
26+
# Test 2: mina-key-pair with --web-node-secrets flag
27+
echo "Test 2: mina misc mina-key-pair --web-node-secrets"
28+
OUTPUT=$("$MINA_BIN" misc mina-key-pair --web-node-secrets)
29+
EXIT_STATUS=$?
30+
31+
# Verify command executed successfully
32+
if [ $EXIT_STATUS -ne 0 ]; then
33+
echo "✗ Test failed: Command failed to execute"
34+
exit 1
35+
fi
36+
echo "✓ Command executed successfully"
37+
38+
# Verify output is valid JSON
39+
if ! echo "$OUTPUT" | jq empty 2>/dev/null; then
40+
echo "✗ Test failed: Output is not valid JSON"
41+
echo "Output was: $OUTPUT"
42+
exit 1
43+
fi
44+
echo "✓ Output is valid JSON"
45+
46+
# Verify JSON contains "publicKey" field with a string value
47+
PUBLIC_KEY=$(echo "$OUTPUT" | jq -r '.publicKey' 2>/dev/null)
48+
if [ -z "$PUBLIC_KEY" ] || [ "$PUBLIC_KEY" = "null" ]; then
49+
echo "✗ Test failed: JSON does not contain 'publicKey' field with a string value"
50+
echo "Output was: $OUTPUT"
51+
exit 1
52+
fi
53+
echo "✓ JSON contains 'publicKey' field with value: $PUBLIC_KEY"
54+
55+
# Verify JSON contains "privateKey" field with a string value
56+
PRIVATE_KEY=$(echo "$OUTPUT" | jq -r '.privateKey' 2>/dev/null)
57+
if [ -z "$PRIVATE_KEY" ] || [ "$PRIVATE_KEY" = "null" ]; then
58+
echo "✗ Test failed: JSON does not contain 'privateKey' field with a string value"
59+
echo "Output was: $OUTPUT"
60+
exit 1
61+
fi
62+
echo "✓ JSON contains 'privateKey' field with value: [REDACTED]"
63+
64+
echo ""
65+
echo "✓ All tests passed!"

.github/workflows/tests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ jobs:
228228
- name: Test OCaml-specific GraphQL endpoints
229229
run: ./.github/scripts/test-ocaml-specific-endpoints.sh
230230

231+
- name: Test mina misc mina-key-pair command
232+
run: ./.github/scripts/test-misc-mina-key-pair.sh
233+
231234
- name: Upload binaries
232235
uses: actions/upload-artifact@v5
233236
with:

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
([#1736](https://github.com/o1-labs/mina-rust/pull/1736))
1717
- **CI**: automatically push Docker images for `vX.Y.Z` and `vX.Y` when tag `vX.Y.Z` is created
1818
([#1838](https://github.com/o1-labs/mina-rust/pull/1838))
19+
- **Web Node**: fix webnode build, add quality-of-life improvements when running
20+
webnode in Docker. ([#1778](https://github.com/o1-labs/mina-rust/pull/1778))
1921

2022
### Changes
2123

0 commit comments

Comments
 (0)