Crates.io | zenoh-plugin-remote-api |
lib.rs | zenoh-plugin-remote-api |
version | 1.1.0 |
source | src |
created_at | 2024-11-22 14:56:56.649719 |
updated_at | 2024-12-11 18:50:41.634356 |
description | Zenoh: The Zero Overhead Pub/Sub/Query Protocol. |
homepage | http://zenoh.io |
repository | https://github.com/eclipse-zenoh/zenoh-ts |
max_upload_size | |
id | 1457444 |
size | 96,358 |
The Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute.
Zenoh (pronounce /zeno/) unifies data in motion, data at rest and computations. It carefully blends traditional pub/sub with geo-distributed storages, queries and computations, while retaining a level of time and space efficiency that is well beyond any of the mainstream stacks.
Check the website zenoh.io and the roadmap for more detailed information.
In Zenoh, the remote API plugin is an library loaded into a Zenohd instance at start up, which allows the creation of a Session, declaration of zenoh resources (Subscribers, Publishers, Queryables) remotely via websockets, for runtime environments where it is currently unsupported to run a zenoh binary. The Remote API was designed to support the Typescript Zenoh bindings, running in a browser.
Prerequisites:
zenohd
) installed, and the libzenoh_plugin_remote_api.so
library file is available in ~/.zenoh/lib
or ~/target/debug
.Create a zenoh.json5
configuration file containing for example:
{
mode: "router",
plugins_loading: {
enabled: true,
search_dirs: ["./target/debug", "~/.zenoh/lib"],
},
plugins: {
remote_api: {
"websocket_port": "10000",
},
},
}
Run the zenoh router with:
zenohd -c EXAMPLE_CONFIG.json5
:warning: WARNING :warning: : Zenoh and its ecosystem are under active development. When you build from git, make sure you also build from git any other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.). It may happen that some changes in git are not compatible with the most recent packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in mantaining compatibility between the various git repositories in the Zenoh project.
At first, install Cargo and Rust. If you already have the Rust toolchain installed, make sure it is up-to-date with:
$ rustup update
:warning: WARNING :warning: : As Rust doesn't have a stable ABI, the backend library should be built with the exact same Rust version than
zenohd
, and using forzenoh
dependency the same version (or commit number) than 'zenohd'. Otherwise, incompatibilities in memory mapping of shared types betweenzenohd
and the library can lead to a"SIGSEV"
crash.
To know the Rust version you're zenohd
has been built with, use the --version
option.
$ zenohd --version
zenohd v1.0.0-beta.2 built with rustc 1.75.0 (82e1608df 2023-12-21)
Here, zenohd
is version v1.0.0-beta.2
has been built with the rustc version 1.75.0
.
Install and use this same toolchain with the following command:
$ rustup default 1.75.0
And edit the update Cargo.toml
file to make all the zenoh
dependencies to use the same version number:
zenoh = { version = "v1.0.0-beta.2", features = [ "unstable" ] }
Then build the plugin:
$ cargo build --release --all-targets -p zenoh-plugin-remote-api
$ zenohd --version
zenohd v1.0.0-beta.2 built with rustc 1.75.0 (82e1608df 2023-12-21)
Here, zenohd
version is v1.0.0-beta.2
where:
v1.0.0-beta.2
means it's a development version for the future v1.0.0
release82e1608df
indicates the commit hashrustc
version 1.75.0
.$ rustup default 1.75.0