Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Cluster Edit Automation Scripts

Automation scripts for Charon distributed validator cluster editing operations.

## Documentation

- [Obol Replace-Operator Documentation](https://docs.obol.org/next/advanced-and-troubleshooting/advanced/replace-operator)
- [Charon Edit Commands](https://docs.obol.org/next/advanced-and-troubleshooting/advanced/)
- [EIP-3076 Slashing Protection Interchange Format](https://eips.ethereum.org/EIPS/eip-3076)

## Scripts

| Directory | Description |
|-----------|-------------|
| [edit/replace-operator/](edit/replace-operator/README.md) | Replace an operator in a cluster |
| [edit/vc/](edit/vc/) | Export/import anti-slashing database for various VCs |

## Prerequisites

- `.env` file with `NETWORK` and `VC` variables
- Docker and `docker compose`
- `jq`

50 changes: 50 additions & 0 deletions scripts/edit/replace-operator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Replace-Operator Scripts

Scripts to automate the [replace-operator workflow](https://docs.obol.org/next/advanced-and-troubleshooting/advanced/replace-operator) for Charon distributed validators.

## Prerequisites

- `.env` file with `NETWORK` and `VC` variables set
- Docker running
- `jq` installed

## For Remaining Operators

Automates the complete workflow for operators staying in the cluster:

```bash
./scripts/edit/replace-operator/remaining-operator.sh \
--new-enr "enr:-..." \
--operator-index 2
```

**Options:**
- `--new-enr <enr>` - ENR of the new operator (required)
- `--operator-index <N>` - Index of operator being replaced (required)
- `--skip-export` - Skip ASDB export if already done
- `--skip-ceremony` - Skip ceremony if cluster-lock already generated
- `--dry-run` - Preview without executing

## For New Operators

**Step 1:** Generate ENR and share with remaining operators:

```bash
./scripts/edit/replace-operator/new-operator.sh --generate-enr
```

**Step 2:** After receiving cluster-lock from remaining operators:

```bash
# curl -o received-cluster-lock.json https://example.com/cluster-lock.json
./scripts/edit/replace-operator/new-operator.sh --cluster-lock ./received-cluster-lock.json
```

**Options:**
- `--cluster-lock <path>` - Path to new cluster-lock.json
- `--generate-enr` - Generate new ENR private key
- `--dry-run` - Preview without executing

## Testing

See [test/README.md](test/README.md) for integration tests.
Loading