This repository contains the documentation and configuration necessary to run a Raiden Transport Matrix server.
Current release: 2018.8.1
The Raiden Network uses a federation of Matrix servers as it's transport layer. To ensure reliability, availability and neutrality it is desirable that those servers are being operated by multiple independent entities.
Therefore we provide this repository which allows easy setup of such a transport server. 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.
- docker
- docker-compose
- Synapse
- Postgres
- Traefik
+-------------------+
| |
| Raiden clients |
| |
+---------+---------+
|
==========|==========
|
+---------v---------+
| |
| Traefik |
| |
+---------+---------+
|
+---------v---------+
| |
| Synapse <-----> Federation to other
| | Raiden Matrix servers
+---------+---------+
|
+---------v---------+
| |
| Postgres |
| |
+-------------------+
We use Traefik as a reverse proxy and also utilize it's capability of automatically provisiong 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.
After a successful deployment the following ports will be in use:
- 80 - HTTP
- Redirects to HTTPS
- Let's Encrypt HTTP challenge for certificate provisioning
- 443 - HTTPS
- Synapse web and API client access
- Metrics export (IP restricted, see below)
- 8448 - HTTPS
- Synapse Server-to-Server federation
Minumum recommended for a production setup:
- 16 GiB Ram
- 8 Cores
- 50 GiB SSD
- Docker >= 17.06
- docker-compose >= 1.16.0
- A domain (or subdomain) for exclusive use by this server
-
Provision a server that meets the hardware and software requirements listed above.
-
Ensure a domain (or subdomain) is available
Examples:
- raidentransport.somecompany.tld
- raidentransport-somecompany.tld
- somecompany-raidentransport.tld
-
Configure
A
(and optionallyAAAA
) DNS records for the domain pointing to the servers IP address(es) -
Configure a
CNAME
DNS record for*.<domain>
pointing back to<domain>
-
Clone the current release version of this repository to a suitable location on the server:
git clone -b 2018.8.1 https://github.com/raiden-network/raiden-transport.git
-
Copy
.env.template
to.env
and modify the values to fit your setup (see inline comments for details)- 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
andCIDR_ALLOW_PROXY
settings). - We also recommend that you provide your own monitoring. The setup of which is currently out of scope of this document.
- We would appreciate it if you allow us access to the monitoring interfaces
(to do that uncomment the default values of the
-
Run
docker-compose build
to build the containers -
Run
docker-compose up -d
to start all services- The services are configured to automatically restart in case of a crash or reboot
-
Add a cron job to regularly (i.e. once a day) restart the
synapse
service in order to pick up new whitelisted federation peers- This will be better automated in future releases
- Recommended cron job command:
docker-compose -f <path-to-compose-file> restart synapse
-
Verify the service is up by opening the domain in a browser. You should see the synapse login screen.
- Create an issue and submit the domain / URL of the newly deployed server for inclusion in the list of known servers.
To upgrade to a new release please check the changelog for any necessary configuration changes and then run the following commands:
git fetch origin --tags
git reset --hard <new-release-tag>
docker-compose build
docker-compose up -d
There is currently only some protection against Spam and / or DDoS attacks. This will be addressed in future updates.
The known servers the Raiden clients try to connect to are currently tracked in a file in this repository and also shipped as a hard-coded list with the Raiden client. We intend to change this in the future to use a decentralized scheme (for example an on-chain registry).
To report issues or request help with the setup please open an issue or contact us via email at [email protected].
- 2018-08-09 -
2018.8.1
- Initial public release - 2018-08-02 -
2018.8.0
- Initial version