This repository provides infrastructure-as-code examples and tooling to help node operators deploy and manage xmtpd nodes. xmtpd (XMTP daemon) is the node software that powers the testnet and will power the mainnet of the decentralized XMTP network.
Each node should be configured for high availability (HA) across all required components, including the database, xmtpd, and the MLS validation service.
Database:
- 2vCPU
- 8GB RAM
- Postgres 16.0 or newer
- 20ms commit latency
- 250MB/s throughput
xmtpd:
- 2vCPU
- 2GiB memory
- 1GB/s network link
MLS validation service:
- 2vCPU
- 512MiB memory
Choose your infrastructure approach:
-
Use Terraform if you need to provision the underlying cloud infrastructure.
-
Use Helm charts if you have an existing Kubernetes cluster or want to deploy on managed Kubernetes services.
You can use this Terraform tooling if you need to provision underlying cloud infrastructure on AWS/ECS.
XMTPD Terraform Modules describes how to use Terraform modules to provision AWS/ECS infrastructure for xmtpd nodes.
You can use these Helm charts to deploy xmtpd into an existing Kubernetes cluster or on managed Kubernetes services.
Install xmtpd on Kubernetes using Helm charts describes how to install xmtpd on Kubernetes using Helm charts.
Optionally, if you are using Google Kubernetes Engine, you can run xmtpd on GKE with Nginx ingress and Let's Encrypt.
Deploy xmtpd on Google Kubernetes Engine secured by SSL/TLS describes how to secure your deployment with HTTPS and ingress.
Optionally, you can use Kubernetes and Prometheus to set up observability.
Set up Prometheus service discovery for xmtpd in Kubernetes using Helm describes how to automatically scrape metrics from xmtpd pods, visualize in the metrics in Grafana, and set alerts.
To prevent data bloat and keep your node performant, be sure to prune expired messages from your xmtpd database.
To learn more about the networking architecture xmtpd uses, see XMTP Node Communication APIs in the xmtpd repo.
Currently, xmtpd APIs are implemented using the Connect-RPC library, which allows gRPC and gRPC-Web clients out of the box.
Because this library uses HTTP2 instead of gRPC, it also relies on requests headers to properly function, including CORS headers.
When using a load balancer in front of xmtpd, make sure it correctly forwards all headers, including CORS.
Contributions are welcome! See the contributing guidelines for details on how to get involved.