> For the complete documentation index, see [llms.txt](https://docs.astralbeam.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.astralbeam.io/operators/operator-guide.md).

# Overview

This guide is for operators who want to deploy and run AstralBeam relayer infrastructure.

## Overview

A complete bridge deployment consists of:

```mermaid
flowchart TB
    subgraph Relayers[Relayer Network 5 nodes]
        R1[Relayer 1]
        R2[Relayer 2]
        R3[Relayer 3]
        R4[Relayer 4]
        R5[Relayer 5]
    end

    subgraph Support[Support Services]
        API[API Server]
        DB[MySQL/Aurora]
        Prometheus[Prometheus]
        Grafana[Grafana]
    end

    R1 <--> R2
    R2 <--> R3
    R3 <--> R4
    R4 <--> R5
    R5 <--> R1

    API --> DB
    Prometheus --> Grafana
```

## Components

| Component       | Purpose                     | Instances            |
| --------------- | --------------------------- | -------------------- |
| Relayer Workers | Process bridge transactions | 5 (3-of-5 threshold) |
| P2P Network     | Signature exchange          | Built into relayers  |
| MySQL/Aurora    | API transaction history     | 1                    |
| API Server      | REST API for frontend       | 1-2                  |
| Prometheus      | Metrics collection          | 1                    |
| Grafana         | Dashboards and alerts       | 1                    |

## Deployment Options

### 1. [Local Development](/operators/local-setup.md)

Single-node setup for testing and development.

```bash
npm run dev
```

### 2. [Docker Compose](https://github.com/make-software/cspr-bridge/tree/master/gitbook/operator-guide/docker-deployment.md)

Multi-container local deployment with all services.

```bash
docker-compose up -d
```

### 3. [AWS Deployment](https://github.com/make-software/cspr-bridge/tree/master/gitbook/operator-guide/aws-deployment.md)

Production-grade deployment using Ansible playbooks.

```bash
ansible-playbook -i inventory deploy.yml
```

## Quick Start Checklist

### Prerequisites

* [ ] Node.js 20+ installed
* [ ] MySQL 8.0+ or Aurora (for API only)
* [ ] RPC endpoints for all chains
* [ ] Relayer private keys generated
* [ ] CSPR funded for gas

### Configuration

* [ ] Create `.env` file with RPC URLs
* [ ] Configure chain settings
* [ ] Set up relayer keys
* [ ] Configure P2P ports

### Deployment

* [ ] Deploy contracts (or use existing)
* [ ] Register relayer addresses
* [ ] Start relayer workers
* [ ] Verify P2P connectivity
* [ ] Monitor initial transactions

## Architecture Overview

### Relayer Workers

Each relayer runs two workers:

| Worker     | Direction     | Purpose                       |
| ---------- | ------------- | ----------------------------- |
| EVM→Casper | EVM to Casper | Monitor locks, submit mints   |
| Casper→EVM | Casper to EVM | Monitor burns, submit unlocks |

### P2P Network

Relayers communicate via HTTP/HTTPS with TLS encryption:

* **Protocol**: HTTPS with TLS 1.3
* **Ports**: 9000 (default P2P port)
* **Authentication**: Mutual auth challenges with ECDSA signatures
* **Message Types**: Signature requests/responses, heartbeats, status queries, state sync

### State Persistence

**Relayers** use file-based JSON persistence (no database required):

* Processed event tracking
* Block header submissions
* Pending attestations

**API Server** uses MySQL/Aurora for:

* Transaction history and indexing
* Token registry
* Chain configuration

## Hardware Requirements

### Minimum (Testnet)

| Resource | Requirement |
| -------- | ----------- |
| CPU      | 2 cores     |
| RAM      | 4 GB        |
| Storage  | 50 GB SSD   |
| Network  | 100 Mbps    |

### Recommended (Mainnet)

| Resource | Requirement |
| -------- | ----------- |
| CPU      | 4 cores     |
| RAM      | 8 GB        |
| Storage  | 100 GB SSD  |
| Network  | 1 Gbps      |

## Network Requirements

### Ports

| Port | Protocol | Purpose               |
| ---- | -------- | --------------------- |
| 8080 | TCP      | P2P EVM→Casper        |
| 8180 | TCP      | P2P Casper→EVM        |
| 9080 | TCP      | Prometheus metrics    |
| 3001 | TCP      | API server (optional) |

### Firewall Rules

```bash
# Allow P2P from other relayers
ufw allow from 10.0.0.0/8 to any port 8080
ufw allow from 10.0.0.0/8 to any port 8180

# Allow metrics from monitoring
ufw allow from 10.0.0.0/8 to any port 9080
```

## Security Considerations

### Key Management

* Store private keys in secure vault (AWS Secrets Manager)
* Never commit keys to version control
* Rotate keys periodically
* Use hardware security modules (HSM) for mainnet

### Network Security

* Use TLS for P2P communication
* Restrict port access to known IPs
* Use VPN for management access
* Enable DDoS protection

### Operational Security

* Monitor for suspicious activity
* Set up alerting for failures
* Maintain audit logs
* Regular security reviews

## Support Resources

* [CLI Reference](/operators/cli-reference.md) - Complete CLI documentation
* [Troubleshooting](https://github.com/make-software/cspr-bridge/tree/master/gitbook/operator-guide/troubleshooting.md) - Common issues and solutions
* [FAQ](https://github.com/make-software/cspr-bridge/tree/master/gitbook/operator-guide/faq.md) - Frequently asked questions


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.astralbeam.io/operators/operator-guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
