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.
Out of the box RMB provides the following:
home
servers by matrix
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:
Starting from this we came up with a more detailed requirements:
tfchain
(a blockchain) hence each bot needs an account on tfchain to be able to use rmb
bot
keys, hence make it easy to verify the identity of the sender of a message. This is done both ways.tfchain
hence it's available to everyone to useFor details about protocol itself please check the docs
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.
Or you can keep the connection forever to answer other bots requests if you are providing a service.
Then you are in luck, follow the library documentations to implement a service bot, or to make requests to other bots.
In that case:
rmb-peer
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
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 plain text json.
More details about the structure of the messages are also in the docs page
Please check the latest releases normally you only need the rmb-peer
binary, unless you want to host your own relay.
download Rustup and install Rust, run the following in your terminal, then follow the on-screen instructions:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
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.
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.
rustup target add x86_64-unknown-linux-musl
To use this target, you also need to install a linker that supports musl, such as musl-gcc
.
sudo apt update
sudo apt install musl-tools
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.
Install pre-compiled protoc
binary to ensure that you’re using the latest release of protoc.
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
curl -LO $PB_REL/download/v23.4/protoc-23.4-linux-x86_64.zip
sudo unzip -d /usr/local protoc-23.4-linux-x86_64.zip
protoc --version # Ensure compiler version is updated
Redis:
sudo apt update
sudo apt install redis-server
/etc/redis/redis.conf
file (optional)sudo systemctl enable redis-server
sudo systemctl start redis-server
git clone git@github.com:threefoldtech/rmb-rs.git
cd rmb-rs
cargo build --release --target=x86_64-unknown-linux-musl
If you encounter an error like the one below, it is likely that the protoc
version installed by your package manager is too old.
--- stderr
types.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.
codegen failed: parse and typecheck
Solution: The best way to ensure that you’re using the latest release of protoc
is installing from pre-compiled binaries. See perquisites.
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.
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
RUNNING MULTIPLE PEERS WITH THE SAME MNEMONIC MUST BE AVOIDED UNLESS FOLLOWING THE GUIDE LINES ABOVE
While inside the repository
cargo test