Skip to content

Commit 04c11a4

Browse files
committed
update readme
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
1 parent d036463 commit 04c11a4

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ server](https://github.com/bytecodealliance/sample-wasi-http-rust).
1515
If you want to follow the manual build instructions, you will also need:
1616

1717
4. [`wasm-tools`](https://github.com/bytecodealliance/wasm-tools)
18-
5. If you are fetching the sample binary from an OCI registry,
19-
[`wkg`](https://crates.io/crates/wkg/0.10.0).
18+
5. [`cargo-component`](https://github.com/bytecodealliance/cargo-component)
2019
6. [`hyperlight-wasm-aot`](https://github.com/hyperlight-dev/hyperlight-wasm) from [this commit](https://github.com/jprendes/hyperlight-wasm/tree/134d8fc35)
2120

2221
## Simple setup
@@ -39,6 +38,8 @@ From another terminal, you can then test the server:
3938
curl http://localhost:3000/
4039
curl -w'\n' -d "hola mundo" http://127.0.0.1:3000/echo
4140
curl -I -H "x-language: spanish" http://127.0.0.1:3000/echo-headers
41+
# get the content of .gitignore from github.com/jprendes/hyperlight-wasm-http-example
42+
curl -w'\n' http://127.0.0.1:3000/proxy
4243
```
4344

4445
## Manual setup
@@ -59,22 +60,26 @@ cargo build
5960

6061
### Running
6162

62-
Get an `sample_wasi_http_rust.wasm` from [the sample
63-
repo](https://github.com/bytecodealliance/sample-wasi-http-rust), either
64-
by building it or by fetching it from the OCI registry:
63+
Build the guest component:
6564
```sh
66-
wkg oci pull ghcr.io/bytecodealliance/sample-wasi-http-rust/sample-wasi-http-rust:latest -o sample_wasi_http_rust.wasm
65+
cargo component build --release \
66+
--manifest-path guest/Cargo.toml \
67+
--target-dir target
6768
```
6869

6970
AOT compile it:
7071

7172
```sh
72-
cargo install hyperlight-wasm-aot --git https://github.com/jprendes/hyperlight-wasm.git --rev 134d8fc35
73-
hyperlight-wasm-aot compile --component sample_wasi_http_rust.wasm sample_wasi_http_rust.bin
73+
cargo install hyperlight-wasm-aot \
74+
--git https://github.com/jprendes/hyperlight-wasm.git \
75+
--rev 134d8fc35
76+
hyperlight-wasm-aot compile --component \
77+
target/wasm32-wasip1/release/sample_wasi_http_rust.wasm \
78+
target/wasm32-wasip1/release/sample_wasi_http_rust.bin
7479
```
7580

7681
You can then run the server:
7782

7883
```sh
79-
cargo run -- sample_wasi_http_rust.bin
84+
cargo run -- target/wasm32-wasip1/release/sample_wasi_http_rust.bin
8085
```

0 commit comments

Comments
 (0)