Getting Started with wasmCloud – InApps Technology is an article under the topic Software Development Many of you are most interested in today !! Today, let’s InApps.net learn Getting Started with wasmCloud – InApps Technology in today’s post !

Read more about Getting Started with wasmCloud – InApps Technology at Wikipedia

You can find content about Getting Started with wasmCloud – InApps Technology from the Wikipedia website

WasmCloud is a platform that aims to help developers create secure, portable, and reusable components (called actors). It leverages WebAssembly for extreme portability so you can secure, deploy, maintain, observe, and upgrade software, all while reducing the amount of boilerplate that must be copied and pasted.

WasmCloud was designed, from the ground up, around these five core ideas:

  • Productivity
  • Enterprise-grade security
  • Cost-effectiveness
  • Portability
  • Performance

If you’re just now hearing about WebAssembly, make sure to first read the following pieces: What Is WebAssembly and Why Do You Need It?, Build a WebAssembly App with Rust, and How to Compile C code into WebAssembly with Emscripten.

To finish up out series on WebAssembly, we’re going to walk through the first steps of using wasmCloud.

I’ll be demonstrating on Ubuntu Server 20.01, but you should be able to follow along with any Debian-based distribution, any Linux distribution that supports snap, Fedora, or macOS (but not M1 macs).

With that said, let’s get to the installation.

Installing Rust

Before we install wasmCloud, let’s first install Rust. It’s not an absolute dependency, but it is recommended. Log into your Linux server, open a terminal window, and install Rust with the command:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

When prompted, type 1 for Proceed with installation (default) and hit Enter on your keyboard. The installation of Rust should complete without any errors. When the installation is finished, you’ll then need to source the environment variables for Rust with the command:

Read More:   You’re Doing It Wrong — Recruiting a DevRel – InApps 2022

source $HOME/.cargo/env

At that point, Rust is installed and ready to go.

Installing wasmCloud

Now we can install wasmCloud. The first thing to be done is to add the necessary repository for the software. To do that, go back to your terminal window and issue the command:

curl -s https://packagecloud.io/install/repositories/wasmcloud/core/script.deb.sh | sudo bash

That command should also update apt for you. If it doesn’t, you can do it manually with the command:

sudo apt-get update

Once apt has been successfully updated, install the necessary wasmCloud software with the command:

sudo apt-get install wasmcloud wash -y

Getting Started with wasmCloud

With wasmCloud installed, you’re ready to fire up your first wasmCloud host. Do this with the command:

wash up

Your terminal will be split into four panes (Figure 1).

Figure 1: The wasmCloud instance has been brought up and is ready to be used.

This is a preconfigured wasmCloud host. Your terminal window should be sized to a minimum of 250×50 characters, otherwise, you’ll have to deal with line wrap, which will make everything a bit confusing. It’s also important, as you deploy your actors and providers, that you make note of the IDs of each (found in the bottom right pane) as they deploy. Retrieving those IDs after the fact can be challenging, as they will be truncated.

To view the running hosts, issue the command:

ctl get hosts

The output of the command should list a single host ID and the uptime (in seconds) for that host. To get a list of the inventory of a host, issue the command:

ctl get inventory ID

Where ID is the host ID.

The next thing we’re going to do is run our first actor. WasmCloud has provided a handy Echo sample actor (which merely echos input) to use, which can be started with the command:

ctl start actor wasmcloud.azurecr.io/echo:0.2.1

Once you’ve started the actor, you should see the progress in the top-right pane, which will state Actor starting on host ID (where ID is the ID of the host). The Echo actor only includes a single operator, which is to respond to delivered HTTP requests and will echo the request sent. But in order for this to work, we have to start the HTTP Server provider with the command:

Read More:   Almost 1/3 of Top npm Accounts Aren’t Protected with 2FA – InApps 2022

ctl start provider wasmcloud.azurecr.io/httpserver:0.12.1

Now, let’s view the host inventory again with the command:

ctl get inventory ID

Where ID is the host ID.

This time you should see both the Echo actor and the HTTP provider included (Figure 2).

Figure 2: Our Echo actor and HTTP provider are now running on the host.

Now that we have both the actor and provider started, we have to connect them so they can function properly. For this, you’ll need the Actor ID and Provider ID (which you should have copied down as each was deployed).

To connect these two together, the command will be:

ctl link ACTORID PROVIDERID wasmcloud:httpserver PORT=8080

Where ACTORID is the ID of the Echo actor and PROVIDERID is the ID of the HTTP provider.

You should see something like:

Advertised link (MBCF) <-> (VAG3) successfully

Let’s interact with our newly-linked actor. Open a second terminal to your hosting server and issue the command:

curl localhost:8080/echo

You should see returned:

That’s a successful call to your linked actor and provider.

To exit out of the wasmCloud console, just type exit and you’re out. Just remember, once you exit, your actors and providers will no longer be available (so you’ll have to deploy them again if you want to use them).

Congratulations, you’ve taken your first steps with wasmCloud. To learn more about this powerful tool, check out the wasmCloud App Development documentation.

Source: InApps.net

List of Keywords users find our article on Google:

wasmcloud
oracle hospitality documentation
packagecloud
rs components vietnam
hire proto.io designers
hosting wikipedia
hire debian developers
httpprovider
rust server hosting
wrap terminal rust
getting started in rust
frame io wikipedia
proto io templates
rust based terminal
rust absolute value
wild wawa
rust curl
absolute vision technologies
getinventory
www.ctl.edu.co
rust command line
ctl internet packages
rust operator
ctl function
hire proto io designer
oracle http server
rust cargo install
apartment leasing in ho chi minh
rust server ubuntu
curl wikipedia
Rate this post
As a Senior Tech Enthusiast, I bring a decade of experience to the realm of tech writing, blending deep industry knowledge with a passion for storytelling. With expertise in software development to emerging tech trends like AI and IoT—my articles not only inform but also inspire. My journey in tech writing has been marked by a commitment to accuracy, clarity, and engaging storytelling, making me a trusted voice in the tech community.

Let’s create the next big thing together!

Coming together is a beginning. Keeping together is progress. Working together is success.

Let’s talk

Get a custom Proposal

Please fill in your information and your need to get a suitable solution.

    You need to enter your email to download

      Success. Downloading...