Intro to Fluence

Scarred Entertainment
2 min readMar 1, 2022

Fluence is an open runtime where applications are independent from old school servers. Now applications can switch between servers or avoid them completely. We can also orchestrate applications via data sharing.

Considering services are executed on a wasm runtime many web2 software components can be ported to Fluence. Examples include Redis database and various other off-chain computations such as oracles and pseudo random number generators.

Fluence allows developers to earn income from their software usage. The network-wide licensing system maintains a global network of application dependencies, access rights, and pricing. The native cryptocurrency serves as a payment medium: to register, revoke, and manage software licenses.

Get an in-depth `feel` here in the Fluence Project Manifesto)

Architecture

Aquamarine

The only difference between traditional servers and Fluence is that as opposed to an operating system where you can build python or C++ programs using compilers; in Fluence we use the Aquamarine toolkit. Aquarimarine is composed of Aqua service workflows and Marine wasm compatible service definitions.

Aqua is a programming language that compiles to Aqua Intermediate Representation (AIR). This representation in turn can be executed on AquaVM. We use Aqua to compose defined wasm services running on Marine.

Marine is a WebAssembly runtime. Fluence nodes use Marine to host AquaVM and various other Wasm services. Currently only Rust and Typescript can define services although works to support more languages is under way.

Decoupling:

Whole lotta decoupling going on down til the resource level. Services can be composed within AIR scripts and Secutity Tetraplets help with verification of function calls in the form `(peer_id, service_id, func, data)`. Have a look at this example of composition found here in the documentation.

service Auth:
def grant_permissions(to_peer: PeerId)
def check_permissions(): bool
service Blog:
def post(text: string, is_permitted: bool)
def list_posts(): Post[]

Decoupling the blog and authentication services gives more flexibility when designing them.

Performance:

When working with multiplayer network gaming you should consider the service granularity and redundancy. A service can only be invoked by one peer at a time.

dApp tools

FluenceJS allows you build web dapps by providing a library that connects and communicates with peers via libp2p. It also includes the Aquamarine toolkit for stating your workflows and defining services with Typescript.

Conclusion:

Sounds good to Scarred Entertainment, gonna go build a whole lot of games.

--

--