Skip to content

Commit

Permalink
update readme and Makefile (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattes authored Jul 23, 2024
1 parent 311de53 commit 2bd9326
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 45 deletions.
24 changes: 7 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,22 @@ wasm:

ios:
# TODO

wasm-demo/node_modules:
cd wasm-demo && npm install

wasm-demo: wasm-demo/node_modules
cd wasm-demo && npm run start

libs:
# TODO ios target
-mkdir build
cargo build --release --target aarch64-apple-ios
cargo build --release --target aarch64-apple-ios-sim
cp target/aarch64-apple-ios/release/libtlsnotary.a build/tlsnotary-ios-device.a
cp target/aarch64-apple-ios-sim/release/libtlsnotary.a build/tlsnotary-ios-simulator.a

cbindgen:
# TODO ios target
cbindgen --lang c --crate tlsnotary --output build/tlsnotary.h

xcframework:
# TODO ios target
xcodebuild -create-xcframework \
-library target/aarch64-apple-ios/release/libtlsnotary.a \
-headers ./build/tlsnotary.h \
-library target/aarch64-apple-ios-sim/release/libtlsnotary.a \
-headers ./build/tlsnotary.h \
-output build/tlsnotary.xcframework

.PHONY: wasm wasm-demo ios libs xcframework cbindgen
wasm-demo/node_modules:
cd wasm-demo && npm install

wasm-demo: wasm-demo/node_modules
cd wasm-demo && npm run start

.PHONY: wasm wasm-demo ios
57 changes: 29 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
# Web Prover
This repository is used to do end-to-end testing on the TLSN protocol.
There are two end to end flows we test here.
- a rust binary that represents the mobile SDK target
- a web assembly client (`wasm-client`)

## Client Abstraction
TODO: Web Prover high level explainer
TODO: Explain project layout

The client is designed to be egnostic both over build targets, the underlying networking protocol, and the underlying notarization scheme.
## Usage

## End to End testing for Mobile Target

1) Start the notary. From the root directory run:
```sh
cargo run -p webprover --bin tlsn --release
```
2) Run the mock target.
```sh
cargo run -p webprover --bin mock_target
```
3) Run the mock client
```sh
cargo run -p webprover --bin mock_client
make wasm
make ios # TODO
cargo run --release --bin tlsnotary
cargo run --release --bin origo
cargo run --release --bin mock_server
```

## WASM Demo

<!-- You can test the binary mobile target with a simple TUI.
```
cargo run -p tester
make wasm
make wasm-demo
open https://localhost:8090
```
This will test and end to end web proof against a mock go server with the with the default `health` endpoint on the go server which just returns a status OK.
To run with other endpoints you can pass the `--endpoint` flag followed by the endpoint parameters for example: `cargo run -p notary-tester -- --endpoint bin/10KB`. -->

## End to End testing WASM target
TODO
## Feature flags

TODO: target_arch explainer (for wasm)
TODO: target_os explainer (for ios)
TODO: explain all feature flags


Run wasm with
```sh
wasm-pack build --target web wasm-proxy-client
```
## Development

### Configuring rust-analyzer for wasm32

The [client](./client/) crate utilizes `#[cfg(target_arch = "wasm32")]` flags. To ensure that rust-analyzer highlights active code paths that depend on these feature flags, you can configure it in Visual Studio Code. Here’s how:

```
# .vscode/settings.json
{
"rust-analyzer.cargo.target": "wasm32-unknown-unknown"
}
```

## Known Reproducible Failures

Expand Down

0 comments on commit 2bd9326

Please sign in to comment.