GitBook: [docs] 54 pages modified

This commit is contained in:
folex 2021-03-29 19:33:37 +00:00 committed by gitbook-bot
parent ff28425ff2
commit 271edda449
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF
2 changed files with 30 additions and 4 deletions

View File

@ -0,0 +1,24 @@
# Introduction
Fluence Labs builds distributed networks, development tools, components and support systems to allow developers to efficiently and reliably build, operate, maintain, and monetize distributed and decentralized services and applications. An integral component of the Fluence solution is [Aquamarine](https://github.com/fluencelabs/aquamarine), a programming language enabling peer-to-peer coordination for distributed applications and backends.
Fluence is also developing the [Fluence Compute Engine](https://github.com/fluencelabs/fce) \(FCE\) -- a general purpose runtime for multi-module WebAssembly applications with WASI support and a [shared-nothing](https://en.wikipedia.org/wiki/Shared-nothing_architecture) linking scheme. FCE allows for the rapid development and deployment of portable Wasm services which can be composed and coordinated with Aquamarine into secure applications. Furthermore, Fluence has implemented innovations at the p2p [node](https://github.com/fluencelabs/fluence) level, such as [TrustGraph](https://github.com/fluencelabs/trust-graph), local development and testing tools, such as [FCE-Repl](https://github.com/fluencelabs/fce/tree/master/tools/repl), and support tooling, such as [Fluence Distributor](https://github.com/fluencelabs/proto-distributor).
In combination, Aquamarine and the Fluence runtimes and tools allow developers to avoid the typical peer-to-peer development challenges and accelerate the development and deployment of distributed services and applications.
The remainder of this document introduces a set of incremental, hands-on tutorials developing with Aquamarine on the Fluence stack.
Additional resources and support are available:
* [Youtube](https://www.youtube.com/channel/UC3b5eFyKRFlEMwSJ1BTjpbw)
* [Github](https://github.com/fluencelabs)
* [Discord](https://discord.gg/aR2AYErM)
* [Telegram](https://t.me/fluence_project)
* [Twitter](https://twitter.com/fluence_project)
Documentation is work in progress and your feedback is extremely valuable and much appreciated. If you have suggestions or unearth errors or inaccuracies, please open an Issue or push a PR.
Thank You and Enjoy,
The Fluence Team

View File

@ -21,19 +21,21 @@ In order to execute the cUrl service and collect the result, i.e., response, we
) )
``` ```
Without going too deep into Aquamarine and AIR, this script specifies that we call a public peer-to-peer relay \(node\) on the network, ask to run the \(curl\) _request_ function with data parameter _url_ and _service\_id_ parameter, and collect the _result_ **xor** the _error message_ in case of execution failure. We also promise to pass the _service\_id_ and _url_ parameters to the scripts. The "magic" happens by handing the script to the `fldist` CLI tool, which then sends the script for execution to the specified p2p network and locally shadows the execution. Please note that Instead of developing full-fledged frontend applications, we use the `fldist` CLI tool. However, a [JS SDK](https://github.com/fluencelabs/fluence-js) is available to accelerate the development of more complex frontend applications. Without going too deep into Aquamarine and AIR, this script specifies that we call a public peer-to-peer relay \(node\) on the network, ask to run the \(curl\) _request_ function with data parameter _url_ and _service\_id_ parameter, and collect the _result_ **xor** the _error message_ in case of execution failure. We also promise to pass the _service\_id_ and _url_ parameters to the scripts.
The "magic" happens by handing the script to the `fldist` CLI tool, which then sends the script for execution to the specified p2p network and locally shadows the execution. Please note that Instead of developing full-fledged frontend applications, we use the `fldist` CLI tool. However, a [JS SDK](https://github.com/fluencelabs/fluence-js) is available to accelerate the development of more complex frontend applications.
{% hint style="info" %} {% hint style="info" %}
Throughout the document, we utilize service and node ids, which in most cases may be different for you. Throughout the document, we utilize service and node ids, which in most cases may be different for you.
{% endhint %} {% endhint %}
With the service id parameter obtained from the dashboard lookup above, e.g., "f92ce98b-1ed6-4ce3-9864-11f4e93a478f", and some Fluence goodness at both the local and remote levels enables us to: With the service id parameter obtained from the dashboard lookup above, e.g., `"f92ce98b-1ed6-4ce3-9864-11f4e93a478f"`, and some Fluence goodness at both the local and remote levels enables us to:
1. find the p2p node hosting the curl service with above service id , 1. find the p2p node hosting the curl service with above service id ,
2. execute the service and 2. execute the service and
3. collect the response 3. collect the response
In your directory of choice, save the above script as _curl\_request.clj_ and run: In your directory of choice, save the above script as `curl_request.clj` and run:
```bash ```bash
$ fldist run_air -p curl_request.clj -d '{"service_id": "f92ce98b-1ed6-4ce3-9864-11f4e93a478f", "url":"https://api.duckduckgo.com/?q=homotopy&format=json"}' $ fldist run_air -p curl_request.clj -d '{"service_id": "f92ce98b-1ed6-4ce3-9864-11f4e93a478f", "url":"https://api.duckduckgo.com/?q=homotopy&format=json"}'
@ -80,7 +82,7 @@ To recap, we:
* executed the \(remote\) curl service request, and * executed the \(remote\) curl service request, and
* collected the result * collected the result
With essentially a two line script and a couple of parameters we executed a search request as a service on a peer-to-peer network. Even this small example should impress the ease afforded by Aquamarine to compose applications from portable, reusable and distributed services not only taken serverless to the next level by greatly reducing devops requirements but also empowering developers with a composition and coordination medium second to none. With essentially a two-line script and a couple of parameters, we executed a search request as a service on a peer-to-peer network. Even this small example should impress the ease afforded by Aquamarine to compose applications from portable, reusable and distributed services not only taken serverless to the next level by greatly reducing devops requirements but also empowering developers with a composition and coordination medium second to none.
In the next section, we build an Ethereum block getter application by coordinating multiple services into an application. In the next section, we build an Ethereum block getter application by coordinating multiple services into an application.