From 1c3560ee55a06836606865ea4ae6b5d133564c6c Mon Sep 17 00:00:00 2001 From: boneyard93501 Date: Mon, 5 Jul 2021 01:21:40 +0000 Subject: [PATCH] GitBook: [main] 58 pages modified --- concepts.md | 27 ++++++++++++++++----------- p2p.md | 29 ++++++++++++++++------------- quick_start/README.md | 4 ++++ 3 files changed, 36 insertions(+), 24 deletions(-) diff --git a/concepts.md b/concepts.md index 32eb581..f05d979 100644 --- a/concepts.md +++ b/concepts.md @@ -1,14 +1,16 @@ # Concepts + + The Fluence solution enables a new class of decentralized Web3 solutions providing technical, security and business benefits otherwise not available. In order for solution architects and developers to realize these benefits, a shift in philosophy and implementation is required. With the Fluence tool chain available, developers should find it possible to code meaningful Web3 solutions in short order once an understanding of the core concepts and Aqua is in place. The remainder of this section introduces the core concepts underlying the Fluence solution. -## **Particles** +### **Particles** Particles are Fluence's secure distributed state medium, i.e., conflict free replication data structures containing application data, workflow scripts and some metadata, that traverse programmatically specified routes in a highly secure manner. That is, _particles_ hop from distributed compute service to distributed compute service across the peer-to-peer network as specified by the application workflow updating along the way. -Figure 4: Node-Service Perspective Of Particle Workflow +Figure 4: Node-Service Perspective Of Particle Workflow ![](https://i.imgur.com/u4beJgh.png) @@ -18,7 +20,7 @@ While the application state change resulting from passing a particle "through" a As depicted in Figure 4, a particle traverses to a destination node's Aqua VM where the next execution step is evaluated and, if specified, triggered. That is, the service programmatically specified to operate on the particle's data is called from the Aqua VM, the particle's data and workflow \(step\) are updated and the Aqua VM routes the particle to the next specified destination, which may be on the same, another or the client peer. -## **Aqua** +### **Aqua** An integral enabler of the Fluence solution is Aqua, an open source language purpose-built to enable developers to ergonomically program distributed networks and applications by composition. Aqua scripts compile to an intermediary representation, called AIR, which execute on the Aqua Virtual Machine, Aqua VM, itself a Wasm module hosted on the Marine interpreter on every peer node. @@ -28,7 +30,7 @@ Figure 5: From Aqua Script To Particle Execution Currently, compiled Aqua scripts can be executed from Typescript clients based on [Fluence SDK](https://github.com/fluencelabs/fluence-js). For more information about Aqua, see the [Aqua book](https://doc.fluence.dev/aqua-book/). -## **Marine** +### **Marine** Marine is Fluence's generalized Wasm runtime executing Wasm Interface Type \(IT\) modules with Aqua VM compatible interfaces on each peer. Let's unpack. @@ -56,7 +58,7 @@ pub fn greeting(name: String) -> String { } ``` -## **Services** +### **Services** Services are logical constructs instantiated from Wasm modules that contain some business logic and configuration data. That is, services are created, i.e., linked, at the Marine VM runtime level from uploaded Wasm modules and the relevant metadata @@ -66,7 +68,7 @@ Figure 7: Service Composition and Execution Model ![](.gitbook/assets/image%20%287%29.png) -Please note that services are not capable to accept more than one request at any given time. Consider a service, FooBar, comprised of two functions, foo\(\) and bar\(\) where foo is a longer running function. +Please note that services are not capable to accept more than one request at any given time. Consider a service, FooBar, comprised of two functions, foo\(\) and bar\(\) where foo is a longer running function. ```text -- Stylized FooBar service with two functions @@ -88,9 +90,10 @@ func foobar(node:string, service_id:string, func_name:string) -> string: <- res! ``` -As long as foo\(\) is running, the entire FooBar service, including bar\(\), is blocked. This has implications with respect to both service granularity and redundancy. + +As long as foo\(\) is running, the entire FooBar service, including bar\(\), is blocked. This has implications with respect to both service granularity and redundancy. -## **Modules** +### **Modules** In the Fluence solution, Wasm IT modules take one of three forms: @@ -100,7 +103,7 @@ In the Fluence solution, Wasm IT modules take one of three forms: It is important for architects and developers to be aware of their module and services construction with respect to state changes. -## **Authentication And Permissioning** +### **Authentication And Permissioning** Authentication at the service API level is an inherent feature of the Fluence solution. This fine-grained approach essentially provides [ambient authority](https://en.wikipedia.org/wiki/Ambient_authority) out of the box. @@ -116,7 +119,7 @@ struct SecurityTetraplet: SecurityTetraplets are provided with the function call arguments for each \(service\) function call and are checked by the called service. Hence, authentication based on the **\(service caller id == service owner id\)** relation can be established at service ingress and leveraged to build powerful, fine-grained identity and access management solutions enabling true zero trust architectures. -## **Trust Layer** +### **Trust Layer** The Fluence protocol offers an alternative to node selection, i.e. connection and permissioning, approaches, such as [Kademlia](https://en.wikipedia.org/wiki/Kademlia), called TrustGraph. A TrustGraph is comprised of subjectively weights assigned to nodes to manage peer connections. TrustGraphs are node operator specific and transitive. That is, a trusted node's trusted neighbors are considered trustworthy. @@ -124,7 +127,7 @@ The Fluence protocol offers an alternative to node selection, i.e. connection an [TrustGraph](https://github.com/fluencelabs/trust-graph) is currently under active development. Please check the repo for progress. {% endhint %} -## **Scaling Applications** +### **Scaling Applications** As discussed previously, decoupling at the network and business logic levels is at the core of the Fluence protocol and provides the major entry points for scaling solutions. @@ -136,3 +139,5 @@ Figure 8: Stylized Par Execution ![](.gitbook/assets/image%20%288%29.png) + + diff --git a/p2p.md b/p2p.md index 6cf36c4..908673f 100644 --- a/p2p.md +++ b/p2p.md @@ -1,20 +1,22 @@ # Thinking In Aquamarine -Permissionless peer-to-peer networks have a lot to offer to developers and solution architects such as decentralization, control over data, improved request-response data models and zero trust security at the application and service level. Of course, these capabilities and benefits don't just arise from putting [libp2p](https://libp2p.io/) to work. Instead, a peer-to-peer overlay is required. The Fluence protocol provides such an overlay enabling a powerful distributed data routing and management protocol allowing developers to implement modern and secure Web3 solutions. See Figure 1 for a stylized representation decentralized applications development by programming the composition of services distributed across a peer-to-peer network. +Permissionless peer-to-peer networks have a lot to offer to developers and solution architects such as decentralization, control over data, improved request-response data models and zero trust security at the application and service level. Of course, these capabilities and benefits don't just arise from putting [libp2p](https://libp2p.io/) to work. Instead, a peer-to-peer overlay is required. The Fluence protocol provides such an overlay enabling a powerful distributed data routing and management protocol allowing developers to implement modern and secure Web3 solutions. See Figure 1 for a stylized representation decentralized applications development by programming the composition of services distributed across a peer-to-peer network. -Figure 1: Decentralized Applications Composed From Distributed Services On P2P Nodes +Figure 1: Decentralized Applications Composed From Distributed Services On P2P Nodes ![](https://i.imgur.com/XxC7NN3.png) -## Aquamarine +### -As a complement to the protocol, Fluence provides the Aquamarine stack aimed at enabling developers to build high-quality, high-performance decentralized applications. Aquamarine is purpose-built to ease the programming demands commonly encountered in distributed, and especially peer-to-peer, development and is comprised of Aqua and Marine. +### Aquamarine -[Aqua](https://doc.fluence.dev/aqua-book/), is a new generation programming language allowing developers to program peer-to-peer networks and compose distributed services hosted on peer-to-peer nodes into decentralized applications and backends. Marine, on the other hand, provides the necessary Wasm runtime environment on peers to facilitate the execution of compiled Aqua code. +As a complement to the protocol, Fluence provides the Aquamarine stack aimed at enabling developers to build high-quality, high-performance decentralized applications. Aquamarine is purpose-built to ease the programming demands commonly encountered in distributed, and especially peer-to-peer, development and is comprised of Aqua and Marine. -A major contribution of Aquamarine is that network and application layer, i.e., [Layer 3 and Layer 7](https://en.wikipedia.org/wiki/OSI_model), programming is accessible to developers as a seamless and ergonomic composition-from-services experience in Aqua thereby greatly reducing, if not eliminating, common barriers to distributed and decentralized application development. +[Aqua](https://doc.fluence.dev/aqua-book/), is a new generation programming language allowing developers to program peer-to-peer networks and compose distributed services hosted on peer-to-peer nodes into decentralized applications and backends. Marine, on the other hand, provides the necessary Wasm runtime environment on peers to facilitate the execution of compiled Aqua code. -## **Improved Request-Response Model** +A major contribution of Aquamarine is that network and application layer, i.e., [Layer 3 and Layer 7](https://en.wikipedia.org/wiki/OSI_model), programming is accessible to developers as a seamless and ergonomic composition-from-services experience in Aqua thereby greatly reducing, if not eliminating, common barriers to distributed and decentralized application development. + +### **Improved Request-Response Model** In some network models, such as client server, the request-response model generally entails a response returning to the request client. For example, a client application tasked to conduct a credit check of a customer and to inform them with a SMS typically would call a credit check API, consume the response, and then call a SMS API to send the necessary SMS. @@ -32,13 +34,13 @@ In a Fluence p2p implementation, our client application would call a credit chec Such a significantly flattened request-response model leads to much lower resource requirements for applications in terms of bandwidth and processing capacity thereby enabling a vast class of "thin" clients ranging from browsers to IoT and edge devices truly enabling decentralized machine-to-machine communication. -## **Zero Trust Security** +### **Zero Trust Security** The [zero trust security model](https://en.wikipedia.org/wiki/Zero_trust_security_model) assumes the worst, i.e., a breach, at all times and proposes a "never trust, always verify" approach. This approach is inherent in the Fluence peer-to-peer protocol and Aqua programming model as every service request can be authenticated at the service API level. That is, every service exposes functions which may require authentication and authorization. Aquamarine implements SecurityTetraplets as verifiable origins of the function arguments to enable fine-grained authorization. -## Service Granularity And Redundancy +### Service Granularity And Redundancy -Services are not capable to accept more than one request at any given time. Consider a service, FooBar, comprised of two functions, foo\(\) and bar\(\) where foo is a longer running function. +Services are not capable to accept more than one request at any given time. Consider a service, FooBar, comprised of two functions, foo\(\) and bar\(\) where foo is a longer running function. ```text -- Stylized FooBar service with two functions @@ -60,11 +62,12 @@ func foobar(node:string, service_id:string, func_name:string) -> string: <- res! ``` -As long as foo\(\) is running, the entire FooBar service, including bar\(\), is blocked. This has implications with respect to both service granularity and redundancy. + +As long as foo\(\) is running, the entire FooBar service, including bar\(\), is blocked. This has implications with respect to both service granularity and redundancy. -## Summary +### Summary -Programming distributed applications on the Fluence protocol with Aquamarine unlocks significant benefits from peer-to-peer networks while greatly easing the design and development processes. Nevertheless, a mental shift concerning peer-to-peer solution design and development process is required. Specifically, the successful mindset accommodates +Programming distributed applications on the Fluence protocol with Aquamarine unlocks significant benefits from peer-to-peer networks while greatly easing the design and development processes. Nevertheless, a mental shift concerning peer-to-peer solution design and development process is required. Specifically, the successful mindset accommodates * an application architecture based on the composition of distributed services across peer-to-peer networks by decoupling business logic from application workflow * a services-first approach with respect to both the network and application layer allowing a unified network and application programming model encapsulated by Aqua diff --git a/quick_start/README.md b/quick_start/README.md index 12bac20..5cc83ac 100644 --- a/quick_start/README.md +++ b/quick_start/README.md @@ -1,5 +1,7 @@ # Quick Start + + The Fluence solution enables a new class of decentralized Web3 solutions providing technical, security and business benefits otherwise not available. In order for solution architects and developers to realize these benefits, a shift in philosophy and implementation is required. With the Fluence tool chain available, developers should find it possible to code meaningful Web3 solutions in short order once an understanding of the core concepts and Aqua is in place. The remainder of this section introduces the core concepts underlying the Fluence solution. @@ -110,3 +112,5 @@ Figure 8: Stylized Par Execution ![](../.gitbook/assets/image%20%288%29.png) + +