GitBook: [main] 55 pages modified

This commit is contained in:
boneyard93501 2021-06-10 18:10:40 +00:00 committed by gitbook-bot
parent 9e12bbc500
commit 65e54c2220
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF
3 changed files with 44 additions and 1 deletions

View File

@ -27,7 +27,8 @@
* [AIR](knowledge_knowledge/knowledge_aquamarine/knowledge_aquamarine_air.md)
* [Aqua](knowledge_knowledge/knowledge_aquamarine/hll.md)
* [Aqua VM](knowledge_knowledge/knowledge_aquamarine/vm.md)
* [Marine](knowledge_knowledge/knowledge_aquamarine/marine.md)
* [Marine](knowledge_knowledge/knowledge_aquamarine/marine/README.md)
* [Marine-RS-SDK](knowledge_knowledge/knowledge_aquamarine/marine/marine-rs-sdk.md)
* [Fluence Compute Engine](knowledge_knowledge/fluence-compute-engine.md)
* [Node](knowledge_knowledge/node/README.md)
* [Overview](knowledge_knowledge/node/overview.md)

View File

@ -0,0 +1,16 @@
# Marine
[Marine](https://github.com/fluencelabs/marine) is a general purpose WebAssembly runtime favoring Wasm modules based on the [ECS](https://en.wikipedia.org/wiki/Entity_component_system) pattern or plugin architecture and uses Wasm [Interface Types](https://github.com/WebAssembly/interface-types/blob/master/proposals/interface-types/Explainer.mdhttps://github.com/WebAssembly/interface-types/blob/master/proposals/interface-types/Explainer.md) \( IT\) to implement a [shared-nothing](https://en.wikipedia.org/wiki/Shared-nothing_architecture) linking scheme. Fluence [nodes](https://github.com/fluencelabs/fluence) use Marine to host the Aqua VM and execute hosted Wasm services.
Todo: we could really do with diagram
The [Marine Rust SDK](https://github.com/fluencelabs/marine-rs-sdk) allows to hide the IT implementation details behind a handy procedural macro `[marine]` and provides the scaffolding for unit tests.

View File

@ -0,0 +1,26 @@
# Marine-RS-SDK
The marine-rs-sdk empowers developers to write services suitable for peer hosting in peer-to-peer networks using the Marine Virtual Machine by enabling the wasm32-wasi compile target for Marine. For an introduction to writing services with the marine-rs-sdk, see the [Developing Modules And Services](../../../development_development/) section.
### API
The procedural macros `[marine]` and `[marine_test]` are the two primary features provided by the SDK. The `[marine]` macro can be applied to a function, external block or structure. The `[marine_test]` macro, on the other hand, allows the use of the familiar `cargo test` to execute \(unit\) tests over the actual Wasm module generated from the service code.
#### Function Export
Applying the `[marine]` macro to a function results in its export, which means that it can be called from other modules or AIR scripts. For the function to be compatible with this macro, its arguments must be of the `ftype`, which is defined as follows:
`ftype` = `bool`, `u8`, `u16`, `u32`, `u64`, `i8`, `i16`, `i32`, `i64`, `f32`, `f64`, `String`
`ftype` = `ftype` \| `Vec`<`ftype`>
`ftype` = `ftype` \| `Record`<`ftype`>
In other words, the arguments must be one of the types listed below:
* one of the following Rust basic types: `bool`, `u8`, `u16`, `u32`, `u64`, `i8`, `i16`, `i32`, `i64`, `f32`, `f64`, `String`
* a vector of elements of the above types
* a vector composed of vectors of the above type, where recursion is acceptable, e.g. the type `Vec<Vec<Vec<u8>>>` is permissible
* a record, where all fields are of the basic Rust types
* a record, where all fields are of any above types or other records
The return type of a function must follow the same rules, but currently only one return type is possible.