From ecf9b1b34f230fe302e72a9733cc169b9c2a7b16 Mon Sep 17 00:00:00 2001 From: vms Date: Mon, 24 Aug 2020 01:55:52 +0300 Subject: [PATCH] update readme --- README.md | 18 +++++++++--------- engine/tests/greeting.rs | 2 +- engine/tests/records.rs | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 0ec68402..c5fb9d7f 100644 --- a/README.md +++ b/README.md @@ -70,30 +70,30 @@ extern "C" { - Create simple Rust project - Create `Config.toml` to describe existed wasm modules and give accesses to host binaries and local storage if needed: ```toml -core_modules_dir = "wasm/artifacts/modules" +modules_dir = "wasm/artifacts/modules" -[[core_module]] +[[module]] name = "wasm_local_storage_with_curl.wasm" mem_pages_count = 100 - [core_module.imports] + [module.imports] curl = "/usr/bin/curl" - [core_module.wasi] + [module.wasi] envs = [] preopened_files = ["./wasm/artifacts"] mapped_dirs = { "tmp" = "./wasm/artifacts" } ``` -`core_modules_dir` - path to directory with all modules. All subsequent paths will be relative to this path +`modules_dir` - path to directory with all modules. All subsequent paths will be relative to this path -`[[core_module]]` - modules list +`[[module]]` - modules list -`name` - wasm file name in `core_modules_dir` +`name` - wasm file name in `modules_dir` `mem_pages_count` - a maximum number of Wasm memory pages that loaded module can use. Each Wasm pages is 65536 bytes long -`[core_module.imports]` - list of available imports +`[module.imports]` - list of available imports `curl = "/usr/bin/curl"` - gives possibility to call binary file `/usr/bin/curl` as method `curl` in Rust code @@ -107,7 +107,7 @@ extern "C" { Call binary with arguments: `curl("-vvv ya.ru")` -`[core_module.wasi]` - this block manages communication with the "outside" world +`[module.wasi]` - this block manages communication with the "outside" world `env` - environment variables. Usage: `std::env::var("IPFS_ADDR")` `preopened_files` - list of available directories for loaded modules `mapped_dirs` - mapping between paths diff --git a/engine/tests/greeting.rs b/engine/tests/greeting.rs index fd1d4b12..bc8668a6 100644 --- a/engine/tests/greeting.rs +++ b/engine/tests/greeting.rs @@ -21,7 +21,7 @@ use once_cell::sync::Lazy; static GREETING_WASM_BYTES: Lazy> = Lazy::new(|| { std::fs::read("../examples/greeting/artifacts/greeting.wasm") - .expect("examples/greeting/artifacts/greeting.wasm should presence") + .expect("../examples/greeting/artifacts/greeting.wasm should presence") }); #[test] diff --git a/engine/tests/records.rs b/engine/tests/records.rs index 31bd47a4..5fd47771 100644 --- a/engine/tests/records.rs +++ b/engine/tests/records.rs @@ -21,11 +21,11 @@ use fce::IValue; #[ignore] pub fn records() { let effector_wasm_bytes = - std::fs::read("../examples/records/artifacts/wasm_modules/effector.wasm") - .expect("examples/records/artifacts/wasm_modules/effector.wasm should presence"); + std::fs::read("../examples/records/artifacts/wasm_modules/effector") + .expect("../examples/records/artifacts/wasm_modules/effector.wasm should presence"); - let pure_wasm_bytes = std::fs::read("../examples/records/artifacts/wasm_modules/pure.wasm") - .expect("examples/records/artifacts/wasm_modules/pure.wasm should presence"); + let pure_wasm_bytes = std::fs::read("../examples/records/artifacts/wasm_modules/pure") + .expect("../examples/records/artifacts/wasm_modules/pure.wasm should presence"); let mut fce = FCE::new(); let load_result = fce.load_module("pure", &pure_wasm_bytes, <_>::default());