Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
5828dc0
Add OP Scan Block Explorer
saimeunt Nov 11, 2024
e33b435
Add missing files
saimeunt Nov 11, 2024
51c1e54
Update cross-chain-message.mdx
zainbacchus Nov 11, 2024
8b29d73
fix lint warning
krofax Nov 11, 2024
eb24a1c
remove word
krofax Nov 11, 2024
766a836
Update pages/stack/interop/cross-chain-message.mdx
krofax Nov 11, 2024
f6a249a
updated text
krofax Nov 11, 2024
8fff156
improved word
krofax Nov 11, 2024
24ecff7
Improve Grammar and Consistency in Glossary Term Template
Noisyxl Nov 10, 2024
d12e0c8
Update suggest_tutorial.yaml
Noisyxl Nov 10, 2024
95f0401
Updated docs files with errors
Anon-im Nov 9, 2024
562b257
Typo Update CONTRIBUTING.md
mdqst Nov 12, 2024
f46ab56
Clean up explainer
zainbacchus Nov 13, 2024
1baceef
remove duplicate
krofax Nov 13, 2024
9b2d714
correct spelling
krofax Nov 13, 2024
eadccee
fix spacing
krofax Nov 13, 2024
8942e00
improve text
krofax Nov 13, 2024
014db79
improve text
krofax Nov 13, 2024
f15d94a
Update explainer.mdx
zainbacchus Nov 13, 2024
6716511
reworded for clarity
krofax Nov 13, 2024
65ab7a4
improve text
krofax Nov 13, 2024
6b11565
Update home page capitalization
bradleycamacho Nov 13, 2024
08a1af9
Fix breadcrumb and title casing
bradleycamacho Nov 13, 2024
8172140
Typo Update content-reuse.md
voronor Nov 14, 2024
dbb9429
Added starter kit
krofax Nov 14, 2024
654f104
fix lint error
krofax Nov 14, 2024
f258618
Collapsing walkthrough section and disabling changed file summary
bradleycamacho Nov 13, 2024
44e1963
replace the SDK link with viem
krofax Nov 12, 2024
0adff39
changes op mainnet to op stack
krofax Nov 12, 2024
dd292f3
Deploy the L1 contract command path updated
BalrajHariharanA Nov 6, 2024
823c428
Refactor JSDoc for WipCallout to Improve Clarity and Precision Update…
0xbryer Nov 15, 2024
911b42c
Fix invalid stroke-width attribute Update Loader.tsx
voronor Nov 15, 2024
4488df3
Update components/calculator/Loader.tsx
krofax Nov 15, 2024
ba611db
Created a script that checks for borken links
krofax Nov 15, 2024
e8d2b35
updated the link checker
krofax Nov 15, 2024
dc23b5e
Documented the steps involved to automate the redirect
krofax Nov 15, 2024
11f7939
revert changes made in lychee
krofax Nov 15, 2024
7458aef
revert previous changes to lychee file
krofax Nov 15, 2024
071e411
Update notes/fix-redirects.md
krofax Nov 15, 2024
4a791af
fix lint issues
krofax Nov 15, 2024
ccf1313
update the command
krofax Nov 15, 2024
5148ca9
revert changes
krofax Nov 15, 2024
f902d7e
Typo Update OpProposerDescriptionShort.md
0xbryer Nov 17, 2024
7e3ac40
docs: fix SuperchainERC20 deployment guide URL
codeesura Nov 15, 2024
21b3dc5
Update rollup.mdx
brokewhale Nov 19, 2024
e9e04e5
Update addresses.mdx
Hopium21 Nov 18, 2024
b7814fa
Update security-policy.mdx
Hopium21 Nov 18, 2024
b05ddc5
Update 404.mdx
Hopium21 Nov 18, 2024
2390a3a
Update index.mdx
Hopium21 Nov 18, 2024
0cdd15a
Update pages/404.mdx
sbvegan Nov 19, 2024
0e80025
Update oracles.mdx tags
brokewhale Nov 19, 2024
e6d3bc3
fix lint issues
krofax Nov 19, 2024
4a9df6f
Sync with latest README
saimeunt Nov 19, 2024
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
1 change: 1 addition & 0 deletions pages/builders/chain-operators/tools/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"chain-monitoring": "Chain monitoring",
"explorer": "Block explorer",
"op-scan": "OP Scan Block Explorer",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Missing documentation file for OP Scan Block Explorer

The _meta.json file includes an entry for "op-scan" but there's no corresponding documentation file in the directory. The existing explorer.mdx is specifically about deploying Blockscout and is unrelated to OP Scan. You should:

  • Add a documentation file for OP Scan Block Explorer in the pages/builders/chain-operators/tools/ directory
  • Keep both entries in _meta.json as they represent different tools (Blockscout and OP Scan)
🔗 Analysis chain

Please clarify the relationship with existing explorer entry.

The addition follows the correct format and maintains alphabetical ordering. However, there's already an existing "explorer" entry. Could you clarify if:

  1. OP Scan is meant to be an additional explorer option, or
  2. OP Scan should replace the existing "explorer" entry?
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if there's a corresponding documentation file for both explorers
echo "Checking for explorer documentation files..."
fd --type f "explorer.md|op-scan.md" pages/builders/chain-operators/tools/

Length of output: 225


Script:

#!/bin/bash
# Let's check the content of the explorer.mdx to see if it's related to OP Scan
echo "Content of explorer.mdx:"
cat pages/builders/chain-operators/tools/explorer.mdx

# Also check if there's a new op-scan file that might have a different extension
echo -e "\nChecking for op-scan files with any extension:"
fd "op-scan" pages/builders/chain-operators/tools/

Length of output: 2457

"op-challenger": "op-challenger",
"op-conductor": "op-conductor",
"op-deployer": "op-deployer",
Expand Down
157 changes: 157 additions & 0 deletions pages/builders/chain-operators/tools/op-scan.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
---
title: op-scan
lang: en-US
description: Learn how to launch OP Scan, a block explorer designed for your OP Stack chain.
---

import { Callout } from "nextra/components";

# 🔎 OP Scan

[OP Scan](https://github.com/walnuthq/op-scan) is a transaction explorer tailored specifically for the [OP Stack](https://docs.optimism.io/builders/chain-operators/tutorials/create-l2-rollup) and the [Superchain vision](https://www.youtube.com/watch?v=O6vYNgrQ1LE).
It's purpose built to be lightweight, so that anyone can run it locally next to their OP Stack nodes, when working on a new rollup.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix grammatical errors in the introduction.

There are two grammatical issues in this line:

  1. "It's" should be "Its" (possessive form)
  2. Remove the comma before "so that"
-It's purpose built to be lightweight, so that anyone can run it locally next to their OP Stack nodes, when working on a new rollup.
+Its purpose built to be lightweight so that anyone can run it locally next to their OP Stack nodes when working on a new rollup.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
It's purpose built to be lightweight, so that anyone can run it locally next to their OP Stack nodes, when working on a new rollup.
Its purpose built to be lightweight so that anyone can run it locally next to their OP Stack nodes when working on a new rollup.
🧰 Tools
🪛 LanguageTool

[typographical] ~12-~12: The conjunction “so that” does not require a comma.
Context: ...E). It's purpose built to be lightweight, so that anyone can run it locally next to their...

(SO_THAT_UNNECESSARY_COMMA)


<Callout>
Check out the [OP Scan README](https://github.com/walnuthq/op-scan) for
up-to-date information on how to launch OP Scan.
</Callout>

![screenshot](https://raw.githubusercontent.com/walnuthq/op-scan/main/screenshot.png)

# ⚙️ Installation

The app requires the following dependencies:

```
NodeJS >= 22
pnpm >= 9
```

### Explorer Configuration

Clone this repository:

```sh
git clone git@github.com:walnuthq/op-scan
```

Install the dependencies:

```sh
pnpm install
```

You will need to copy `.env.local.example` into `.env.local` at the root of your repository and populate it with your own values.

In particular you will need to provide configuration for both L1 and L2 chains:

```
NEXT_PUBLIC_L1_CHAIN_ID="11155111"
NEXT_PUBLIC_L1_NAME="Sepolia"
NEXT_PUBLIC_L1_RPC_URL="https://eth-sepolia.g.alchemy.com/v2/API_KEY"
NEXT_PUBLIC_L2_CHAIN_ID="42069"
NEXT_PUBLIC_L2_NAME="OP Local"
NEXT_PUBLIC_L2_RPC_URL="http://localhost:8545"
```

You can get free node rpcs url by signing up to services such as [Alchemy](https://www.alchemy.com/) or [Infura](https://www.infura.io/).

You will also need to provide your L1 contracts addresses:

```
NEXT_PUBLIC_OPTIMISM_PORTAL_ADDRESS="..."
NEXT_PUBLIC_L1_CROSS_DOMAIN_MESSENGER_ADDRESS="..."
```

You will find theses addresses in your rollup deployment artifacts in `contracts-bedrock/deployments/your-deployment/L1Contract.json`.
Note that you always need to provide the proxy address, not the underlying contract.

If you don't want to run the explorer with your local chain setup, you will find all the necessary environment variables commented in `.env.local.example` to configure the explorer with OP Sepolia or OP Mainnet.

If you want to be able to use the Write Contract feature on verified contracts, you will also need to provide a [Reown](https://docs.reown.com/) project ID.

```
NEXT_PUBLIC_REOWN_PROJECT_ID="..."
```

### Indexer Configuration

To run the indexer, you first need to setup your `DATABASE_URL` in `.env.local` as well as websocket connections to your L1/L2 chains (once again you can get them from a 3rd-party provider):

```
DATABASE_URL="file:dev.db"
L1_RPC_WS="wss://eth-mainnet.g.alchemy.com/v2/API_KEY"
L2_RPC_WS="wss://opt-mainnet.g.alchemy.com/v2/API_KEY"
```

Then you can sync your local database with the Prisma schema:

```sh
pnpm prisma:db:push
```

We use [Bun](https://bun.sh/) to run the indexer as a long-running script so make sure it is installed globally on your system.
Now you will be able to start indexing the blockchain by running the `op-indexer` command:

```sh
pnpm op-indexer
```

You should start seeing blocks getting indexed in your terminal and you can explore the state of your local database using Prisma studio:

```sh
pnpm prisma:studio
```

If you need to change the Prisma schema at some point, make sure to regenerate the Prisma client and push to your local database:

```sh
pnpm prisma:generate
pnpm prisma:db:push
```

Indexing a blockchain is putting a heavy load on the RPC as you need to perform a large number of JSON-RPC requests to fully index a block (along with transactions and logs).
When indexing non-local chains you will probably encounter 429 errors related to rate-limiting, you may provide up to 3 fallback RPC URLs in case this happens:

```
NEXT_PUBLIC_L1_FALLBACK1_RPC_URL="https://opt-mainnet.g.alchemy.com/v2/FALLBACK1_API_KEY"
NEXT_PUBLIC_L2_FALLBACK1_RPC_URL="https://opt-mainnet.g.alchemy.com/v2/FALLBACK1_API_KEY"
NEXT_PUBLIC_L1_FALLBACK2_RPC_URL="https://opt-mainnet.g.alchemy.com/v2/FALLBACK2_API_KEY"
NEXT_PUBLIC_L2_FALLBACK2_RPC_URL="https://opt-mainnet.g.alchemy.com/v2/FALLBACK2_API_KEY"
NEXT_PUBLIC_L1_FALLBACK3_RPC_URL="https://opt-mainnet.g.alchemy.com/v2/FALLBACK3_API_KEY"
NEXT_PUBLIC_L2_FALLBACK3_RPC_URL="https://opt-mainnet.g.alchemy.com/v2/FALLBACK3_API_KEY"
```

You can pass several parameters to the indexer to control the indexing range and execution:

- `--l2-from-block` (short `-f`, defaults to latest block) start indexing from this L2 block.
- `--l2-index-block` (short `-b`) index this particular L2 block number.
- `--l1-from-block` (defaults to latest block) start indexing from this L1 block.
- `--l1-index-block` index this particular L1 block number.
- `--index-delay` (short `-d`, defaults to 1000) delay in ms between indexing 2 blocks to avoid overloading the RPC.

Example of running the indexer:

```sh
pnpm op-indexer -f 123416717 --l1-index-block 20426733 --l1-index-block 20426726 -d 500
```

### Running the Explorer

When you're done configuring your environment variables you can build the app:

```sh
pnpm build
```

Make sure your local chain is started and the indexer is running, then launch the explorer to see it live at `http://localhost:3000`

```sh
pnpm start
```

Alternatively you can launch the explorer in dev mode if you want to customize it

```sh
pnpm dev
```