This repository contains the following crates:
rgb-node
: main indexing daemon, which can be used as an embedded multi-thread service, or compiled into a standalone binary (rgbd
);rgb-client
: client to work with the daemon and a command-line utilityrgb-cli
;rgb-rpc
: a shared crate betweenrgb-node
andrgb-client
.
The node operates as a set of threads, communicating through Crossbeam channels.
It leverages microservices.rs
and netservices.rs
crates,
which serves as the node non-blocking reactor-based (see io-reactor
) microservice frameworks.
The node daemon has the following components:
- Broker, integrating all services and managing their communications;
- RPC: reactor-based thread managing incoming client connections, notifying them about changes to the subscribed information;
- ...
By default, the node exposes a binary RPC API over TCP, which can be exposed as more high-level APIs (HTTP REST, Websocket-based, or JSON-RPC) using special adaptor services.
RGB Node can be run in two modes: as a standalone server and as a multithreaded service embedded into some other process.
The mode is turned on using server
feature flag and leads to production of rgbd
executable.
The binary can be run as a daemon, and accessed via binary RGB RPC interface.
The use of the RPC API can be simplified through rgb-client
crate, providing high-level API.
The mode is turned on using embedded
feature flag and leads to production of rgbnode
library.
To run RGB Node inside any app in this mode please call Broker::start_embedded
,
giving in the method arguments a configuration and instantiated persistence provider.
The method returns Broker
instance; call Broker::client
to receive an AsyncClient
which can
be used to process all calls to the node.
NB: Do not forget to join the Broker
thread from the main app by calling Broker::run
method.
The project currently supports Linux, macOS, and UNIX.
Windows support is a work-in-progress, requiring downstream io-reactor
framework changes.