Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The official (self-hosted) server for RGB

License

NotificationsYou must be signed in to change notification settings

RGB-WG/rgb-node

BuildLintsApache-2 licensed

Components

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.

Node Architecture

The node operates as a set of threads, communicating through Crossbeam channels.It leveragesmicroservices.rs andnetservices.rs crates,which serves as the node non-blocking reactor-based (seeio-reactor) microservice frameworks.

The node daemon has the following components:

  • Broker, integrating all services and managing their communications;
  • Dispatcher: reactor-based thread managing incoming client RPC connections;
  • Contracts reader, performing read-only ultra-fast access to the contracts and their state;
  • Contracts writer, performing operations on contracts which require persistence;
  • Watcher, connecting BP Node and monitoring on-chain and mempool events;
  • Validator: a worker thread pool, doing consignment validation in background;
  • AsyncDispatcher, used in embedded mode (see below).

All read operations can be performed in parallel;the write operation does not block read operationsbut requires exclusive access to the contract (meaning that all writes to the same contract areperformed serially).

Using

RGB Node can be run in two modes:as a standalone server and as a multithreaded service embedded into some other process.

Standalone server

The mode is turned on usingserver feature flag and leads to production ofrgbd 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 throughrgb-client crate, providing high-level API.

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.

Embedded service

The mode is turned on usingembedded feature flag and leads to production ofrgbnode library.To run RGB Node inside any app in this mode please callBroker::start_embedded,giving in the method arguments a configuration and instantiated persistence provider.The method returnsBroker instance; callBroker::client to receive anAsyncClient which canbe used to process all calls to the node.

NB: Do not forget to join theBroker thread from the main app by callingBroker::run method.

OS Support

The project currently supports Linux, macOS, and UNIX.Windows support is a work-in-progress, requiring downstreamio-reactor framework changes.

Sponsor this project

  •  
  •  

Packages

 
 
 

Contributors23


[8]ページ先頭

©2009-2025 Movatter.jp