GitBook: [2.0.0] 23 pages modified

This commit is contained in:
boneyard93501
2021-07-05 00:37:54 +00:00
committed by gitbook-bot
parent d5847ed716
commit 68d1d8a3fd
5 changed files with 254 additions and 22 deletions

View File

@ -0,0 +1,6 @@
# Aqua
At the core of Fluence is the open-source language **Aqua** that allows for the programming of peer-to-peer scenarios separately from the computations on peers.
Please see the[ Aqua book ](https://doc.fluence.dev/aqua-book/)for an introduction to the language and reference materials.

View File

@ -301,7 +301,7 @@ Please not that if you want to use `curl_request` with testing, see below, the c
let response = unsafe { curl(curl_cmd) };
```
since cargo does not have access to the magic in place in the marine rs sdk to handle unsafe.
since cargo does not access to the marine macro to handle unsafe.
MountedBinaryResult itself is a Marine-compatible struct containing a binary's return process code, error string and stdout and stderr as byte arrays:
@ -326,8 +326,6 @@ pub struct MountedBinaryResult {
MountedBinaryResult then can be used on a variety of match or conditional tests.
#### Testing
Since we are compiling to a wasm32-wasi target with `ftype` constrains, the basic `cargo test` is not all that useful or even usable for our purposes. To alleviate that limitation, Fluence has introduced the [`[marine-test]` macro ](https://github.com/fluencelabs/marine-rs-sdk/tree/master/crates/marine-test-macro)that does a lot of the heavy lifting to allow developers to use `cargo test` as intended. That is, `[marine-test]` macro generates the necessary code to call Marine, one instance per test function, based on the Wasm module and associated configuration file so that the actual test function is run against the Wasm module not the native code.
@ -445,8 +443,6 @@ Here, an array called `TARGET_MAP` is defined and provided to a logger in the `m
REPL also uses the log crate to print logs from Wasm modules. Log messages will be printed if`RUST_LOG` environment variable is specified.
{% endhint %}
#### Debug
The application of the second feature is limited to obtaining some of the internal details of the IT execution. Normally, this feature should not be used by a backend developer. Here you can see example of such details for the greeting service compiled with the `debug` feature:
@ -474,8 +470,6 @@ result: String("Hi, user")
The most important information these logs relates to the `allocate`/`deallocate` function calls. The `sdk.allocate: 4` line corresponds to passing the 4-byte `user` string to the Wasm module, with the memory allocated inside the module and the string is copied there. Whereas `sdk.deallocate: 0x110080 8` refers to passing the 8-byte resulting string `Hi, user` to the host side. Since all arguments and results are passed by value, `deallocate` is called to delete unnecessary memory inside the Wasm module.
#### Module Manifest
The `module_manifest!` macro embeds the Interface Type \(IT\), SDK and Rust project version as well as additional project and build information into Wasm module. For the macro to be usable, it needs to be imported and initialized in the _main.rs_ file: