Both the legacy and next examples can be run using the local client:
bash
cd path/to/example
cargo run --manifest-path ../../../Cargo.toml --bin cargo-shuttle -- run
When a more fine controlled testing is needed, use the instructions below.
Compile the wasm axum router:
bash
make axum
Run the test:
```bash cargo test --features next axum -- --nocapture
make test ```
Load and run:
bash
cargo run --features next --bin next -- --port 6001
In another terminal:
``` bash
grpcurl -plaintext -import-path ../proto -proto runtime.proto -d '{"service_name": "Tonic", "path": "/home/
grpcurl -plaintext -import-path ../proto -proto runtime.proto -d '{"deployment_id": "MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAw", "ip": "127.0.0.1:8000"}' localhost:6001 runtime.Runtime/Start
grpcurl -plaintext -import-path ../proto -proto runtime.proto localhost:6001 runtime.Runtime/SubscribeLogs
grpcurl -plaintext -import-path ../proto -proto runtime.proto -d '{}' localhost:6001 runtime.Runtime/Stop ```
Curl the service: ```bash curl localhost:8000/hello
curl localhost:8000/goodbye ```
This will no longer load a .so
file, the code to start the runtime will be
codegened for all services.
An example can be found in src/bin/rocket.rs
which contains the secrets rocket example at the bottom and the codegen at the top.
To test, first start a provisioner from the root directory using:
bash
docker-compose -f docker-compose.rendered.yml up provisioner
Then in another shell, start the wrapped runtime using the clap CLI:
bash
cargo run --bin rocket -- --port 6001 --storage-manager-type working-dir --storage-manager-path ./
Or directly (this is the path hardcoded in deployer::start
):
```bash
cargo build
/home/
Then in another shell, load the service and start it up:
``` bash
grpcurl -plaintext -import-path ../proto -proto runtime.proto -d '{"servicename": "Tonic", "path": "/home/
grpcurl -plaintext -import-path ../proto -proto runtime.proto -d '{"deployment_id": "MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAw", "ip": "127.0.0.1:8000"}' localhost:6001 runtime.Runtime/Start
grpcurl -plaintext -import-path ../proto -proto runtime.proto localhost:6001 runtime.Runtime/SubscribeLogs
grpcurl -plaintext -import-path ../proto -proto runtime.proto -d '{}' localhost:6001 runtime.Runtime/Stop ```
bash
$ cd ..; make test