banner
0xjokereven

0xjokereven

All is for consistent
twitter
github
pixiv
jike
medium

Getting Started Guide

Let's understand the end-to-end functionality of Fluence through a complete example "Hello World" of a Fluence cloud application. This includes the following steps:

  1. Create a Fluence Cloud Function project using Fluence CLI.
  2. Create the "Hello World" example and compile it into Wasm.
  3. Distribute the Wasm module to a provider.
  4. Execute your Fluence Functions Hello World application.

But first, let's do the setup.

Setup
The recommended way to interact with the Fluence serverless network is to use Fluence CLI. CLI provides full lifecycle management of Fluence functions, as well as tools and development dependencies. If you haven't installed Fluence CLI yet, use the installation script provided below or refer to the "Setup" section.

curl -qsL https://raw.githubusercontent.com/fluencelabs/cli/main/install.sh | bash

Note
Currently, Fluence CLI does not support the Windows operating system, but it supports Windows Linux Subsystem (WLS).

Information
During the installation process, you may need to provide sudo access to set up symbolic links for the binary files. Alternative installation methods can be found in the Readme.

After the installation is complete, use fluence update stable to update CLI and check the version:

fluence --version
@fluencelabs/cli/0.15.10 darwin-arm64 node-v18.19.1

If you get the above CLI version or a higher version, you can proceed.

Hello World
After installing Fluence CLI, let's create our hello world project:

fluence init hello-fluence
You will be prompted to choose from different scaffold templates:

fluence init hello-fluence
? Select template (Use arrow keys)
❯ quickstart
minimal
ts
js
Choose the default quickstart template and continue with the default (kras) network in the subsequent network selection prompt. Fluence CLI will now scaffold a project with the quickstart template and the kras test network. Since this is your first time using Fluence CLI, it may download and install a few dependencies. Once the project is successfully installed, you should see a message similar to the following:

Successfully initialized Fluence CLI project template at /hello-fluence
Now, navigate to the hello-fluence directory and explore the project as you like. Our next step is to run the hello world.

fluence run -f 'helloWorldRemote("Fluence")' --quiet
This will produce the following response:

"Hi, Fluence"
Congratulations! You have just created your first Fluence project and executed your first Hello World on a remote peer on the dar test network. We will revisit our Hello World project in the Quickstart section.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.