GitBook: [2.0.0] 20 pages and 8 assets modified

This commit is contained in:
Pavel Murygin 2021-09-27 19:18:18 +00:00 committed by gitbook-bot
parent bbe456ed96
commit 59ea3e0e75
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF
18 changed files with 75 additions and 70 deletions

View File

Before

Width:  |  Height:  |  Size: 355 KiB

After

Width:  |  Height:  |  Size: 355 KiB

View File

Before

Width:  |  Height:  |  Size: 355 KiB

After

Width:  |  Height:  |  Size: 355 KiB

View File

Before

Width:  |  Height:  |  Size: 595 KiB

After

Width:  |  Height:  |  Size: 595 KiB

View File

Before

Width:  |  Height:  |  Size: 595 KiB

After

Width:  |  Height:  |  Size: 595 KiB

View File

@ -15,14 +15,14 @@
* [Marine Rust SDK](knowledge_aquamarine/marine/marine-rs-sdk.md)
* [Tools](knowledge_tools.md)
* [Node](node.md)
* [Fluence JS](js-sdk/README.md)
* [Concepts](js-sdk/1_concepts.md)
* [Basics](js-sdk/2_basics.md)
* [In-depth](js-sdk/3_in_depth.md)
* [Running app in nodejs](js-sdk/5_run_in_node.md)
* [Running app in browser](js-sdk/4_run_in_browser-1.md)
* [API reference](js-sdk/6-reference.md)
* [Changelog](js-sdk/changelog.md)
* [Fluence JS](fluence-js/README.md)
* [Concepts](fluence-js/1_concepts.md)
* [Basics](fluence-js/2_basics.md)
* [In-depth](fluence-js/3_in_depth.md)
* [Running app in nodejs](fluence-js/5_run_in_node.md)
* [Running app in browser](fluence-js/4_run_in_browser-1.md)
* [API reference](fluence-js/6-reference.md)
* [Changelog](fluence-js/changelog.md)
* [Security](knowledge_security.md)
* [Tutorials](tutorials_tutorials/README.md)
* [Setting Up Your Environment](tutorials_tutorials/recipes_setting_up.md)

View File

@ -11,10 +11,10 @@ To learn more about Aqua see [aqua book](https://doc.fluence.dev/aqua-book/)
The building block of the application are:
- Aqua code for peer-to-peer communication
- Compiler cli package for aqua to \(java\)typescript compilation
- Initialization of the `FluencePeer`
- Application specific code \(java\)typescript in the framework of your choice
* Aqua code for peer-to-peer communication
* Compiler cli package for aqua to \(java\)typescript compilation
* Initialization of the `FluencePeer`
* Application specific code \(java\)typescript in the framework of your choice
In the next section we see it in action
@ -41,3 +41,4 @@ Due to the limitations of browser-based environment `FluencePeer` cannot be disc
The js-based peer does not implement the full set of builtin functions due the limitations described previously. E.g there is no built-ins implementation for _kad_ or _srv_ services. However _op_ service is fully implemented. For the full descriptions of implemented built-ins refer to [Api reference](https://github.com/fluencelabs/gitbook-docs/js-sdk/js-sdk/6_reference/modules.md)
In contrast with the node implementation `FluencePeer` can initiate new particles execution. Aqua compiler generates executable functions from `func` definitions in aqua code.

View File

@ -170,3 +170,4 @@ If everything has been done correctly yuo should see `Hello, world!` in the cons
The next section will cover in-depth and advanced usage of Fluence JS
The code from this section is available in on [github](https://github.com/fluencelabs/examples/tree/main/js-sdk-examples/hello-world)

View File

@ -8,10 +8,10 @@ In this section we will cover the Fluence JS in-depth.
`@fluencelabs/fluence` exports a facade `Fluence` which provides all the needed functionality for the most uses cases. It defined 4 functions:
- `start`: Start the default peer.
- `stop`: Stops the default peer
- `getStatus`: Gets the status of the default peer. This includes connection
- `getPeer`: Gets the default Fluence Peer instance \(see below\)
* `start`: Start the default peer.
* `stop`: Stops the default peer
* `getStatus`: Gets the status of the default peer. This includes connection
* `getPeer`: Gets the default Fluence Peer instance \(see below\)
Under the hood `Fluence` facade calls the corresponding method on the default instance of FluencePeer. This instance is passed to the Aqua-compiler generated functions by default.
@ -134,7 +134,7 @@ Aqua compiler emits TypeScript or JavaScript which in turn can be called from a
For every exported function definition in aqua the compiler generated two overloads. One accepting the `FluencePeer` instance as the first argument, and one without it. Otherwise arguments are the same and correspond to the arguments of aqua functions. The last argument is always an optional config object with the following properties:
- `ttl`: Optional parameter which specify TTL \(time to live\) of particle with execution logic for the function
* `ttl`: Optional parameter which specify TTL \(time to live\) of particle with execution logic for the function
The return type is always a promise of the aqua function return type. If the function does not return anything, the return type will be `Promise<void>`.
@ -183,9 +183,9 @@ export function registerServiceName(
): void;
```
- `peer` - the Fluence Peer instance where the handler should be registered. The peer can be omitted. In that case the default Fluence Peer will be used instead
- `serviceId` - the name of the service id. If the service was defined with the default service id in aqua code, this argument can be omitted.
- `service` - the handler for the service.
* `peer` - the Fluence Peer instance where the handler should be registered. The peer can be omitted. In that case the default Fluence Peer will be used instead
* `serviceId` - the name of the service id. If the service was defined with the default service id in aqua code, this argument can be omitted.
* `service` - the handler for the service.
Depending on whether or not the services was defined with the default id the number of overloads will be different. In the case it **is defined**, there would be four overloads:
@ -274,9 +274,9 @@ export interface CalcDef {
Basic types conversion is pretty much straightforward:
- `string` is converted to `string` in typescript
- `bool` is converted to `boolean` in typescript
- All number types \(`u8`, `u16`, `u32`, `u64`, `s8`, `s16`, `s32`, `s64`, `f32`, `f64`\) are converted to `number` in typescript
* `string` is converted to `string` in typescript
* `bool` is converted to `boolean` in typescript
* All number types \(`u8`, `u16`, `u32`, `u64`, `s8`, `s16`, `s32`, `s64`, `f32`, `f64`\) are converted to `number` in typescript
Arrow types translate to functions in typescript which have their arguments translated to typescript types. In addition to arguments defined in aqua, typescript counterparts have an additional argument for call params. For the majority of use cases this parameter is not needed and can be omitted.
@ -312,3 +312,4 @@ Tetraplets have the form of:
To learn more about tetraplets and application security see [Security](https://github.com/fluencelabs/gitbook-docs/tree/77344eb147c2ce17fe1c0f37013082fc85c1ffa3/js-sdk/knowledge_security.md)
To see full specification of `CallParms` type see [Api reference](https://github.com/fluencelabs/gitbook-docs/tree/77344eb147c2ce17fe1c0f37013082fc85c1ffa3/js-sdk/js-sdk/6_reference/modules.md)

View File

@ -5,3 +5,4 @@ You can use the Fluence JS with any framework \(or even without it\). The "fluen
See the browser-example which demonstrate integrating Fluence with React: [github](https://github.com/fluencelabs/examples/tree/main/js-sdk-examples/browser-example)
Also take a look at FluentPad. It is an example application written in React: [https://github.com/fluencelabs/fluent-pad](https://github.com/fluencelabs/fluent-pad)

View File

@ -90,7 +90,6 @@ async function main() {
}
main();
```
As you can see all the service logic has been implemented in typescript. You have full power of npm at your disposal.

View File

@ -0,0 +1,4 @@
# API reference
API reference is available at [https://fluence.network/fluence-js/](https://fluence.network/fluence-js/)

View File

@ -4,11 +4,11 @@ Fluence JS is an implementation of the Fluence protocol for JavaScript-based env
Similar to the [Rust Fluence Peer implementation](https://github.com/fluencelabs/fluence) it includes:
- Peer-to-peer communication layer (via [js-libp2p](https://github.com/libp2p/js-libp2p))
- [Aqua VM](https://github.com/fluencelabs/aquavm)
- Builtin services
* Peer-to-peer communication layer \(via [js-libp2p](https://github.com/libp2p/js-libp2p)\)
* [Aqua VM](https://github.com/fluencelabs/aquavm)
* Builtin services
Fluence JS can call services and functions on the Fluence network, and expose new APIs to the p2p network directly from TypeScript and JavaScript.
[Aqua language](https://github.com/fluencelabs/aqua) uses Fluence JS as a compilation target, and they are designed to [work in tandem](https://doc.fluence.dev/docs/js-sdk/3_in_depth#understanding-the-aqua-compiler-output).
Fluence JS can call services and functions on the Fluence network, and expose new APIs to the p2p network directly from TypeScript and JavaScript. [Aqua language](https://github.com/fluencelabs/aqua) uses Fluence JS as a compilation target, and they are designed to [work in tandem](https://doc.fluence.dev/docs/js-sdk/3_in_depth#understanding-the-aqua-compiler-output).
Fluence JS can be used with any framework of your choice \(or even without frameworks\).

34
fluence-js/changelog.md Normal file
View File

@ -0,0 +1,34 @@
# Changelog
Fluence JS versioning scheme is the following: `0.BREAKING.ENHANCING`
* `0` shows that Fluence JS does not meet its vision yet, so API can change quickly
* `BREAKING` part is incremented for each breaking API change
* `ENHANCING` part is incremented for every fix and update which is compatible on API level
## [0.13.0](https://github.com/fluencelabs/fluence-js/releases/tag/v0.13.0) September 24, 2021
* `PeerStatus` is now exported from index file \([\#80](https://github.com/fluencelabs/fluence-js/pull/80)\)
* `KeyPair`: method `fromBytes` is replaced with fromEd25519SK \([\#81](https://github.com/fluencelabs/fluence-js/pull/81)\)
## [0.12.1](https://github.com/fluencelabs/fluence-js/releases/tag/v0.12.1) September 14, 2021
* `KeyPair`: add fromBytes, toEd25519PrivateKey \([\#78](https://github.com/fluencelabs/fluence-js/pull/78)\)
## [0.12.0](https://github.com/fluencelabs/fluence-js/releases/tag/v0.13.0) September 10, 2021
* The API to work with the default Fluence Peer has been put under the facade `Fluence`. Method `init` was renamed to `start` and `uninit` renamed to `stop`. `connectionStatus` migrated to `getStatus`.
To migrate from 0.11.0 to 0.12.0
1. `import { Fluence } from "@fluencelabs/fluence"`; instead of `FluencePeer`
2. replace `Fluence.default` with just `Fluence`
3. replace `init` with `start` and `uninit` with `stop`
4. replace `connectionInfo()` with `getStatus()`
\([\#72](https://github.com/fluencelabs/fluence-js/pull/72)\)
## [0.11.0](https://github.com/fluencelabs/fluence-js/releases/tag/v0.11.0) September 08, 2021
* Update JS SDK api to the new version \([\#61](https://github.com/fluencelabs/fluence-js/pull/61)\)

View File

@ -1,3 +0,0 @@
# API reference
API reference is available at https://fluence.network/fluence-js/

View File

@ -1,33 +0,0 @@
# Changelog
Fluence JS versioning scheme is the following: `0.BREAKING.ENHANCING`
- `0` shows that Fluence JS does not meet its vision yet, so API can change quickly
- `BREAKING` part is incremented for each breaking API change
- `ENHANCING` part is incremented for every fix and update which is compatible on API level
### [0.13.0](https://github.com/fluencelabs/fluence-js/releases/tag/v0.13.0) September 24, 2021
- `PeerStatus` is now exported from index file \([#80](https://github.com/fluencelabs/fluence-js/pull/80)\)
- `KeyPair`: method `fromBytes` is replaced with fromEd25519SK \([#81](https://github.com/fluencelabs/fluence-js/pull/81)\)
### [0.12.1](https://github.com/fluencelabs/fluence-js/releases/tag/v0.12.1) September 14, 2021
- `KeyPair`: add fromBytes, toEd25519PrivateKey \([#78](https://github.com/fluencelabs/fluence-js/pull/78)\)
### [0.12.0](https://github.com/fluencelabs/fluence-js/releases/tag/v0.13.0) September 10, 2021
- The API to work with the default Fluence Peer has been put under the facade `Fluence`. Method `init` was renamed to `start` and `uninit` renamed to `stop`. `connectionStatus` migrated to `getStatus`.
To migrate from 0.11.0 to 0.12.0
1. `import { Fluence } from "@fluencelabs/fluence"`; instead of `FluencePeer`
2. replace `Fluence.default` with just `Fluence`
3. replace `init` with `start` and `uninit` with `stop`
4. replace `connectionInfo()` with `getStatus()`
\([#72](https://github.com/fluencelabs/fluence-js/pull/72)\)
### [0.11.0](https://github.com/fluencelabs/fluence-js/releases/tag/v0.11.0) September 08, 2021
- Update JS SDK api to the new version \([#61](https://github.com/fluencelabs/fluence-js/pull/61)\)

View File

@ -1,6 +1,6 @@
# Tools
### Fluence Proto Distributor: FLDIST
## Fluence Proto Distributor: FLDIST
[`fldist`](https://github.com/fluencelabs/proto-distributor) is a command line interface \(CLI\) to Fluence peers allowing for the lifecycle management of services and offers the fastest and most effective way to service deployment.
@ -39,11 +39,11 @@ Options:
[number] [required] [default: 60000]
```
### Fluence JS
## Fluence JS
The [Fluence JS](https://github.com/fluencelabs/fluence-js) supports developers to build full-fledged applications for a variety of targets ranging from browsers to backend apps and greatly expands on the `fldist` capabilities.
### Marine Tools
## Marine Tools
Marine offers multiple tools including the Marine CLI, REPL and SDK. Please see the [Marine section](knowledge_aquamarine/marine/) for more detail.

View File

@ -16,7 +16,7 @@ npm start
Which will open a new browser tab at `http://localhost:3000` . Following the instructions, we connect to any one of the displayed relay ids, open another browser tab also at `http://localhost:3000`, select a relay and copy and paste the client peer id and relay id into corresponding fields in the first tab and press the `say hello` button.
![Browser To Service Implementation](../.gitbook/assets/image%20%2838%29%20%282%29.png)
![Browser To Service Implementation](../.gitbook/assets/image%20%2838%29%20%282%29%20%282%29.png)
The result looks familiar, so what's different? Let's have a look at the Aqua file. Navigate to the `aqua/getting_started.aqua` file in your IDE:

View File

@ -39,7 +39,7 @@ With Docker and VSCode in place:
* When asked for volume, press enter \(unique\)
* Open Terminal in VSCode \(ctrl-\`\)
![Installed And Ready Devcontainer in VSCode](../.gitbook/assets/image%20%2818%29%20%281%29%20%281%29%20%282%29.png)
![Installed And Ready Devcontainer in VSCode](../.gitbook/assets/image%20%2818%29%20%281%29%20%281%29%20%282%29%20%282%29.png)
Congratulations, you now have a fully functional Fluence development environment. For a variety of container management options, click on the `Dev Container: Fluence` button in the lower left of your tool bar: