Home

Awesome

Raiden Service Bundle (RSB)

What is this repository

This repository contains the documentation and configuration necessary to run a Raiden Service Bundle.

Current release: Latest

Table of Contents

Overview

The Raiden Network uses a federation of Matrix servers as its transport layer and a set of services for improved usability. This set of services is called the Raiden Service Bundle. To ensure reliability, availability and neutrality it is desirable that those services are being operated by multiple independent entities.

Therefore we provide this repository which allows easy setup of such a service bundle. It uses docker and docker-compose for easy installation and upgrades.

Currently only this single-server configuration is supported; in the future we may also provide configurations with services split among multiple servers.

Used software

Structure

+-------------------+
|                   |
|   Raiden clients  |
|                   |
+---------+---------+
          |https://
==========|==========
          |
+---------v---------+                       Federation to
|                 +-+-------------------->  other Raiden
|      Traefik    | |                       Matrix servers
|                 |-+---------+----------------------+
+---------+-------+-+         |                      |
          |       |           |                      |
+---------v-------v-+   +-----v----------------+ +---v-----------------+
|                   |   |                      | |                     |
|      Synapse      |   |  Raiden Pathfinding  | |  Raiden Monitoring  |
|                   |   |                      | |                     |
+---------+---------+   +-------------------+--+ +-+-------------------+
          |                                 |      |
+---------v---------+                     +-v- - - v -+
|                   |                     |
|     Postgres      |                        ETH_RPC  |
|                   |                     |
+-------------------+                     + - - - - - +

We use Traefik as a reverse proxy and also utilize its capability of automatically provisioning Let's Encrypt TLS certificates.

The Synapse server is being run in the so-called split worker configuration which increases throughput.

The database stores the message data. Since the transport layer is considered ephemeral in Raiden it is not necessary to arrange for backups of the database data.

Network

After a successful deployment the following ports will be in use:

Requirements

Hardware

Minimum recommended for a production setup:

Note: The default Postgres configuration assumes 16GiB of system RAM

Software

Other

Installation

Note

Running an RSB provides important infrastructure to users of the Raiden Network and failures potentially affect a lot of users. It is therefore recommended to have devops experience and basic knowledge of the Ethereum ecosystem in order to run an RSB. Also a minimum commitment of a reasonable response time in case of outages is required.

Preparation

  1. Provision a server that meets the hardware and software requirements listed above.

  2. Ensure a domain (or subdomain) is available

    Examples:

    • raiden.somedomain.com
    • raiden-service-bundle-somecompany.tld
  3. Configure A (and optionally AAAA) DNS records for the domain pointing to the servers IP address(es)

  4. Configure a CNAME DNS record for *.<domain> pointing back to <domain>

NOTE:

If you intend to use a subdomain it is important to be aware of the security implications. Subdomains share Cookies and Browser LocalStorage with the apex domain. Therefore we strongly suggest that a subdomain is only used below an apex domain that does not host an application that relies on either Cookies or LocalStorage for security relevant purposes (e.g. user authentication).

Installing the RSB

NOTE: This document will sometimes display release candidate versions, also known as pre-releases in the section below. You can identify this, if there is an rcX at the end of the version (E.g. 2019.03.0rc5). When in doubt, always check against the latest full release. If the version is different from what you see below, you should stick to the "full release" and replace the version accordingly.

  1. Clone the current release version of this repository to a suitable location on the server:

    git clone -b 2022.05.0 https://github.com/raiden-network/raiden-service-bundle.git
    
  2. Copy .env.template to .env and modify the values to fit your setup. Please read Configuring the .env file for detailed information.

    • We would appreciate it if you allow us access to the monitoring interfaces (to do that uncomment the default values of the CIDR_ALLOW_METRICS and CIDR_ALLOW_PROXY settings).
    • We also recommend that you provide your own monitoring. The setup of which is currently out of scope of this document.
    • Please read the disclaimers for the path finding and monitoring services carefully and uncomment the variables <SERVICE>_ACCEPT_DISCLAIMER if you agree. Note, that without agreement the services won't start.
  3. If you haven't done so before, run ./register-service-provider.sh register (it uses configuration values from .env). Please read the information provided Registering as a RSB Provider carefully before executing the script.

  4. Run docker-compose up -d to start all services

    • The services are configured to automatically restart in case of a crash or reboot

NOTE:

After a new RSB has been registered and added to the known_servers/known_servers-production-v3.0.0.json file it can take up to 24 hours for the information to propagate to existing RSB installations.

During this time some services will not yet be able to start successfully and log various error messages. This is expected behaviour and will resolve itself.

After the 24h have elapsed all services should run successfully. See verifying that the RSB is working below.

Configuring the .env file

After cloning the repository the .env file needs to be configured. A template named .env.template is provided. Below you find a detailed list of the parameters to be set and their explanations.

Registering as a RSB Provider

For your newly deployed Raiden Service Bundle to be used by Raiden nodes it must be registered.

  1. Registering in the Services Registry On-Chain
  1. Extending known_servers/known_servers-production-v3.0.0.json

Interacting with the service registry contract

Besides the subcommand register which can be used to register as a RSB provider, there are several other subcommands to interact with the service registry contract.

Commands:

You can call register-service-provider.sh <command> to use them.

Verifying that the RSB is working

Check the status of the services by executing docker-compose ps. If any services are in a state other than Up, Up (healthy) or Exit 0 after the elapse of the 24h waiting period a configuration problem is the most likely cause. See troubleshooting the RSB installation below in that case.

Troubleshooting the RSB installation

If you experience any unexpected behavior while installing the RSB, please do not hesitate to contact the development team. The fastest way to reach out to us is via the public Raiden Gitter channel. Otherwise, you can also open an issue in this repository with the predefined template for a bug report

Upgrades

To upgrade to a new release please refer to the upgrading document for any necessary configuration changes.

Afterwards run the following commands:

git fetch origin --tags
git reset --hard <new-release-tag>
docker-compose pull
docker-compose up -d --remove-orphans

Notes:

Known issues

Protection against Spam / (D)DoS attacks

There is currently only some protection against Spam and / or DDoS attacks. This will be addressed in future updates.

Known servers

The known servers the Raiden clients try to connect to are currently tracked in the *.yml files in this repository. These lists are used by Raiden clients when the --matrix-server=auto (default) option is used, for automatically selecting a transport server, based on response times. We intend to change this in the future to use a decentralized scheme (for example an on-chain registry).

Contact / Troubleshooting <a name="contact-troubleshooting" />

To report issues or request help with the setup please open an issue or contact us via email at contact@raiden.nework.

Changelog

See CHANGELOG.md.

Licenses

The code and documentation in this repository are released under the MIT license.

This repository contains instructions to install third party software. Those are licensed as follows: