Skip to content
Merged
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
11 changes: 11 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,14 @@ jobs:
with:
app: tokenlist
environments: '[""]'

deploy-tempo-snapshots-viewer:
name: Deploy Tempo Snapshots Viewer
needs: verify
uses: ./.github/workflows/deploy.yml
secrets:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
with:
app: tempo-snapshots-viewer
environments: '[""]'
11 changes: 11 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
#### other (single-env-apps)
- app: og
- app: perf
- app: tempo-snapshots-viewer
- app: tokenlist
env:
NODE_ENV: production
Expand Down Expand Up @@ -111,6 +112,16 @@ jobs:
run: pnpm build
working-directory: apps/${{ matrix.app }}

- name: Apply Preview Triggers
if: steps.changes.outputs.relevant == 'true' && matrix.app == 'tempo-snapshots-viewer'
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: apps/${{ matrix.app }}
environment: ${{ env.CLOUDFLARE_ENV }}
command: triggers deploy

- name: Upload Worker Version
if: steps.changes.outputs.relevant == 'true'
id: deploy
Expand Down
51 changes: 51 additions & 0 deletions apps/tempo-snapshots-viewer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Tempo Snapshots Viewer

Cloudflare Worker that displays Tempo snapshots stored in R2, including legacy single-archive snapshots and Reth-style v2 modular manifests across multiple Tempo networks.

## Prerequisites

- R2 bucket `tempo-node-snapshots` with public domain at `tempo-node-snapshots.tempoxyz.dev`
- Monorepo dependencies installed from the repository root with `pnpm install`

## Setup

```bash
pnpm install
pnpm --filter tempo-snapshots-viewer gen:types
```

Worker configuration lives in `wrangler.json`.

## Development

```bash
pnpm --filter tempo-snapshots-viewer dev # Local development at http://localhost:8787
```

## Deployment

```bash
pnpm --filter tempo-snapshots-viewer deploy # Deploys to snapshots.tempoxyz.dev
```

## Project Structure

```
apps/tempo-snapshots-viewer/
├── src/
│ └── index.ts # Main Worker logic
├── wrangler.json # Worker configuration
├── package.json # Dependencies
├── tsconfig.json # TypeScript config
├── worker-configuration.d.ts
└── README.md # This file
```

## How It Works

1. The worker scans the bucket for both legacy root-level metadata files and v2 snapshot directories containing `manifest.json`.
2. It normalizes every snapshot into one API shape, groups them by Tempo network, and caches the result at the edge.
3. The UI uses the same modular snapshot experience as the Reth viewer, but adds Tempo network selection for mainnet, testnet, and moderato.
4. If a network has not published a v2 manifest yet, the UI falls back to the latest legacy archive download command for that network.

API endpoint: `/api/snapshots` returns the normalized snapshot list without raw manifest payloads.
30 changes: 30 additions & 0 deletions apps/tempo-snapshots-viewer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "tempo-snapshots-viewer",
"type": "module",
"private": true,
"repository": {
"type": "git",
"directory": "apps/tempo-snapshots-viewer",
"url": "https://github.com/tempoxyz/tempo-apps"
},
"scripts": {
"build": "echo 'No build step needed for Cloudflare Worker'",
"check": "pnpm check:biome && pnpm check:types",
"check:biome": "biome check --write --unsafe",
"check:types": "tsgo --project tsconfig.json --noEmit",
"dev": "wrangler dev",
"deploy": "wrangler deploy",
"gen:types": "wrangler types --env-interface='CloudflareBindings'",
"postinstall": "pnpm gen:types"
},
"dependencies": {
"hono": "catalog:"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@cloudflare/workers-types": "catalog:",
"@types/node": "catalog:",
"typescript": "catalog:",
"wrangler": "catalog:"
}
}
Loading
Loading