Yurii Sokolovskyi 8708b8e54b Initial commit | 5 месяцев назад | |
---|---|---|
sonic-channel | 5 месяцев назад | |
src | 5 месяцев назад | |
wasmedge_wasi_socket | 5 месяцев назад | |
.gitignore | 5 месяцев назад | |
Cargo.lock | 5 месяцев назад | |
Cargo.toml | 5 месяцев назад | |
README.md | 5 месяцев назад |
Compile
cargo build --target wasm32-wasi --release
By default, the WASM file will be in ./target/wasm32-wasi/release/sonic_search_wasm.wasm
Run
wasmedge --dir .:<path_to_all_lists> <path_to_wasm_file> -a <sonic_server_address_IPv4> -p <sonic_server_password> -c <email_collection> -f <filename_with_ingested_files> -g <http_server_ddress_gui>
Example
wasmedge --dir .:../../crabmailResult/ ./target/wasm32-wasi/release/sonic_search_wasm.wasm
*sonic_server_address must be IPv4 due to the fact that wasmedge_wasi_socket does not support IPv6 yet.
Bash script you can run instead of writing the whole command
#!/bin/bash
# Variables
path_to_all_lists="../../crabmailResult/"
path_to_wasm_file="./target/wasm32-wasi/release/sonic_search_wasm.wasm"
sonic_server_address_ipv4="127.0.0.1:5041"
sonic_server_password="SecretPassword"
email_collection="mailbox"
filename_with_ingested_files=".sonicSearchIngested.txt"
http_server_address_gui="127.0.0.1:3030"
# Run the wasmedge command
wasmedge --dir .:$path_to_all_lists $path_to_wasm_file -a $sonic_server_address_ipv4 -p $sonic_server_password -c $email_collection -f $filename_with_ingested_files -g $http_server_address_gui