Skip to content

Commit 09287e7

Browse files
evsharyCharles-Schleich
authored andcommitted
Fix README format (eclipse-zenoh#1186)
* Fix the README format. Signed-off-by: ChenYing Kuo <evshary@gmail.com> * Fix some out-dated contents. Signed-off-by: ChenYing Kuo <evshary@gmail.com> --------- Signed-off-by: ChenYing Kuo <evshary@gmail.com>
1 parent 05ebda4 commit 09287e7

File tree

1 file changed

+91
-83
lines changed

1 file changed

+91
-83
lines changed

README.md

+91-83
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,30 @@
88
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
99

1010
# Eclipse Zenoh
11+
1112
The Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute.
1213

1314
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.
1415

1516
Check the website [zenoh.io](http://zenoh.io) and the [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed information.
1617

1718
-------------------------------
19+
1820
## Getting Started
1921

2022
Zenoh is extremely easy to learn, the best place to master the fundamentals is our [getting started guide](https://zenoh.io/docs/getting-started/first-app/).
2123

2224
-------------------------------
25+
2326
## How to install it
2427

2528
To install the latest release of the Zenoh router (`zenohd`) and its default plugins (REST API plugin and Storages Manager plugin) you can do as follows:
2629

2730
### Manual installation (all platforms)
2831

29-
All release packages can be downloaded from:
30-
- https://download.eclipse.org/zenoh/zenoh/latest/
32+
All release packages can be downloaded from [https://download.eclipse.org/zenoh/zenoh/latest/](https://download.eclipse.org/zenoh/zenoh/latest/).
3133

32-
Each subdirectory has the name of the Rust target. See the platforms each target corresponds to on https://doc.rust-lang.org/stable/rustc/platform-support.html
34+
Each subdirectory has the name of the Rust target. See the platforms each target corresponds to on [https://doc.rust-lang.org/stable/rustc/platform-support.html](https://doc.rust-lang.org/stable/rustc/platform-support.html).
3335

3436
Choose your platform and download the `.zip` file.
3537
Unzip it where you want, and run the extracted `zenohd` binary.
@@ -43,6 +45,7 @@ echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" | sud
4345
sudo apt update
4446
sudo apt install zenoh
4547
```
48+
4649
Then you can start run `zenohd`.
4750

4851
### MacOS
@@ -53,12 +56,17 @@ Tap our brew package repository and install the `zenoh` formula:
5356
brew tap eclipse-zenoh/homebrew-zenoh
5457
brew install zenoh
5558
```
59+
5660
Then you can start run `zenohd`.
5761

62+
-------------------------------
63+
64+
## Rust API
5865

59-
### Rust API
66+
* [Docs.rs for Zenoh](https://docs.rs/zenoh/latest/zenoh/)
6067

6168
-------------------------------
69+
6270
## How to build it
6371

6472
> [!WARNING]
@@ -67,118 +75,117 @@ Then you can start run `zenohd`.
6775
Install [Cargo and Rust](https://doc.rust-lang.org/cargo/getting-started/installation.html). Zenoh can be successfully compiled with Rust stable (>= 1.75.0), so no special configuration is required from your side. If you already have the Rust toolchain installed, make sure it is up-to-date with:
6876

6977
```bash
70-
$ rustup update
78+
rustup update
7179
```
7280

7381
To build Zenoh, just type the following command after having followed the previous instructions:
7482

7583
```bash
76-
$ cargo build --release --all-targets
84+
cargo build --release --all-targets
7785
```
7886

7987
Zenoh's router is built as `target/release/zenohd`. All the examples are built into the `target/release/examples` directory. They can all work in peer-to-peer, or interconnected via the zenoh router.
8088

8189
-------------------------------
82-
## Quick tests of your build:
8390

84-
**Peer-to-peer tests:**
91+
## Quick tests of your build
8592

86-
- **pub/sub**
87-
- run: `./target/release/examples/z_sub`
88-
- in another shell run: `./target/release/examples/z_put`
89-
- the subscriber should receive the publication.
93+
### Peer-to-peer tests
9094

91-
- **get/queryable**
92-
- run: `./target/release/examples/z_queryable`
93-
- in another shell run: `./target/release/examples/z_get`
94-
- the queryable should display the log in its listener, and the get should receive the queryable result.
95+
* **pub/sub**
96+
* run: `./target/release/examples/z_sub`
97+
* in another shell run: `./target/release/examples/z_put`
98+
* the subscriber should receive the publication.
9599

96-
**Routed tests:**
100+
* **get/queryable**
101+
* run: `./target/release/examples/z_queryable`
102+
* in another shell run: `./target/release/examples/z_get`
103+
* the queryable should display the log in its listener, and the get should receive the queryable result.
104+
105+
### Routed tests
97106

98107
> [!NOTE]
99108
> **Windows users**: to properly execute the commands below in PowerShell you need to escape `"` characters as `\"`.
100109
101-
- **put/store/get**
102-
- run the Zenoh router with a memory storage:
103-
`./target/release/zenohd --cfg='plugins/storage_manager/storages/demo:{key_expr:"demo/example/**",volume:"memory"}'`
104-
- in another shell run: `./target/release/examples/z_put`
105-
- then run `./target/release/examples/z_get`
106-
- the get should receive the stored publication.
107-
108-
- **REST API using `curl` tool**
109-
- run the Zenoh router with a memory storage:
110-
`./target/release/zenohd --cfg='plugins/storage_manager/storages/demo:{key_expr:"demo/example/**",volume:"memory"}'`
111-
- in another shell, do a publication via the REST API:
112-
`curl -X PUT -d '"Hello World!"' http://localhost:8000/demo/example/test`
113-
- get it back via the REST API:
114-
`curl http://localhost:8000/demo/example/test`
115-
116-
- **router admin space via the REST API**
117-
- run the Zenoh router with permission to perform config changes via the admin space, and with a memory storage:
118-
`./target/release/zenohd --adminspace-permissions=rw --cfg='plugins/storage_manager/storages/demo:{key_expr:"demo/example/**",volume:"memory"}'`
119-
- in another shell, get info of the zenoh router via the zenoh admin space:
120-
`curl http://localhost:8000/@/router/local`
121-
- get the volumes of the router (only memory by default):
122-
`curl 'http://localhost:8000/@/router/local/**/volumes/*'`
123-
- get the storages of the local router (the memory storage configured at startup on '/demo/example/**' should be present):
124-
`curl 'http://localhost:8000/@/router/local/**/storages/*'`
125-
- add another memory storage on `/demo/mystore/**`:
126-
`curl -X PUT -H 'content-type:application/json' -d '{"key_expr":"demo/mystore/**","volume":"memory"}' http://localhost:8000/@/router/local/config/plugins/storage_manager/storages/mystore`
127-
- check it has been created:
128-
`curl 'http://localhost:8000/@/router/local/**/storages/*'`
129-
130-
**Configuration options:**
110+
* **put/store/get**
111+
* run the Zenoh router with a memory storage:
112+
`./target/release/zenohd --cfg='plugins/storage_manager/storages/demo:{key_expr:"demo/example/**",volume:"memory"}'`
113+
* in another shell run: `./target/release/examples/z_put`
114+
* then run `./target/release/examples/z_get`
115+
* the get should receive the stored publication.
116+
117+
* **REST API using `curl` tool**
118+
* run the Zenoh router with a memory storage:
119+
`./target/release/zenohd --cfg='plugins/storage_manager/storages/demo:{key_expr:"demo/example/**",volume:"memory"}'`
120+
* in another shell, do a publication via the REST API:
121+
`curl -X PUT -d '"Hello World!"' http://localhost:8000/demo/example/test`
122+
* get it back via the REST API:
123+
`curl http://localhost:8000/demo/example/test`
124+
125+
* **router admin space via the REST API**
126+
* run the Zenoh router with permission to perform config changes via the admin space, and with a memory storage:
127+
`./target/release/zenohd --adminspace-permissions=rw --cfg='plugins/storage_manager/storages/demo:{key_expr:"demo/example/**",volume:"memory"}'`
128+
* in another shell, get info of the zenoh router via the zenoh admin space:
129+
`curl http://localhost:8000/@/router/local`
130+
* get the volumes of the router (only memory by default):
131+
`curl 'http://localhost:8000/@/router/local/**/volumes/*'`
132+
* get the storages of the local router (the memory storage configured at startup on '/demo/example/**' should be present):
133+
`curl 'http://localhost:8000/@/router/local/**/storages/*'`
134+
* add another memory storage on `/demo/mystore/**`:
135+
`curl -X PUT -H 'content-type:application/json' -d '{"key_expr":"demo/mystore/**","volume":"memory"}' http://localhost:8000/@/router/local/config/plugins/storage_manager/storages/mystore`
136+
* check it has been created:
137+
`curl 'http://localhost:8000/@/router/local/**/storages/*'`
138+
139+
### Configuration options
131140

132141
A Zenoh configuration file can be provided via CLI to all Zenoh examples and the Zenoh router.
133142

134-
* `-c, --config <FILE>`: a [JSON5](https://json5.org) configuration file. [DEFAULT_CONFIG.json5](DEFAULT_CONFIG.json5) shows the schema of this file and the available options.
135-
143+
* `-c, --config <FILE>`: a [JSON5](https://json5.org) configuration file. [DEFAULT_CONFIG.json5](DEFAULT_CONFIG.json5) shows the schema of this file and the available options.
136144

137145
See other examples of Zenoh usage in [examples/](examples)
138146

139147
> [!NOTE]
140148
> **Zenoh Runtime Configuration**: Starting from version 0.11.0-rc, Zenoh allows for configuring the number of worker threads and other advanced options of the runtime. For guidance on utilizing it, please refer to the [doc](https://docs.rs/zenoh-runtime/latest/zenoh_runtime/enum.ZRuntime.html).
141149
142150
-------------------------------
151+
143152
## Zenoh router command line arguments
144-
`zenohd` accepts the following arguments:
145153

146-
* `--adminspace-permissions <[r|w|rw|none]>`: Configure the read and/or write permissions on the admin space. Default is read only.
147-
* `-c, --config <FILE>`: a [JSON5](https://json5.org) configuration file. [DEFAULT_CONFIG.json5](DEFAULT_CONFIG.json5) shows the schema of this file. All properties of this configuration are optional, so you may not need such a large configuration for your use-case.
148-
* `--cfg <KEY>:<VALUE>`: allows you to change specific parts of the configuration right after it has been constructed. VALUE must be a valid JSON5 value, and key must be a path through the configuration file, where each element is separated by a `/`. When inserting in parts of the config that are arrays, you may use indexes, or may use `+` to indicate that you want to append your value to the array. `--cfg` passed values will always override any previously existing value for their key in the configuration.
149-
* `-l, --listen <ENDPOINT>...`: An endpoint on which this router will listen for incoming sessions.
150-
Repeat this option to open several listeners. By default, `tcp/[::]:7447` is used. The following endpoints are currently supported:
151-
- TCP: `tcp/<host_name_or_IPv4_or_IPv6>:<port>`
152-
- UDP: `udp/<host_name_or_IPv4_or_IPv6>:<port>`
153-
- [TCP+TLS](https://zenoh.io/docs/manual/tls/): `tls/<host_name>:<port>`
154-
- [QUIC](https://zenoh.io/docs/manual/quic/): `quic/<host_name>:<port>`
155-
* `-e, --connect <ENDPOINT>...`: An endpoint this router will try to connect to. Repeat this option to connect to several peers or routers.
156-
* `--no-multicast-scouting`: By default zenohd replies to multicast scouting messages for being discovered by peers and clients.
157-
This option disables this feature.
158-
* `-i, --id <hex_string>`: The identifier (as an hexadecimal string - e.g.: A0B23...) that zenohd must use.
159-
**WARNING**: this identifier must be unique in the system! If not set, a random unsigned 128bit integer will be used.
160-
* `--no-timestamp`: By default zenohd adds a HLC-generated Timestamp to each routed Data if there isn't already one.
161-
This option disables this feature.
162-
* `-P, --plugin [<PLUGIN_NAME> | <PLUGIN_NAME>:<LIBRARY_PATH>]...`: A [plugin](https://zenoh.io/docs/manual/plugins/) that must be loaded. Accepted values:
163-
- a plugin name; zenohd will search for a library named `libzenoh_plugin_<name>.so` on Unix, `libzenoh_plugin_<PLUGIN_NAME>.dylib` on MacOS or `zenoh_plugin_<PLUGIN_NAME>.dll` on Windows.
164-
- `"<PLUGIN_NAME>:<LIBRARY_PATH>"`; the plugin will be loaded from library file at `<LIBRARY_PATH>`.
165-
166-
Repeat this option to load several plugins.
167-
* `--plugin-search-dir <DIRECTORY>...`: A directory where to search for [plugins](https://zenoh.io/docs/manual/plugins/) libraries to load.
168-
Repeat this option to specify several search directories'. By default, the plugins libraries will be searched in:
169-
`'/usr/local/lib:/usr/lib:~/.zenoh/lib:.'`
170-
* `--rest-http-port <rest-http-port>`: Configures the [REST plugin](https://zenoh.io/docs/manual/plugin-http/)'s HTTP port. Accepted values:
171-
- a port number
172-
- a string with format `<local_ip>:<port_number>` (to bind the HTTP server to a specific interface)
173-
- `"None"` to deactivate the REST plugin
174-
175-
If not specified, the REST plugin will be active on any interface (`[::]`) and port `8000`.
154+
`zenohd` accepts the following arguments:
176155

177-
> [!WARNING]
178-
> The following documentation pertains to the v0.6+ API, which comes many changes to the behaviour and configuration of Zenoh.
179-
To access the v0.5 version of the code and matching README, please go to the [0.5.0-beta.9](https://github.com/eclipse-zenoh/zenoh/tree/0.5.0-beta.9) tagged version.
156+
* `--adminspace-permissions <[r|w|rw|none]>`: Configure the read and/or write permissions on the admin space. Default is read only.
157+
* `-c, --config <FILE>`: a [JSON5](https://json5.org) configuration file. [DEFAULT_CONFIG.json5](DEFAULT_CONFIG.json5) shows the schema of this file. All properties of this configuration are optional, so you may not need such a large configuration for your use-case.
158+
* `--cfg <KEY>:<VALUE>`: allows you to change specific parts of the configuration right after it has been constructed. VALUE must be a valid JSON5 value, and key must be a path through the configuration file, where each element is separated by a `/`. When inserting in parts of the config that are arrays, you may use indexes, or may use `+` to indicate that you want to append your value to the array. `--cfg` passed values will always override any previously existing value for their key in the configuration.
159+
* `-l, --listen <ENDPOINT>...`: An endpoint on which this router will listen for incoming sessions.
160+
Repeat this option to open several listeners. By default, `tcp/[::]:7447` is used. The following endpoints are currently supported:
161+
* TCP: `tcp/<host_name_or_IPv4_or_IPv6>:<port>`
162+
* UDP: `udp/<host_name_or_IPv4_or_IPv6>:<port>`
163+
* [TCP+TLS](https://zenoh.io/docs/manual/tls/): `tls/<host_name>:<port>`
164+
* [QUIC](https://zenoh.io/docs/manual/quic/): `quic/<host_name>:<port>`
165+
* `-e, --connect <ENDPOINT>...`: An endpoint this router will try to connect to. Repeat this option to connect to several peers or routers.
166+
* `--no-multicast-scouting`: By default zenohd replies to multicast scouting messages for being discovered by peers and clients.
167+
This option disables this feature.
168+
* `-i, --id <hex_string>`: The identifier (as an hexadecimal string - e.g.: A0B23...) that zenohd must use.
169+
**WARNING**: this identifier must be unique in the system! If not set, a random unsigned 128bit integer will be used.
170+
* `--no-timestamp`: By default zenohd adds a HLC-generated Timestamp to each routed Data if there isn't already one.
171+
This option disables this feature.
172+
* `-P, --plugin [<PLUGIN_NAME> | <PLUGIN_NAME>:<LIBRARY_PATH>]...`: A [plugin](https://zenoh.io/docs/manual/plugins/) that must be loaded. Accepted values:
173+
* a plugin name; zenohd will search for a library named `libzenoh_plugin_<name>.so` on Unix, `libzenoh_plugin_<PLUGIN_NAME>.dylib` on MacOS or `zenoh_plugin_<PLUGIN_NAME>.dll` on Windows.
174+
* `"<PLUGIN_NAME>:<LIBRARY_PATH>"`; the plugin will be loaded from library file at `<LIBRARY_PATH>`.
175+
176+
Repeat this option to load several plugins.
177+
* `--plugin-search-dir <DIRECTORY>...`: A directory where to search for [plugins](https://zenoh.io/docs/manual/plugins/) libraries to load.
178+
Repeat this option to specify several search directories'. By default, the plugins libraries will be searched in:
179+
`'/usr/local/lib:/usr/lib:~/.zenoh/lib:.'`
180+
* `--rest-http-port <rest-http-port>`: Configures the [REST plugin](https://zenoh.io/docs/manual/plugin-http/)'s HTTP port. Accepted values:
181+
* a port number
182+
* a string with format `<local_ip>:<port_number>` (to bind the HTTP server to a specific interface)
183+
* `"None"` to deactivate the REST plugin
184+
185+
If not specified, the REST plugin will be active on any interface (`[::]`) and port `8000`.
180186

181187
-------------------------------
188+
182189
## Plugins
183190

184191
> [!WARNING]
@@ -200,6 +207,7 @@ This plugin converts GET and PUT REST requests into Zenoh gets and puts respecti
200207
This plugin allows you to easily define storages. These will store key-value pairs they subscribed to, and send the most recent ones when queried. Check out [DEFAULT_CONFIG.json5](DEFAULT_CONFIG.json5) for info on how to configure them.
201208

202209
-------------------------------
210+
203211
## Troubleshooting
204212

205213
In case of troubles, please first check on [this page](https://zenoh.io/docs/getting-started/troubleshooting/) if the trouble and cause are already known.

0 commit comments

Comments
 (0)