Preamble

Fluence is a powerful solution stack allowing developers to build decentralized, peer-to-peer Web3 protocols and applications with ease. The purpose of this primer is to give you an overview of the most relevant technologies and tools comprising Fluence and point you to the most relevant resources to get you quickly up and hacking on Fluence.

Overview

Fluence is

that allow developers to create performant, powerful, decentralized peer-to-peer Web3 protocols and applications with ease.

The Fluence network is an open, permissionless peer-to-peer network comprised of Fluence peers. Network peers may run in a browser, as node.js processes or Rust nodes. Peers are addressable by their peer id which are derived from the peer's public key decoupling address from ip addresses.

There are two types of Fluence peers: Rust peers and Typescript peers. Rust-based peers are capable of hosting compute services created from portable, reusable Wasm modules decoupling node operation from service operation. Typescript peers, on the other hand, currently can only host single-module Wasm services.

Every Fluence peer organizes local resources, i.e., storage, memory and compute, connection pools and the control plane in between. Local resources are structured as services, where each service exposes one or more functions.

Services can be created from WebAssembly modules in Rust with the Marine SDK. Alternatively, Fluence JS may be used to create peer nodes with exposed interfaces suitable for use with Aqua.

The Fluence protocol stipulates function addressing similar to content addressing found in IPFS, as opposed to REST or JSON-RPC, to access compute services. That is, distributed functions are addressed by a unique service id and the peer id of the service host. Aqua, Fluence's purpose-built peer-to-peer programming language allowing the programming of both the network and services, is the only way to interact with deployed services.

Aqua also enables Fluence's data push model. That is, the response to a compute requests is not returned to the client peer by default but instead routed to the next peer hosting the next compute function specified in the Aqua workflow. This highly efficient model is made possible in part by the Aqua Virtual Machine (AVM) which step-wise processes compiled Aqua code.

Figure 2: Fluence Composition and Execution Model

https://i.imgur.com/ltHooIS.jpg

The AVM is available on every Fluence peer including browsers, node.js apps and Rust nodes. Recall that Marine, Fluence's general purpose Wasm runtime, is currently only available on Rust nodes.

As indicated in Figure 2, a particle, i.e., conflict free replication data type (CRDT) package comprised of the compiled Aqua, data and metadata, represented by the green dot is moving from peer to peer in a (logical forward) push fashion as specified in the Aqua script.

Network