You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reliable message bus is a secure communication panel that allows `bots`to communicate together in a `chat` like way. It makes it very easy to host a service or a set of functions to be used by anyone, even if your service is running behind NAT.
5
+
Reliable Message Bus is a secure peer-to-peer messaging protocol that enables services and nodes to communicate reliably, even when running behind NAT. It provides message authenticity guarantees, end-to-end encryption, and support for federated third-party relays.
6
6
7
-
Out of the box RMB provides the following:
7
+
## What this is
8
8
9
-
- Guarantee authenticity of the messages. You are always sure that the received message is from whoever is pretending to be
10
-
- End to End encryption
11
-
- Support for 3rd party hosted relays. Anyone can host a relay and people can use it safely since there is no way messages can be inspected while using e2e. That's similar to `home` servers by `matrix`
9
+
RMB is a messaging system designed for machine-to-machine communication. It allows bots (automated services) to send and receive messages in a chat-like pattern, with the following properties:
12
10
13
-
## Why
11
+
-**Message authenticity**: Messages are cryptographically signed so the receiver can verify the sender's identity.
12
+
-**End-to-end encryption**: Messages are encrypted so that relays cannot inspect content.
13
+
-**Federated relays**: Anyone can host a relay; users are protected by encryption even when using third-party infrastructure.
14
14
15
-
RMB is developed by ThreefoldTech to create a global network of nodes that are available to host capacity. Each node will act like a single bot where you can ask to host your capacity. This enforced a unique set of requirements:
15
+
## What this repository contains
16
16
17
-
- Communication needed to be reliable
18
-
- Minimize and completely eliminate message loss
19
-
- Reduce downtime
20
-
- Node need to authenticate and authorize calls
21
-
- Guarantee identity of the other peer so only owners of data can see it
22
-
- Fast request response time
17
+
-**`rmb-peer`** — A gateway binary that connects to a relay on behalf of your identity, handling reconnection, verification, decryption, and exposing a simple Redis-based plain-text API
18
+
-**Relay server** — The message routing infrastructure that forwards messages between peers
-**Protocol specification** — Detailed protocol documentation in the [docs](docs/readme.md) directory
23
21
24
-
Starting from this we came up with a more detailed requirements:
22
+
## Role in the stack
25
23
26
-
- User (or rather bots) need their identity maintained by `tfchain` (a blockchain) hence each bot needs an account on tfchain to be able to use `rmb`
27
-
- Then each message then can be signed by the `bot` keys, hence make it easy to verify the identity of the sender of a message. This is done both ways.
28
-
- To support federation (using 3rd party relays) we needed to add e2e encryption to make sure messages that are surfing the public internet can't be sniffed
29
-
- e2e encryption is done by deriving an encryption key from the same identity seed, and share the public key on `tfchain` hence it's available to everyone to use
24
+
RMB serves as the messaging backbone for the infrastructure stack. Nodes, users, and services use it to exchange commands, status updates, and responses. Identities are maintained on a blockchain (each peer needs an account), and public encryption keys are published there for anyone to use. The `rmb-peer` gateway abstracts the cryptographic complexity, allowing clients to interact via simple Redis queue operations using plain JSON.
30
25
31
-
## Specification
26
+
## Mycelium
32
27
33
-
For details about protocol itself please check the [docs](docs/readme.md)
28
+
Mycelium is the network layer used to provide secure, peer-to-peer connectivity between nodes, services, and users. It enables decentralized networking across the infrastructure stack and is used as part of the ThreeFold Grid deployment.
34
29
35
-
## How to use
30
+
## ZOS / Zero-OS
31
+
32
+
ZOS, also known as Zero-OS, is the operating system layer used to run and manage nodes. It provides the low-level runtime environment for workloads, networking, storage, and automation. RMB is the primary communication channel used by ZOS nodes to receive commands and report status.
33
+
34
+
## Relation to ThreeFold
35
+
36
+
This technology is used within the ThreeFold ecosystem and was first deployed on the ThreeFold Grid. The component itself is designed as reusable infrastructure technology and should be understood by its technical function first, independent of any specific deployment.
36
37
37
-
There are many ways to use `rmb` because it was built for `bots` and software to communicate. Hence, there is no mobile app for it for example, but instead a set of libraries where you can use to connect to the network, make chitchats with other bots then exit.
38
+
## Ownership
38
39
39
-
Or you can keep the connection forever to answer other bots requests if you are providing a service.
40
+
This repository is owned and maintained by TF-Tech NV, a Belgian company responsible for the development and maintenance of this technology.
40
41
41
-
### If there is a library in your preferred language
42
+
## Specification
43
+
44
+
For details about the protocol itself, see the [docs](docs/readme.md).
42
45
43
-
Then you are in luck, follow the library documentations to implement a service bot, or to make requests to other bots.
46
+
## How to use
44
47
45
-
#### known libraries
48
+
RMB is built for bots and software to communicate, not for human chat. There is no mobile app; instead, libraries are provided for connecting to the network and exchanging messages with other bots.
think of `rmb-peer` as a gateway that stands between you and the `relay`. `rmb-peer` uses your mnemonics (your identity secret key) to assume your identity and it connects to the relay on your behalf, it maintains the connection forever and takes care of
61
+
If no library is available for your language, you can use `rmb-peer` as a gateway. `rmb-peer` uses your mnemonic (identity secret key) to assume your identity and connects to the relay on your behalf. It maintains the connection indefinitely and handles:
60
62
61
-
-reconnecting if connection was lost
62
-
-verifying received messages
63
-
-decrypting received messages
64
-
-sending requests on your behalf, taking care of all crypto heavy lifting.
63
+
-Reconnecting if the connection is lost
64
+
-Verifying received messages
65
+
-Decrypting received messages
66
+
-Sending requests on your behalf, handling all cryptographic operations
65
67
66
-
Then it provide a simple (plain-text) api over `redis`. means to send messages (or handle requests) you just need to be able to push and pop messages from some redis queues. Messages are simple plaintext json.
68
+
It exposes a simple plain-text API over Redis. To send messages or handle requests, you only need to push and pop messages from Redis queues. Messages are simple plain-text JSON.
67
69
68
-
> More details about the structure of the messages are also in the [docs](docs/readme.md) page
70
+
> More details about the structure of the messages are also in the [docs](docs/readme.md).
69
71
70
72
## Download
71
73
72
-
Please check the latest [releases](https://github.com/threefoldtech/rmb-rs/releases) normally you only need the `rmb-peer` binary, unless you want to host your own relay.
74
+
Please check the latest [releases](https://github.com/threefoldtech/rmb-rs/releases). Normally you only need the `rmb-peer` binary, unless you want to host your own relay.
73
75
74
76
## Build from source
75
77
76
-
### Perquisites
78
+
### Prerequisites
77
79
78
-
-download Rustup and install Rust, run the following in your terminal, then follow the on-screen instructions:
80
+
-Download Rustup and install Rust:
79
81
80
82
```bash
81
83
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
82
84
```
83
85
84
-
- Install the standard library for the target `x86_64-unknown-linux-musl`, which is a Linux platform that uses the musl `libc` implementation instead of the `glibc` one.
85
-
This allows you to compile Rust programs that can run on Linux systems that do not have glibc installed, or to create fully static binaries that do not depend on any shared libraries.
86
+
- Install the standard library for the target `x86_64-unknown-linux-musl`:
86
87
87
88
```bash
88
89
rustup target add x86_64-unknown-linux-musl
89
90
```
90
91
91
-
-To use this target, you also need to install a linker that supports musl, such as `musl-gcc`.
92
+
-Install a linker that supports musl, such as `musl-gcc`:
92
93
93
94
```bash
94
95
sudo apt update
95
96
sudo apt install musl-tools
96
97
```
97
98
98
-
You can then pass the `--target=x86_64-unknown-linux-musl` option to `cargo build` or `cargo run` to compile and run your program for this target.
99
-
100
-
- Install pre-compiled `protoc` binary to ensure that you’re using the latest release of protoc.
- If you encounter an error like the one below, it is likely that the `protoc` version installed by your package manager is too old.
127
+
- If you encounter an error like:
141
128
142
-
```bash
143
-
--- stderr
144
-
types.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.
145
-
codegen failed: parse and typecheck
129
+
```
130
+
types.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.
131
+
codegen failed: parse and typecheck
146
132
```
147
133
148
-
**Solution**: The best way to ensure that you’re using the latest release of `protoc`is installing from pre-compiled binaries. See perquisites.
134
+
**Solution**: Install `protoc` from pre-compiled binaries rather than your package manager. See prerequisites above.
149
135
150
-
- A peer must use a unique `mnemonic` or keys. It's not correct if multiple peers uses the same mnemonic this will make it impossible to route messages correctly. It's possible for the same peer to make multiple connections to the same `relay` given that it uses different `session ids`. A session id identify the connection and hence make routing messages possible.
151
-
- A single peer on the other hand can make multiple connections to multiple relays for redundancy given that his data on the tfchain must reflect that
136
+
- A peer must use a unique mnemonic or keys. Multiple peers using the same mnemonic will make message routing impossible. The same peer may make multiple connections to the same relay using different session IDs. A single peer may also connect to multiple relays for redundancy.
152
137
153
-
> RUNNING MULTIPLE PEERS WITH THE SAME MNEMONIC MUST BE AVOIDED UNLESS FOLLOWING THE GUIDE LINES ABOVE
138
+
> RUNNING MULTIPLE PEERS WITH THE SAME MNEMONIC MUST BE AVOIDED UNLESS FOLLOWING THE GUIDELINES ABOVE
0 commit comments