From 5828dc035cd83c94e49e517cc5457d00e8c92057 Mon Sep 17 00:00:00 2001 From: saimeunt Date: Mon, 11 Nov 2024 03:47:22 +0100 Subject: [PATCH 01/53] Add OP Scan Block Explorer --- pages/builders/chain-operators/tools/_meta.json | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/builders/chain-operators/tools/_meta.json b/pages/builders/chain-operators/tools/_meta.json index 990ea87a..36af3373 100644 --- a/pages/builders/chain-operators/tools/_meta.json +++ b/pages/builders/chain-operators/tools/_meta.json @@ -1,6 +1,7 @@ { "chain-monitoring": "Chain monitoring", "explorer": "Block explorer", + "op-scan": "OP Scan Block Explorer", "op-challenger": "op-challenger", "op-conductor": "op-conductor", "op-deployer": "op-deployer", From e33b43575cc6eae5c0621152982217097da6bbbf Mon Sep 17 00:00:00 2001 From: saimeunt Date: Mon, 11 Nov 2024 04:13:02 +0100 Subject: [PATCH 02/53] Add missing files --- .../chain-operators/tools/op-scan.mdx | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 pages/builders/chain-operators/tools/op-scan.mdx diff --git a/pages/builders/chain-operators/tools/op-scan.mdx b/pages/builders/chain-operators/tools/op-scan.mdx new file mode 100644 index 00000000..f41f3245 --- /dev/null +++ b/pages/builders/chain-operators/tools/op-scan.mdx @@ -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. + + + Check out the [OP Scan README](https://github.com/walnuthq/op-scan) for + up-to-date information on how to launch OP Scan. + + +![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 +``` From 51c1e54ca92d4f723c73f34113110c9c981fa8cc Mon Sep 17 00:00:00 2001 From: Zain Bacchus Date: Mon, 11 Nov 2024 16:53:46 +0900 Subject: [PATCH 03/53] Update cross-chain-message.mdx Added context of being able to interop w/itself. eg interop works for uni->opm, opm->uni, but also opm->opm, uni->uni, etc. --- pages/stack/interop/cross-chain-message.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/cross-chain-message.mdx b/pages/stack/interop/cross-chain-message.mdx index 3d7d8d40..596ce514 100644 --- a/pages/stack/interop/cross-chain-message.mdx +++ b/pages/stack/interop/cross-chain-message.mdx @@ -9,7 +9,7 @@ import Image from 'next/image' # Anatomy of a cross-chain message -A cross-chain message applies to any message sent across a chain. This applies to asset transfers using the [SuperchainERC20](superchain-erc20) token standard. +A cross-chain message applies to any message sent using Superchain interop - this includes sending across chains within an interop cluster but also chains interopping with itself. This functionality applies to asset transfers using the [SuperchainERC20](superchain-erc20) token standard. ## How it works From 8b29d73239d440c4a0034499cc2a076e1fb9b1ca Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Mon, 11 Nov 2024 12:20:05 +0100 Subject: [PATCH 04/53] fix lint warning --- words.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/words.txt b/words.txt index f5ae76fb..4fdf79dc 100644 --- a/words.txt +++ b/words.txt @@ -158,6 +158,7 @@ INFLUXDBV influxdbv initcode interchain +interopping IPCDISABLE ipcdisable ipcfile From eb24a1c1b961a228558b6c8c513ef64336318773 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Mon, 11 Nov 2024 12:23:27 +0100 Subject: [PATCH 05/53] remove word --- words.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/words.txt b/words.txt index 4fdf79dc..f5ae76fb 100644 --- a/words.txt +++ b/words.txt @@ -158,7 +158,6 @@ INFLUXDBV influxdbv initcode interchain -interopping IPCDISABLE ipcdisable ipcfile From 766a836f4140d83737f59a13f42a407afbb4e1ba Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Mon, 11 Nov 2024 12:22:52 +0100 Subject: [PATCH 06/53] Update pages/stack/interop/cross-chain-message.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pages/stack/interop/cross-chain-message.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/cross-chain-message.mdx b/pages/stack/interop/cross-chain-message.mdx index 596ce514..3352c5b1 100644 --- a/pages/stack/interop/cross-chain-message.mdx +++ b/pages/stack/interop/cross-chain-message.mdx @@ -9,7 +9,7 @@ import Image from 'next/image' # Anatomy of a cross-chain message -A cross-chain message applies to any message sent using Superchain interop - this includes sending across chains within an interop cluster but also chains interopping with itself. This functionality applies to asset transfers using the [SuperchainERC20](superchain-erc20) token standard. +A cross-chain message applies to any message sent using Superchain interop - this includes sending across chains within an interop cluster, but also chains interoperating with themselves. This functionality applies to asset transfers using the [SuperchainERC20](superchain-erc20) token standard. ## How it works From f6a249a93272900c2ec94bc17b294e4fd29b1e8e Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Mon, 11 Nov 2024 12:32:10 +0100 Subject: [PATCH 07/53] updated text --- pages/stack/interop/cross-chain-message.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/cross-chain-message.mdx b/pages/stack/interop/cross-chain-message.mdx index 3352c5b1..708d23cd 100644 --- a/pages/stack/interop/cross-chain-message.mdx +++ b/pages/stack/interop/cross-chain-message.mdx @@ -9,7 +9,7 @@ import Image from 'next/image' # Anatomy of a cross-chain message -A cross-chain message applies to any message sent using Superchain interop - this includes sending across chains within an interop cluster, but also chains interoperating with themselves. This functionality applies to asset transfers using the [SuperchainERC20](superchain-erc20) token standard. +A cross-chain message refers to any communication sent using Superchain interop. This includes messages sent between different chains within an interop cluster, as well as messages sent on a single chain for interoperable functionality. This capability enables asset transfers that utilize the [SuperchainERC20](superchain-erc20) token standard. ## How it works From 8fff156bdda7003f8072b9e41cd72e398a58d375 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Mon, 11 Nov 2024 12:33:20 +0100 Subject: [PATCH 08/53] improved word --- pages/stack/interop/cross-chain-message.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/cross-chain-message.mdx b/pages/stack/interop/cross-chain-message.mdx index 708d23cd..bd201b6e 100644 --- a/pages/stack/interop/cross-chain-message.mdx +++ b/pages/stack/interop/cross-chain-message.mdx @@ -9,7 +9,7 @@ import Image from 'next/image' # Anatomy of a cross-chain message -A cross-chain message refers to any communication sent using Superchain interop. This includes messages sent between different chains within an interop cluster, as well as messages sent on a single chain for interoperable functionality. This capability enables asset transfers that utilize the [SuperchainERC20](superchain-erc20) token standard. +A cross-chain message refers to any communication sent using Superchain interop. This includes messages sent between different chains within an interop cluster, as well as messages sent on a single chain for interoperable. This functionality enables asset transfers that utilize the [SuperchainERC20](superchain-erc20) token standard. ## How it works From 24ecff7de869b4291c8a62b9e2022119a14de7ef Mon Sep 17 00:00:00 2001 From: Noisy <125606576+donatik27@users.noreply.github.com> Date: Sun, 10 Nov 2024 12:55:22 +0100 Subject: [PATCH 09/53] Improve Grammar and Consistency in Glossary Term Template Short Description of Changes: - Corrected grammatical errors in descriptions. - Fixed spelling of "copyrighted". - Corrected possessive form from "someones" to "someone's". --- .github/ISSUE_TEMPLATE/suggest_glossary_term.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/suggest_glossary_term.yaml b/.github/ISSUE_TEMPLATE/suggest_glossary_term.yaml index 0302b4e1..b08efa08 100644 --- a/.github/ISSUE_TEMPLATE/suggest_glossary_term.yaml +++ b/.github/ISSUE_TEMPLATE/suggest_glossary_term.yaml @@ -18,7 +18,7 @@ body: options: - label: This is a term not already found in the glossary (for similar terms, please consider the benefits of a new term vs updating an existing term) required: true - - label: This term/definition is not a product advertisement or contain other promotional content + - label: This term/definition is not a product advertisement and does not contain other promotional content required: true - label: This term/definition is directly relevant to Optimism required: true @@ -39,7 +39,7 @@ body: - type: textarea id: glossary_term_sources attributes: - label: Sources, if any (please do not submit copywrited content without appropriate approval) + label: Sources, if any (please do not submit copyrighted content without appropriate approval) description: Please list any sources utilized validations: required: false @@ -47,7 +47,7 @@ body: id: glossary_terms_optimismdotio_links attributes: label: Optimism.io links - description: If appropriate/available, please suggest an internal optimism.io link that would expand someones learning of this term + description: If appropriate/available, please suggest an internal optimism.io link that would expand someone's learning of this term - type: textarea id: glossary_term_additional_context attributes: From d12e0c8f4c7369b454f0c3097f90e0e43807859a Mon Sep 17 00:00:00 2001 From: Noisy <125606576+donatik27@users.noreply.github.com> Date: Sun, 10 Nov 2024 13:01:22 +0100 Subject: [PATCH 10/53] Update suggest_tutorial.yaml --- .github/ISSUE_TEMPLATE/suggest_tutorial.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/suggest_tutorial.yaml b/.github/ISSUE_TEMPLATE/suggest_tutorial.yaml index f8259e87..890af9b7 100644 --- a/.github/ISSUE_TEMPLATE/suggest_tutorial.yaml +++ b/.github/ISSUE_TEMPLATE/suggest_tutorial.yaml @@ -22,7 +22,7 @@ body: id: tutorial_description attributes: label: Tutorial description - description: Summarize what the user should be able to accomplish by following tutorial + description: Summarize what the user should be able to accomplish by following the tutorial validations: required: true - type: input From 95f0401ea8f71ec1304c41fe880cbb8675293a05 Mon Sep 17 00:00:00 2001 From: Anonim Date: Sat, 9 Nov 2024 13:16:14 +0300 Subject: [PATCH 11/53] Updated docs files with errors --- pages/chain/security/security-policy.mdx | 2 +- pages/connect/contribute/style-guide.mdx | 8 ++++---- pages/connect/resources/glossary.mdx | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/chain/security/security-policy.mdx b/pages/chain/security/security-policy.mdx index 85a776ff..661a510a 100644 --- a/pages/chain/security/security-policy.mdx +++ b/pages/chain/security/security-policy.mdx @@ -53,4 +53,4 @@ Alongside this policy, maintainers also reserve the right to: * Bypass this policy and publish details on a shorter timeline. * Directly notify a subset of downstream users prior to making a public announcement. -This policy is based the [Geth](https://geth.ethereum.org/) team's [silent patch policy](https://geth.ethereum.org/docs/developers/geth-developer/disclosures#why-silent-patches). +This policy is based on the [Geth](https://geth.ethereum.org/) team's [silent patch policy](https://geth.ethereum.org/docs/developers/geth-developer/disclosures#why-silent-patches). diff --git a/pages/connect/contribute/style-guide.mdx b/pages/connect/contribute/style-guide.mdx index dbca6be1..2149e5ad 100644 --- a/pages/connect/contribute/style-guide.mdx +++ b/pages/connect/contribute/style-guide.mdx @@ -10,7 +10,7 @@ import { Callout } from 'nextra/components' This Style Guide aims to assist Optimists in writing technical content with a consistent voice, tone, and style. See the [glossary](/connect/resources/glossary) for an alphabetical listing of commonly used words, terms, and concepts used throughout the technical docs and across the OP Collective. -This doc doesn't cover all questions or use-cases. Our guide is based off the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/). Please reference their guide for any use-case or situation we do not cover here. +This doc doesn't cover all questions or use-cases. Our guide is based on the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/). Please reference their guide for any use-case or situation we do not cover here. * For docs-related questions or comments, create an issue in the [docs repo](https://github.com/ethereum-optimism/docs/issues). * For support-related questions or comments, create an issue in the [developers repo](https://github.com/ethereum-optimism/developers/issues). @@ -178,7 +178,7 @@ We aim to use consistent organization that is also user-centered and accessible. ### Listing prerequisites (before you begin) * Add a "Before You Begin" section at the top of the document if there are tasks a user needs to complete before continuing with the current task, e.g. installing a module, downloading a software update, etc. -* Use the title "Before You Begin"and format as H2. It should follow the page overview/intro section or table of contents. +* Use the title "Before You Begin" and format as H2. It should follow the page overview/intro section or table of contents. * Include all the tasks the user needs to complete, including links to aid in usability. Use a bulleted list for more than 2 prerequisite items. **Example**:
@@ -501,7 +501,7 @@ Please use `*` instead of `-` for items in a list. This maintains consistency ac ### Punctuation -* **Ampersand (&)** Only use "&"in headings where items are grouped or in proper names. Do not use in sentences. +* **Ampersand (&)** Only use "&" in headings where items are grouped or in proper names. Do not use in sentences. * **Colon (:)** Use to introduce a list or series. @@ -523,4 +523,4 @@ Please use `*` instead of `-` for items in a list. This maintains consistency ac **Example**: `developer-focused product` or `company-wide holiday` -* **Slash (/)** Avoid using as the slash is reserved for file names (see above). Use "or," "and,"or "or both"instead. +* **Slash (/)** Avoid using as the slash is reserved for file names (see above). Use "or," "and," or "both" instead. diff --git a/pages/connect/resources/glossary.mdx b/pages/connect/resources/glossary.mdx index 9261933f..e1c41105 100644 --- a/pages/connect/resources/glossary.mdx +++ b/pages/connect/resources/glossary.mdx @@ -33,7 +33,7 @@ block, and output block properties, which are derived after executing the block' #### Block time L2 block time is 2 seconds, meaning there is an L2 block at every 2s [time slot](#time-slot). -*Post-merge*, it could be said the that L1 block time is 12s as that is the L1 [time slot](#time-slot). However, in +*Post-merge*, it could be said that L1 block time is 12s as that is the L1 [time slot](#time-slot). However, in reality the block time is variable as some time slots might be skipped. Pre-merge, the L1 block time is variable, though it is on average 13s. #### Delegation @@ -335,7 +335,7 @@ a better compression rate, hence reducing data availability costs. #### Channel Frame Chunk of data belonging to a [channel](#channel). [Batcher transactions](#batcher-transaction) carry one or -multiple frames. The reason to split a channel into frames is that a channel might too large to include in a single +multiple frames. The reason to split a channel into frames is that a channel might be too large to include in a single batcher transaction. #### Channel Timeout From 562b2576691a8414d0e7163345861598a29dd889 Mon Sep 17 00:00:00 2001 From: Dmitry <98899785+mdqst@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:17:20 +0300 Subject: [PATCH 12/53] Typo Update CONTRIBUTING.md The missing space between the quotation marks and the word "button". --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 26bf5626..b7e4cd15 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,7 +73,7 @@ To submit your contribution for review: 1. Create a new [pull request on GitHub](https://github.com/ethereum-optimism/docs/issues/new/choose). 2. Select a PR type from the list or choose **Open a blank issue** at the bottom of the page. 3. Complete the form as requested. For blank PR issues, please provide a clear title and accurate description/context. -4. Click the "Create pull request"button to create the pull request effectively. +4. Click the "Create pull request" button to create the pull request effectively. >If your pull request is not ready for review yet, choose the "[Create draft pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)"in the dropdown. The Optimism documentation team will review your pull request only when you mark it as "[Ready for review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request)". From f46ab56e5e400fc900aefc58914be20755924367 Mon Sep 17 00:00:00 2001 From: Zain Bacchus Date: Wed, 13 Nov 2024 14:56:34 +0700 Subject: [PATCH 13/53] Clean up explainer Add context of mesh cluster --- pages/stack/interop/explainer.mdx | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/pages/stack/interop/explainer.mdx b/pages/stack/interop/explainer.mdx index 09611d7e..c83be6aa 100644 --- a/pages/stack/interop/explainer.mdx +++ b/pages/stack/interop/explainer.mdx @@ -14,12 +14,11 @@ import { InteropCallout } from '@/components/WipCallout' # Interoperability explainer Interoperability is the ability for a blockchain to securely read the state of another blockchain. -Native OP Stack interoperability provides the ability to read messages and transfer assets across the Superchain (without having to go through L1) via secure message passing. This results in the following benefits: -* fungible and portable assets and liquidity -* lower fees and lower latency -* less fragmentation across the Superchain +Native OP Stack interoperability provides the ability to read messages and transfer assets across the Superchain (without having to go through L1) via low-latency, secure message passing. This results in the following benefits: +* 1-block latency asset movement movement that is both maximally capital efficient and non-fragmenting * improved user experience for developers on the Superchain * secure transfer of ETH and ERC-20s across L2s +* horizontally scalable applications ## Secure message passing Superchain interop includes both the protocol layer message passing and the Superchain ERC20 token specification. @@ -30,15 +29,18 @@ Superchain interop includes both the protocol layer message passing and the Supe This means ETH and ERC-20s can seamlessly and securely move across L2s, and intent-based protocols (i.e., bridges) can build better experiences on top of the message passing protocol. ## Low latency -Interoperability allows for horizontally scalable blockchains, a key feature of the Superchain. With Superchain interop, latency can be low (~2 seconds) by optimistically accepting cross-chain messages. -The fork choice rule enforces eventual consistency, meaning that if an invalid cross-chain message is accepted, it will be reorganized out eventually. -The fault proof guarantees that all of the cross-chain messages are accounted for from the perspective of handling withdrawals through the bridge to L1. +Interoperability allows for horizontally scalable blockchains, a key feature of the Superchain. With Superchain interop, latency can be 1-block (~2 seconds) by optimistically accepting cross-chain messages. -## Permissionless chain set -It is permissionless to define a dependency on a chain, so chain operators will be able to choose which chains their chains depend on, and it is not a requirement that chains are in each other's dependency set. -Chain operators can add or remove chains from the dependency set through the `SystemConfig`. For example, the dependency set for OP Mainnet is managed by Optimism Governance. +## Permisonless dependency set +The interop protocol works via a dependency set which is configured on a per chain basis and is a unidirectional relationship that defines the set of chains that a chain will accept incoming messages from. + +This gives the OP Stack an unopinionated and flexible foundation so chain operators are able to choose which chains their chains depend on, and it is not a requirement that chains are in each other's dependency set. + +## Superchain interop cluster +The Superchain builds ontop of the interop protocol and implements a single mesh network with complete dependencies. In this model, each blockchain in the Superchain interop cluster would have direct connections to every other blockchain, creating a fully connected mesh network. This provides the highest level of interoperability, as any blockchain can transact directly with any other. + +Each blockchain that is part of the Superchain interop cluster will have the same security model to mitigate the weakest-link scenario and will be managed by Optimism Governance. -However, since the nature of defining a dependency is one way, it is impossible for a chain to know of all of the other chains that depend on it. ## New predeploys @@ -108,6 +110,9 @@ See this [dune dashboard](https://dune.com/oplabspbc/op-stack-chains-l1-activity ### What is stopping a sequencer from censoring a cross-chain message? There is nothing stopping a sequencer from censoring a transaction when it is sent directly to the sequencer. This does not mean the network has no censorship resistance, users can always send a deposit transaction for censorship resistance as strong as L1 guarantees. The tradeoff here is the latency, instead of being confirmed in ~2 seconds, the transaction can be confirmed at the rate of L1 block production. It may be possible to adopt something like [EIP-7547](https://eips.ethereum.org/EIPS/eip-7547) in the future to enable low latency censorship resistance. +### What is the weakest link scenario? +Without shared security the concern is that interoperating chains both change their state due to some cross-chain interaction, but a weak chain is attacked / reorged, and that would leave the interop cluster in a conflicting state. This means the security around interactions between two or more chains is as weak as the weakest chain. + ### Are callback style transactions possible? If two blocks are being built at the same time with shared knowledge of their contents, it is possible to build blocks where a transaction calls to another chain, does compute and then a transaction calls back with the results. This requires no protocol level changes, it just requires more sophisticated block builder infrastructure. @@ -121,3 +126,4 @@ Sequencers only have to trust each other, if they are accepting executing messag Chains that have non-fungible blockspace are chains that have different features - it could be that they use Plasma for data availability, a custom gas paying token or have a large execution gas limit. As long as the chain can be fault proven, it can work with Superchain interoperability. At the application layer, it is important for chains to have legibility into the type of chain that the message originated from. This ensures that applications do not accept messages from chains they consider not secure enough. See this [discussion](https://github.com/ethereum-optimism/specs/issues/121) for additional thoughts. When it comes to chains that have different gas limits that are interoperable, it creates a set of transactions that can execute on one chain but not the other. This happens when the transaction consumes more than the gas limit of the smaller chain but less than of the bigger chain. At 2024 usages levels, these sorts of transactions are very rare. In the future, it may be the case that these transactions become more common, it will be up to the chain operators to ensure quality of service for their users. + From 1baceef9ab55b33731704d1aef0c1ae77026ea3b Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 13 Nov 2024 09:09:38 +0100 Subject: [PATCH 14/53] remove duplicate Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pages/stack/interop/explainer.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/explainer.mdx b/pages/stack/interop/explainer.mdx index c83be6aa..1bd8b598 100644 --- a/pages/stack/interop/explainer.mdx +++ b/pages/stack/interop/explainer.mdx @@ -15,7 +15,7 @@ import { InteropCallout } from '@/components/WipCallout' Interoperability is the ability for a blockchain to securely read the state of another blockchain. Native OP Stack interoperability provides the ability to read messages and transfer assets across the Superchain (without having to go through L1) via low-latency, secure message passing. This results in the following benefits: -* 1-block latency asset movement movement that is both maximally capital efficient and non-fragmenting +* 1-block latency asset movement that is both maximally capital efficient and non-fragmenting * improved user experience for developers on the Superchain * secure transfer of ETH and ERC-20s across L2s * horizontally scalable applications From 9b2d714b547ba08077c678d874121fec7e6de1e5 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 13 Nov 2024 09:10:01 +0100 Subject: [PATCH 15/53] correct spelling Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pages/stack/interop/explainer.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/explainer.mdx b/pages/stack/interop/explainer.mdx index 1bd8b598..22a52303 100644 --- a/pages/stack/interop/explainer.mdx +++ b/pages/stack/interop/explainer.mdx @@ -31,7 +31,7 @@ This means ETH and ERC-20s can seamlessly and securely move across L2s, and inte ## Low latency Interoperability allows for horizontally scalable blockchains, a key feature of the Superchain. With Superchain interop, latency can be 1-block (~2 seconds) by optimistically accepting cross-chain messages. -## Permisonless dependency set +## Permissionless dependency set The interop protocol works via a dependency set which is configured on a per chain basis and is a unidirectional relationship that defines the set of chains that a chain will accept incoming messages from. This gives the OP Stack an unopinionated and flexible foundation so chain operators are able to choose which chains their chains depend on, and it is not a requirement that chains are in each other's dependency set. From eadccee9d7c23e9869690369810684ad07400cfb Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 13 Nov 2024 09:10:55 +0100 Subject: [PATCH 16/53] fix spacing Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pages/stack/interop/explainer.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/explainer.mdx b/pages/stack/interop/explainer.mdx index 22a52303..38e1aec5 100644 --- a/pages/stack/interop/explainer.mdx +++ b/pages/stack/interop/explainer.mdx @@ -37,7 +37,7 @@ The interop protocol works via a dependency set which is configured on a per cha This gives the OP Stack an unopinionated and flexible foundation so chain operators are able to choose which chains their chains depend on, and it is not a requirement that chains are in each other's dependency set. ## Superchain interop cluster -The Superchain builds ontop of the interop protocol and implements a single mesh network with complete dependencies. In this model, each blockchain in the Superchain interop cluster would have direct connections to every other blockchain, creating a fully connected mesh network. This provides the highest level of interoperability, as any blockchain can transact directly with any other. +The Superchain builds on top of the interop protocol and implements a single mesh network with complete dependencies. In this model, each blockchain in the Superchain interop cluster would have direct connections to every other blockchain, creating a fully connected mesh network. This provides the highest level of interoperability, as any blockchain can transact directly with any other. Each blockchain that is part of the Superchain interop cluster will have the same security model to mitigate the weakest-link scenario and will be managed by Optimism Governance. From 8942e002f753229e3bff489be07c366f0195207c Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 13 Nov 2024 09:11:54 +0100 Subject: [PATCH 17/53] improve text Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pages/stack/interop/explainer.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/stack/interop/explainer.mdx b/pages/stack/interop/explainer.mdx index 38e1aec5..4d024f1b 100644 --- a/pages/stack/interop/explainer.mdx +++ b/pages/stack/interop/explainer.mdx @@ -32,9 +32,9 @@ This means ETH and ERC-20s can seamlessly and securely move across L2s, and inte Interoperability allows for horizontally scalable blockchains, a key feature of the Superchain. With Superchain interop, latency can be 1-block (~2 seconds) by optimistically accepting cross-chain messages. ## Permissionless dependency set -The interop protocol works via a dependency set which is configured on a per chain basis and is a unidirectional relationship that defines the set of chains that a chain will accept incoming messages from. +The interop protocol works via a dependency set which is configured on a per-chain basis and is a unidirectional relationship that defines the set of chains that a chain will accept incoming messages from. -This gives the OP Stack an unopinionated and flexible foundation so chain operators are able to choose which chains their chains depend on, and it is not a requirement that chains are in each other's dependency set. +This gives the OP Stack an unopinionated and flexible foundation, so chain operators can choose which chains their chains depend on, and it is not a requirement that chains are in each other's dependency set. ## Superchain interop cluster The Superchain builds on top of the interop protocol and implements a single mesh network with complete dependencies. In this model, each blockchain in the Superchain interop cluster would have direct connections to every other blockchain, creating a fully connected mesh network. This provides the highest level of interoperability, as any blockchain can transact directly with any other. From 014db79cb8e72df0c6695d3c00819c46a31b5d29 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 13 Nov 2024 09:12:35 +0100 Subject: [PATCH 18/53] improve text --- pages/stack/interop/explainer.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/explainer.mdx b/pages/stack/interop/explainer.mdx index 4d024f1b..b9670c87 100644 --- a/pages/stack/interop/explainer.mdx +++ b/pages/stack/interop/explainer.mdx @@ -32,7 +32,7 @@ This means ETH and ERC-20s can seamlessly and securely move across L2s, and inte Interoperability allows for horizontally scalable blockchains, a key feature of the Superchain. With Superchain interop, latency can be 1-block (~2 seconds) by optimistically accepting cross-chain messages. ## Permissionless dependency set -The interop protocol works via a dependency set which is configured on a per-chain basis and is a unidirectional relationship that defines the set of chains that a chain will accept incoming messages from. +The interop protocol works via a dependency set which is configured on a per chain basis and is a unidirectional relationship that defines the set of chains that a chain will accept incoming messages from. This gives the OP Stack an unopinionated and flexible foundation, so chain operators can choose which chains their chains depend on, and it is not a requirement that chains are in each other's dependency set. From f15d94a8e9f889324cedd8633eb00812754c604a Mon Sep 17 00:00:00 2001 From: Zain Bacchus Date: Wed, 13 Nov 2024 15:20:31 +0700 Subject: [PATCH 19/53] Update explainer.mdx --- pages/stack/interop/explainer.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/explainer.mdx b/pages/stack/interop/explainer.mdx index b9670c87..e2972f0e 100644 --- a/pages/stack/interop/explainer.mdx +++ b/pages/stack/interop/explainer.mdx @@ -37,7 +37,7 @@ The interop protocol works via a dependency set which is configured on a per cha This gives the OP Stack an unopinionated and flexible foundation, so chain operators can choose which chains their chains depend on, and it is not a requirement that chains are in each other's dependency set. ## Superchain interop cluster -The Superchain builds on top of the interop protocol and implements a single mesh network with complete dependencies. In this model, each blockchain in the Superchain interop cluster would have direct connections to every other blockchain, creating a fully connected mesh network. This provides the highest level of interoperability, as any blockchain can transact directly with any other. +The Superchain builds on top of the interop protocol and implements a single mesh network with complete dependencies. In this model, each blockchain in the Superchain interop cluster would have direct connections to every other blockchain, creating a fully connected mesh network. Compared to a hub and spoke model, this provides the highest level of interoperability, as any blockchain can transact directly with any other. Each blockchain that is part of the Superchain interop cluster will have the same security model to mitigate the weakest-link scenario and will be managed by Optimism Governance. From 67165118ec4a58e34be67fc6badc2f40f13667c7 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 13 Nov 2024 10:05:54 +0100 Subject: [PATCH 20/53] reworded for clarity --- pages/stack/interop/explainer.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/explainer.mdx b/pages/stack/interop/explainer.mdx index e2972f0e..26bec6db 100644 --- a/pages/stack/interop/explainer.mdx +++ b/pages/stack/interop/explainer.mdx @@ -111,7 +111,7 @@ See this [dune dashboard](https://dune.com/oplabspbc/op-stack-chains-l1-activity There is nothing stopping a sequencer from censoring a transaction when it is sent directly to the sequencer. This does not mean the network has no censorship resistance, users can always send a deposit transaction for censorship resistance as strong as L1 guarantees. The tradeoff here is the latency, instead of being confirmed in ~2 seconds, the transaction can be confirmed at the rate of L1 block production. It may be possible to adopt something like [EIP-7547](https://eips.ethereum.org/EIPS/eip-7547) in the future to enable low latency censorship resistance. ### What is the weakest link scenario? -Without shared security the concern is that interoperating chains both change their state due to some cross-chain interaction, but a weak chain is attacked / reorged, and that would leave the interop cluster in a conflicting state. This means the security around interactions between two or more chains is as weak as the weakest chain. +Without shared security, there’s a risk that interacting chains could enter a conflicting state due to cross-chain interactions. If a weaker chain in the network is attacked or experiences a reorganization, it could change its state independently. This would leave the entire interop cluster in an inconsistent state, as the security of interactions across chains is only as strong as the weakest chain. ### Are callback style transactions possible? If two blocks are being built at the same time with shared knowledge of their contents, it is possible to build blocks where a transaction calls to another chain, does compute and then a transaction calls back with the results. This requires no protocol level changes, it just requires more sophisticated block builder infrastructure. From 65ab7a4903802266e3c9dca4f2e8d30b09fe9526 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 13 Nov 2024 10:28:19 +0100 Subject: [PATCH 21/53] improve text --- pages/stack/interop/explainer.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/explainer.mdx b/pages/stack/interop/explainer.mdx index 26bec6db..b52b2880 100644 --- a/pages/stack/interop/explainer.mdx +++ b/pages/stack/interop/explainer.mdx @@ -111,7 +111,7 @@ See this [dune dashboard](https://dune.com/oplabspbc/op-stack-chains-l1-activity There is nothing stopping a sequencer from censoring a transaction when it is sent directly to the sequencer. This does not mean the network has no censorship resistance, users can always send a deposit transaction for censorship resistance as strong as L1 guarantees. The tradeoff here is the latency, instead of being confirmed in ~2 seconds, the transaction can be confirmed at the rate of L1 block production. It may be possible to adopt something like [EIP-7547](https://eips.ethereum.org/EIPS/eip-7547) in the future to enable low latency censorship resistance. ### What is the weakest link scenario? -Without shared security, there’s a risk that interacting chains could enter a conflicting state due to cross-chain interactions. If a weaker chain in the network is attacked or experiences a reorganization, it could change its state independently. This would leave the entire interop cluster in an inconsistent state, as the security of interactions across chains is only as strong as the weakest chain. +Without shared security, there is a risk that interacting chains could enter a conflicting state due to cross-chain interactions. If a weaker chain in the network is attacked or experiences a reorganization, it could change its state independently. This would leave the entire interop cluster in an inconsistent state, as the security of interactions across chains is only as strong as the weakest chain. ### Are callback style transactions possible? If two blocks are being built at the same time with shared knowledge of their contents, it is possible to build blocks where a transaction calls to another chain, does compute and then a transaction calls back with the results. This requires no protocol level changes, it just requires more sophisticated block builder infrastructure. From 6b1156578c986ce21920fa4b1893cf6b8aeff268 Mon Sep 17 00:00:00 2001 From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com> Date: Wed, 13 Nov 2024 09:47:10 -0800 Subject: [PATCH 22/53] Update home page capitalization Transition from title case to sentence case --- pages/index.mdx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pages/index.mdx b/pages/index.mdx index 3ad6a648..15d4aebd 100644 --- a/pages/index.mdx +++ b/pages/index.mdx @@ -11,41 +11,41 @@ import { Cards, Card } from 'nextra/components' Welcome to the Optimism Docs, the unified home of the [Optimism Collective's](/connect/resources/glossary#optimism-collective) technical documentation and information about the [OP Stack](/stack/getting-started). Information about the Optimism Collective's governance, community, and mission can be found on the [Optimism Community Hub](https://community.optimism.io/docs/governance/). -## Guides for Builders +## Guides for builders Whether you're a developer building a app on OP Mainnet, a node operator running an OP Mainnet node, or a chain operator launching your own OP Stack chain, you'll find everything you need to get started right here. - } /> + } /> - } /> + } /> - } /> + } /> } /> - } /> + } /> -## Featured Tools +## Featured tools Check out these amazing tools, so you can get building with Optimism. - } /> + } /> } /> } /> - } /> + } /> - } /> + } /> -## Learn About Optimism +## Learn about Optimism OP Mainnet is an [EVM equivalent](https://web.archive.org/web/20231127160757/https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306) Layer 2 blockchain connected to Ethereum. The OP Stack is the standardized, shared, and open-source development stack that makes it easy to spin up your own production-ready Layer 2 blockchain just like OP Mainnet. From 08a1af917fc2d6b2d301da070943070d19a3022c Mon Sep 17 00:00:00 2001 From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:07:58 -0800 Subject: [PATCH 23/53] Fix breadcrumb and title casing --- pages/builders/node-operators.mdx | 2 +- pages/builders/node-operators/releases.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/builders/node-operators.mdx b/pages/builders/node-operators.mdx index 9d25972c..537743b2 100644 --- a/pages/builders/node-operators.mdx +++ b/pages/builders/node-operators.mdx @@ -21,7 +21,7 @@ Documentation covering Architecture, Configuration, Json Rpc, Management, Networ - + diff --git a/pages/builders/node-operators/releases.mdx b/pages/builders/node-operators/releases.mdx index 08a2e40d..4c7ad18c 100644 --- a/pages/builders/node-operators/releases.mdx +++ b/pages/builders/node-operators/releases.mdx @@ -1,5 +1,5 @@ --- -title: Node Software Releases +title: Node software releases lang: en-US description: Off chain node software release information and how to stay up to date. --- From 817214051677e57d56bcea61d8e4f933bb68cf99 Mon Sep 17 00:00:00 2001 From: Voronor <129545215+voronor@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:39:46 +0100 Subject: [PATCH 24/53] Typo Update content-reuse.md There is a small typo in the heading for the "How to Use a Single Reusable Content Components" section. The word "Components" should be singular, as the section is referring to a single component. --- notes/content-reuse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes/content-reuse.md b/notes/content-reuse.md index d11dcbfd..7bc43516 100644 --- a/notes/content-reuse.md +++ b/notes/content-reuse.md @@ -10,7 +10,7 @@ The content directory contains markdown files that can be imported across the ne Create a `.md` file in the `/content` directory. -### How to Use a Single Reusable Content Components +### How to Use a Single Reusable Content Component 1. Import it at the top of `.mdx` file: From dbb9429f17af997375933a7ee750da5bb8f7eb81 Mon Sep 17 00:00:00 2001 From: krofax Date: Thu, 14 Nov 2024 14:56:51 +0100 Subject: [PATCH 25/53] Added starter kit --- pages/stack/interop/assets/superchain-erc20.mdx | 1 + words.txt | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/pages/stack/interop/assets/superchain-erc20.mdx b/pages/stack/interop/assets/superchain-erc20.mdx index c9fb9006..fab6af88 100644 --- a/pages/stack/interop/assets/superchain-erc20.mdx +++ b/pages/stack/interop/assets/superchain-erc20.mdx @@ -90,5 +90,6 @@ For step-by-step information on implementing SuperchainERC20, see [Deploy assets ## Next steps * Explore the [SuperchainERC20 specifications](https://specs.optimism.io/interop/token-bridging.html) for in-depth implementation details. +* Check out the [Superchain ERC20 starter kit](https://github.com/ethereum-optimism/superchainerc20-starter) to get started with implementation. * Watch the [Superchain interop design video walkthrough](https://www.youtube.com/watch?v=FKc5RgjtGes) for a visual explanation of the concepts. * Review the [Superchain Interop Explainer](explainer) for answers to common questions about interoperability. diff --git a/words.txt b/words.txt index f5ae76fb..0efd003b 100644 --- a/words.txt +++ b/words.txt @@ -10,7 +10,6 @@ Allnodes Allocs allocs ANDI -Ankr Apeworx Arweave authrpc @@ -150,7 +149,6 @@ holesky IERC IGNOREPRICE ignoreprice -Immunefi implicity Inator inator @@ -200,7 +198,6 @@ minsuggestedpriorityfee Mintable Mintplex MIPSEVM -Mitigations Monitorism Moralis Mordor @@ -295,8 +292,6 @@ Proxied Proxyd proxyd pseudorandomly -Pyth -Pyth's QRNG Quicknode quicknode @@ -331,9 +326,6 @@ safedb Schnorr secp SELFDESTRUCT -SEPOLIA -Sepolia -sepolia seqnr SEQUENCERHTTP sequencerhttp @@ -404,7 +396,6 @@ VMDEBUG vmdebug VMODULE vmodule -voxel Warpcast xlarge XORI From 654f104d8f66c64986ec9a017767aa7fada581df Mon Sep 17 00:00:00 2001 From: krofax Date: Thu, 14 Nov 2024 15:00:07 +0100 Subject: [PATCH 26/53] fix lint error --- words.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/words.txt b/words.txt index 0efd003b..f5ae76fb 100644 --- a/words.txt +++ b/words.txt @@ -10,6 +10,7 @@ Allnodes Allocs allocs ANDI +Ankr Apeworx Arweave authrpc @@ -149,6 +150,7 @@ holesky IERC IGNOREPRICE ignoreprice +Immunefi implicity Inator inator @@ -198,6 +200,7 @@ minsuggestedpriorityfee Mintable Mintplex MIPSEVM +Mitigations Monitorism Moralis Mordor @@ -292,6 +295,8 @@ Proxied Proxyd proxyd pseudorandomly +Pyth +Pyth's QRNG Quicknode quicknode @@ -326,6 +331,9 @@ safedb Schnorr secp SELFDESTRUCT +SEPOLIA +Sepolia +sepolia seqnr SEQUENCERHTTP sequencerhttp @@ -396,6 +404,7 @@ VMDEBUG vmdebug VMODULE vmodule +voxel Warpcast xlarge XORI From f2586187bf4872fc27ca78d8d714bfb7806add65 Mon Sep 17 00:00:00 2001 From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:27:18 -0800 Subject: [PATCH 27/53] Collapsing walkthrough section and disabling changed file summary --- .coderabbit.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 4bb0d0a9..a313f94d 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -4,7 +4,8 @@ reviews: high_level_summary: false poem: false review_status: false - collapse_walkthrough: false + collapse_walkthrough: true + changed_files_summary: false path_instructions: - path: "**/*.mdx" instructions: | From 44e1963572dfe162e5ef79db542accbb0e64fc97 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Tue, 12 Nov 2024 15:49:44 +0100 Subject: [PATCH 28/53] replace the SDK link with viem --- .../app-developers/bridging/basics.mdx | 4 ++-- .../bridging/standard-bridge.mdx | 4 ++-- pages/builders/app-developers/overview.mdx | 22 +++++++++---------- pages/builders/app-developers/tutorials.mdx | 6 ++--- .../app-developers/tutorials/_meta.json | 4 ++-- .../standard-bridge-custom-token.mdx | 2 +- .../standard-bridge-standard-token.mdx | 2 +- pages/builders/chain-operators/tutorials.mdx | 4 ++-- pages/builders/tools/overview.mdx | 2 +- pages/connect/contribute/style-guide.mdx | 22 +++++++++---------- 10 files changed, 36 insertions(+), 36 deletions(-) diff --git a/pages/builders/app-developers/bridging/basics.mdx b/pages/builders/app-developers/bridging/basics.mdx index 0af64117..f2085f5f 100644 --- a/pages/builders/app-developers/bridging/basics.mdx +++ b/pages/builders/app-developers/bridging/basics.mdx @@ -28,7 +28,7 @@ All of this is easily accessible with a simple, clean API. Ready to start bridging? Check out these tutorials to get up to speed fast. -* [Learn how to bridge ERC-20 tokens with the Optimism SDK](/builders/app-developers/tutorials/cross-dom-bridge-erc20) -* [Learn how to bridge ETH with the Optimism SDK](/builders/app-developers/tutorials/cross-dom-bridge-eth) +* [Learn how to bridge ERC-20 tokens with viem](/builders/app-developers/tutorials/cross-dom-bridge-erc20) +* [Learn how to bridge ETH with viem](/builders/app-developers/tutorials/cross-dom-bridge-eth) * [Learn how to create a standard bridged token](/builders/app-developers/tutorials/standard-bridge-standard-token) * [Learn how to create a custom bridged token](/builders/app-developers/tutorials/standard-bridge-custom-token) diff --git a/pages/builders/app-developers/bridging/standard-bridge.mdx b/pages/builders/app-developers/bridging/standard-bridge.mdx index 2d137d6a..73eb844d 100644 --- a/pages/builders/app-developers/bridging/standard-bridge.mdx +++ b/pages/builders/app-developers/bridging/standard-bridge.mdx @@ -199,8 +199,8 @@ Users simply need to trigger and send ETH to the [`bridgeETH`](https://github.co ## Tutorials -* [Learn how to bridge ERC-20 tokens with the Optimism SDK](/builders/app-developers/tutorials/cross-dom-bridge-erc20) -* [Learn how to bridge ETH with the Optimism SDK](/builders/app-developers/tutorials/cross-dom-bridge-eth) +* [Learn how to bridge ERC-20 tokens with viem](/builders/app-developers/tutorials/cross-dom-bridge-erc20) +* [Learn how to bridge ETH with viem](/builders/app-developers/tutorials/cross-dom-bridge-eth) * [Learn how to create a standard bridged token](/builders/app-developers/tutorials/standard-bridge-standard-token) * [Learn how to create a custom bridged token](/builders/app-developers/tutorials/standard-bridge-custom-token) diff --git a/pages/builders/app-developers/overview.mdx b/pages/builders/app-developers/overview.mdx index 8b6a9e1d..21bed4d4 100644 --- a/pages/builders/app-developers/overview.mdx +++ b/pages/builders/app-developers/overview.mdx @@ -51,17 +51,17 @@ The Standard Token Bridge for OP Mainnet even uses this same message-passing inf If you're a bit more familiar with OP Mainnet and Ethereum, you can try walking through one of the tutorials put together by the Optimism community. They'll help you get a head start when building your first Optimistic project. -| Tutorial Name | Description | Difficulty Level | -| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -| [Deploying Your First Contract on OP Mainnet](tutorials/first-contract) | Learn how to deploy your first contract to OP Mainnet with Remix and MetaMask. | 🟒 Easy | -| [Bridging ETH With the Optimism SDK](tutorials/cross-dom-bridge-eth) | Learn how to use the Optimism SDK to transfer ETH between Layer 1 (Ethereum or Sepolia) and Layer 2 (OP Mainnet or OP Sepolia). | 🟒 Easy | -| [Bridging ERC-20 Tokens With the Optimism SDK](tutorials/cross-dom-bridge-erc20) | Learn how to use the Optimism SDK to transfer ERC-20 tokens between Layer 1 (Ethereum or Sepolia) and Layer 2 (OP Mainnet or OP Sepolia). | 🟒 Easy | -| [Bridging your Standard ERC-20 token using the Standard Bridge](tutorials/standard-bridge-standard-token) | Learn how to bridge your standard ERC-20 token to layer 2 using the standard bridge. | 🟑 Medium | -| [Bridging your Custom ERC-20 token using the Standard Bridge](tutorials/standard-bridge-custom-token) | Learn how to bridge your custom ERC-20 token to layer 2 using the standard bridge. | 🟑 Medium | -| [Tracing Deposits and Withdrawals With the Optimism SDK](tutorials/sdk-trace-txns) | Learn how to use the Optimism SDK to trace deposits and withdrawals. | 🟒 Easy | -| [Viewing Deposits and Withdrawals by Address With the Optimism SDK](tutorials/sdk-view-txns) | Learn how to use the Optimism SDK to view deposits and withdrawals by address. | 🟒 Easy | -| [Estimating Transaction Costs With the Optimism SDK](tutorials/sdk-view-txns) | Learn how to use the Optimism SDK to estimate the cost of a transaction on OP Mainnet. | 🟒 Easy | -| [Sending OP Mainnet Transactions from Ethereum](tutorials/send-tx-from-eth) | Learn how to send transactions to OP Mainnet from Ethereum. | 🟒 Easy | +| Tutorial Name | Description | Difficulty Level | +| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------- | +| [Deploying Your First Contract on OP Mainnet](tutorials/first-contract) | Learn how to deploy your first contract to OP Mainnet with Remix and MetaMask. | 🟒 Easy | +| [Bridging ETH With viem](tutorials/cross-dom-bridge-eth) | Learn how to use viem to transfer ETH between Layer 1 (Ethereum or Sepolia) and Layer 2 (OP Mainnet or OP Sepolia). | 🟒 Easy | +| [Bridging ERC-20 Tokens With viem](tutorials/cross-dom-bridge-erc20) | Learn how to use viem to transfer ERC-20 tokens between Layer 1 (Ethereum or Sepolia) and Layer 2 (OP Mainnet or OP Sepolia). | 🟒 Easy | +| [Bridging your Standard ERC-20 token using the Standard Bridge](tutorials/standard-bridge-standard-token) | Learn how to bridge your standard ERC-20 token to layer 2 using the standard bridge. | 🟑 Medium | +| [Bridging your Custom ERC-20 token using the Standard Bridge](tutorials/standard-bridge-custom-token) | Learn how to bridge your custom ERC-20 token to layer 2 using the standard bridge. | 🟑 Medium | +| [Tracing Deposits and Withdrawals with viem](tutorials/sdk-trace-txns) | Learn how to use viem to trace deposits and withdrawals. | 🟒 Easy | +| [Viewing Deposits and Withdrawals by address with viem](tutorials/sdk-view-txns) | Learn how to use viem to view deposits and withdrawals by address. | 🟒 Easy | +| [Estimating Transaction Costs With the viem](tutorials/sdk-view-txns) | Learn how to use viem to estimate the cost of a transaction on OP Mainnet. | 🟒 Easy | +| [Sending OP Mainnet Transactions from Ethereum](tutorials/send-tx-from-eth) | Learn how to send transactions to OP Mainnet from Ethereum. | 🟒 Easy | You can also [suggest a new tutorial](https://github.com/ethereum-optimism/docs/issues/new?assignees=\&labels=tutorial%2Cdocumentation%2Ccommunity-request\&projects=\&template=suggest_tutorial.yaml\&title=%5BTUTORIAL%5D+Add+PR+title) if you have something specific in mind. We'd love to grow this list! diff --git a/pages/builders/app-developers/tutorials.mdx b/pages/builders/app-developers/tutorials.mdx index 9376b72b..76ed412f 100644 --- a/pages/builders/app-developers/tutorials.mdx +++ b/pages/builders/app-developers/tutorials.mdx @@ -8,12 +8,12 @@ import { Card, Cards } from 'nextra/components' # Tutorials -This section provides information on bridging erc 20 tokens to op mainnet with the optimism sdk, bridging eth to op mainnet with the optimism sdk, communicating between op mainnet and ethereum in solidity, deploying your first contract on op mainnet, estimating transaction costs on op mainnet, tracing deposits and withdrawals, viewing deposits and withdrawals by address, triggering op mainnet transactions from ethereum, bridging your custom erc 20 token using the standard bridge and bridging your standard erc 20 token using the standard bridge. You'll find tutorial to help you understand and work with these topics. +This section provides information on bridging erc 20 tokens to op mainnet with viem, bridging eth to op mainnet with viem, communicating between op mainnet and ethereum in solidity, deploying your first contract on op mainnet, estimating transaction costs on op mainnet, tracing deposits and withdrawals, viewing deposits and withdrawals by address, triggering op mainnet transactions from ethereum, bridging your custom erc 20 token using the standard bridge and bridging your standard erc 20 token using the standard bridge. You'll find tutorial to help you understand and work with these topics. - + - + diff --git a/pages/builders/app-developers/tutorials/_meta.json b/pages/builders/app-developers/tutorials/_meta.json index c3a3283a..a1f44203 100644 --- a/pages/builders/app-developers/tutorials/_meta.json +++ b/pages/builders/app-developers/tutorials/_meta.json @@ -1,7 +1,7 @@ { "cross-dom-solidity": "Communicating between chains in Solidity", - "cross-dom-bridge-eth": "Bridging ETH with Viem", - "cross-dom-bridge-erc20": "Bridging ERC-20 tokens with the Optimism SDK", + "cross-dom-bridge-eth": "Bridging ETH with viem", + "cross-dom-bridge-erc20": "Bridging ERC-20 tokens with viem", "standard-bridge-custom-token": "Bridging your custom ERC-20 token to OP Mainnet", "standard-bridge-standard-token": "Bridging your standard ERC-20 token to OP Mainnet", "sdk-view-txns": "Viewing deposits and withdrawals by address", diff --git a/pages/builders/app-developers/tutorials/standard-bridge-custom-token.mdx b/pages/builders/app-developers/tutorials/standard-bridge-custom-token.mdx index 71eb9a63..76d5ee2e 100644 --- a/pages/builders/app-developers/tutorials/standard-bridge-custom-token.mdx +++ b/pages/builders/app-developers/tutorials/standard-bridge-custom-token.mdx @@ -114,7 +114,7 @@ _SYMBOL: "MCL2T" ## Bridge some tokens Now that you have an L2 ERC-20 token, you can bridge some tokens from L1 to L2. -Check out the tutorial on [Bridging ERC-20 tokens with the Optimism SDK](./cross-dom-bridge-erc20) to learn how to bridge your L1 ERC-20 to L2s using the Optimism SDK. +Check out the tutorial on [Bridging ERC-20 tokens with viem](./cross-dom-bridge-erc20) to learn how to bridge your L1 ERC-20 to L2s using viem. Remember that the withdrawal step will *not* work for the token you just created! This is exactly what this tutorial was meant to demonstrate. diff --git a/pages/builders/app-developers/tutorials/standard-bridge-standard-token.mdx b/pages/builders/app-developers/tutorials/standard-bridge-standard-token.mdx index 6046bd1f..2506176f 100644 --- a/pages/builders/app-developers/tutorials/standard-bridge-standard-token.mdx +++ b/pages/builders/app-developers/tutorials/standard-bridge-standard-token.mdx @@ -96,7 +96,7 @@ The resulting L2 ERC-20 token address is printed to the console. ## Bridge some tokens Now that you have an L2 ERC-20 token, you can bridge some tokens from L1 to L2. -Check out the tutorial on [Bridging ERC-20 tokens with the Optimism SDK](./cross-dom-bridge-erc20) to learn how to bridge your L1 ERC-20 to L2s using the Optimism SDK. +Check out the tutorial on [Bridging ERC-20 tokens with viem](./cross-dom-bridge-erc20) to learn how to bridge your L1 ERC-20 to L2s using viem. ## Add to the Superchain Token List diff --git a/pages/builders/chain-operators/tutorials.mdx b/pages/builders/chain-operators/tutorials.mdx index 6f99a466..e78b0bd6 100644 --- a/pages/builders/chain-operators/tutorials.mdx +++ b/pages/builders/chain-operators/tutorials.mdx @@ -10,7 +10,7 @@ import { Card, Cards } from 'nextra/components' # Tutorials -This section provides information on adding attributes to the derivation function, adding a precompile, creating your own l2 rollup testnet, integrating a new da layer with alt da, modifying predeployed contracts and using the optimism sdk. You'll find overview, tutorial, guide to help you understand and work with these topics. +This section provides information on adding attributes to the derivation function, adding a precompile, creating your own l2 rollup testnet, integrating a new da layer with alt da, modifying predeployed contracts and using viem. You'll find overview, tutorial, guide to help you understand and work with these topics. @@ -23,5 +23,5 @@ This section provides information on adding attributes to the derivation functio - + diff --git a/pages/builders/tools/overview.mdx b/pages/builders/tools/overview.mdx index dac27f1e..c3069e11 100644 --- a/pages/builders/tools/overview.mdx +++ b/pages/builders/tools/overview.mdx @@ -50,7 +50,7 @@ If you are already familiar with [building on OP Mainnet](/chain/getting-started } /> - } /> + } /> } /> diff --git a/pages/connect/contribute/style-guide.mdx b/pages/connect/contribute/style-guide.mdx index 2149e5ad..f1ab6193 100644 --- a/pages/connect/contribute/style-guide.mdx +++ b/pages/connect/contribute/style-guide.mdx @@ -69,7 +69,7 @@ Write in a friendly, yet professional tone. We are upbeat, knowledgeable, and ** See below for when to use title or sentence case. -* Avoid using all caps as it slows down reading comprehension. +* Avoid using all caps as it slows down reading comprehension. * Capitalize proper nouns in sentences.
**Example**: I use Visual Studio on my local machine. @@ -320,15 +320,15 @@ Developers trust that we will lead them to sites or pages related to their readi Content types help manage technical content by defining the purpose and common structure for each file type. All content types used in these technical docs have attributes or properties, as defined below. -| Document type | Purpose | Examples | -| ------------------ | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- | -| Overviews | General introduction to a product or feature, provides a happy-path for readers | [Smart Contract Overview](/stack/smart-contracts) | -| Guides | Explain what things are and how they work | [Standard Bridge Guide](/builders/app-developers/bridging/standard-bridge) | -| Quick Start Guides | Briefly explain how to "minimally" get started with a product, often in 30 minutes or less | [Superchain App Quick Start](/builders/app-developers/quick-start) | -| Tutorials | Provide task-oriented guidance with step-by-step "learn by doing" instructions | [Bridging ERC-20 tokens with the Optimism SDK](/builders/app-developers/tutorials/cross-dom-bridge-erc20) | -| FAQs | Address frequently asked questions | [FAQ: OP Mainnet Security Model](/chain/security/faq) | -| Troubleshooting | List common troubleshooting scenarios and solutions | [Troubleshooting: Run a Node](/builders/node-operators/management/troubleshooting) | -| Reference | Provide deep, theoretical knowledge of the internal workings of a system, such as API endpoints and specifications | [Node and RPC Providers](/builders/tools/connect/rpc-providers) | +| Document type | Purpose | Examples | +| ------------------ | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- | +| Overviews | General introduction to a product or feature, provides a happy-path for readers | [Smart Contract Overview](/stack/smart-contracts) | +| Guides | Explain what things are and how they work | [Standard Bridge Guide](/builders/app-developers/bridging/standard-bridge) | +| Quick Start Guides | Briefly explain how to "minimally" get started with a product, often in 30 minutes or less | [Superchain App Quick Start](/builders/app-developers/quick-start) | +| Tutorials | Provide task-oriented guidance with step-by-step "learn by doing" instructions | [Bridging ERC-20 tokens with viem](/builders/app-developers/tutorials/cross-dom-bridge-erc20) | +| FAQs | Address frequently asked questions | [FAQ: OP Mainnet Security Model](/chain/security/faq) | +| Troubleshooting | List common troubleshooting scenarios and solutions | [Troubleshooting: Run a Node](/builders/node-operators/management/troubleshooting) | +| Reference | Provide deep, theoretical knowledge of the internal workings of a system, such as API endpoints and specifications | [Node and RPC Providers](/builders/tools/connect/rpc-providers) | ### Overviews @@ -405,7 +405,7 @@ When writing tutorials or quick starts, steps should be written in parallel styl ### FAQs -Whenever possible, we should avoid using FAQs due to their lack of readability and difficulty of maintenance. +Whenever possible, we should avoid using FAQs due to their lack of readability and difficulty of maintenance. FAQs address common questions developers have/might ask about a product, feature, or service. FAQs should be written from the developer's perspective. If there are more than two steps in the answer, use a numbered list. Place FAQs onto their own separate pages, whenever possible, and link to the FAQ from within the respective guide or tutorial. From 0adff39d5c755f5403667830f15613ee660ed976 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Tue, 12 Nov 2024 16:24:40 +0100 Subject: [PATCH 29/53] changes op mainnet to op stack --- pages/builders/app-developers/tutorials.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/builders/app-developers/tutorials.mdx b/pages/builders/app-developers/tutorials.mdx index 76ed412f..34a2f40e 100644 --- a/pages/builders/app-developers/tutorials.mdx +++ b/pages/builders/app-developers/tutorials.mdx @@ -11,13 +11,13 @@ import { Card, Cards } from 'nextra/components' This section provides information on bridging erc 20 tokens to op mainnet with viem, bridging eth to op mainnet with viem, communicating between op mainnet and ethereum in solidity, deploying your first contract on op mainnet, estimating transaction costs on op mainnet, tracing deposits and withdrawals, viewing deposits and withdrawals by address, triggering op mainnet transactions from ethereum, bridging your custom erc 20 token using the standard bridge and bridging your standard erc 20 token using the standard bridge. You'll find tutorial to help you understand and work with these topics. - + - + - + From dd292f3bdbb67045c91e063031121b88ccd871d0 Mon Sep 17 00:00:00 2001 From: Balraj Hariharan <100754149+BalrajHariharanA@users.noreply.github.com> Date: Wed, 6 Nov 2024 21:54:29 +0530 Subject: [PATCH 30/53] Deploy the L1 contract command path updated --- pages/builders/chain-operators/tutorials/create-l2-rollup.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx index 52c7b537..19bae6b0 100644 --- a/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx +++ b/pages/builders/chain-operators/tutorials/create-l2-rollup.mdx @@ -418,7 +418,7 @@ Once you've configured your network, it's time to deploy the L1 contracts necess {

Deploy the L1 contracts

} ```bash -forge script scripts/deploy/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL --slow +forge script scripts/Deploy.s.sol:Deploy --private-key $GS_ADMIN_PRIVATE_KEY --broadcast --rpc-url $L1_RPC_URL --slow ``` From 823c4281cce3b20ae331feeeda1752514ef4ee24 Mon Sep 17 00:00:00 2001 From: Bryer <0xbryer@gmail.com> Date: Fri, 15 Nov 2024 13:46:37 +0200 Subject: [PATCH 31/53] Refactor JSDoc for WipCallout to Improve Clarity and Precision Update WipCallout.tsx This pull request addresses an issue with the JSDoc comments for the WipCallout function. The original JSDoc was overly verbose, included redundant information, and misused the @param directive. The updated JSDoc provides a more precise and compact description while adhering to standard documentation practices. --- components/WipCallout.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/components/WipCallout.tsx b/components/WipCallout.tsx index 2d0b96cc..ae360004 100644 --- a/components/WipCallout.tsx +++ b/components/WipCallout.tsx @@ -1,13 +1,9 @@ /** * The WipCallout function renders a custom callout component with optional context text for * displaying maintenance messages. - * @param {Props} - The code snippet you provided is a React component named `WipCallout` that - * renders a special callout message. The component takes an optional prop `context` of type string, - * which can be used to customize the message displayed in the callout. - * @returns The WipCallout component is being returned, which is a React element representing a - * custom callout with a message. The message displayed depends on the value of the `context` prop - * passed to the component. If `context` is provided, it will display the provided context message. If - * `context` is not provided, it will display a default maintenance message. + * @param {Props} props - An object containing the optional `context` property, a string used + * to customize the message displayed in the callout. + * @returns {ReactElement} The WipCallout component, representing a custom callout message. */ import type { ReactElement } from 'react'; import { useState } from 'react'; @@ -115,4 +111,4 @@ export function AltCallout(props: Props): ReactElement { export function CGTCallout(props: Props): ReactElement { return ; -} \ No newline at end of file +} From 911b42cf03d25c457f0e7c080ddfad2c8a01804f Mon Sep 17 00:00:00 2001 From: Voronor <129545215+voronor@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:05:42 +0100 Subject: [PATCH 32/53] Fix invalid stroke-width attribute Update Loader.tsx Fix invalid stroke-width attribute in Loader component --- components/calculator/Loader.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/calculator/Loader.tsx b/components/calculator/Loader.tsx index d437554b..708ab889 100644 --- a/components/calculator/Loader.tsx +++ b/components/calculator/Loader.tsx @@ -7,7 +7,7 @@ export const Loader: React.FC = () => { { { Date: Fri, 15 Nov 2024 13:08:53 +0100 Subject: [PATCH 33/53] Update components/calculator/Loader.tsx --- components/calculator/Loader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/calculator/Loader.tsx b/components/calculator/Loader.tsx index 708ab889..9e4ebbb8 100644 --- a/components/calculator/Loader.tsx +++ b/components/calculator/Loader.tsx @@ -7,7 +7,7 @@ export const Loader: React.FC = () => { Date: Fri, 15 Nov 2024 16:03:44 +0100 Subject: [PATCH 34/53] Created a script that checks for borken links --- lychee.toml | 8 +- package.json | 3 +- .../send-raw-transaction-conditional.mdx | 4 +- .../assets/deploy-superchain-erc20.mdx | 2 +- pages/stack/interop/explainer.mdx | 2 +- utils/redirects.ts | 135 ++++++++++++++++++ 6 files changed, 148 insertions(+), 6 deletions(-) create mode 100644 utils/redirects.ts diff --git a/lychee.toml b/lychee.toml index 60e8be5a..9ecd097e 100644 --- a/lychee.toml +++ b/lychee.toml @@ -13,6 +13,9 @@ remap = [ "file:///(.*?)/pages/img/(.*) file:///$1/public/img/$2", "file:///(.*?)/pages/resources/(.*) file:///$1/public/resources/$2", "file:///([^#.?]+)(#.*)?$ file:///$1.mdx$2", + "file:///([^#]+)#.*$ file:///$1.mdx", + "/([^#]+)#.*$ file:///pages/$1.mdx", + "^/([^#]+)$ file:///pages/$1.mdx", "\\\\& &" ] @@ -27,6 +30,9 @@ exclude_loopback = true # Exclude all mail addresses from checking. exclude_mail = true +# Exclude all external links except ethereum-optimism GitHub +exclude_links = ['http[s]?://(?!github\.com/ethereum-optimism).*'] + # Exclude RPC URLs from checking. exclude = [ 'https://mainnet.optimism.io', @@ -41,4 +47,4 @@ exclude = [ ] # Accept these status codes -accept = ["100..=103", "200..=299", "403..=403", "502..=502"] +accept = ["100..=103", "200..=299", "403..=403", "502..=502"] \ No newline at end of file diff --git a/package.json b/package.json index b1690e4f..08b2b6dc 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,13 @@ "version": "0.0.1", "description": "Optimism Docs", "scripts": { - "lint": "eslint . --ext mdx --max-warnings 0 && pnpm spellcheck:lint && pnpm check-breadcrumbs", + "lint": "eslint . --ext mdx --max-warnings 0 && pnpm spellcheck:lint && pnpm check-breadcrumbs && pnpm check-redirects", "fix": "eslint . --ext mdx --fix && pnpm spellcheck:fix && pnpm check-breadcrumbs", "spellcheck:lint": "cspell lint \"**/*.mdx\"", "spellcheck:fix": "cspell --words-only --unique \"**/*.mdx\" | sort --ignore-case | uniq > words.txt", "linkcheck": "lychee --config ./lychee.toml --quiet \"./pages\"", "breadcrumbs":"npx ts-node --skip-project utils/create-breadcrumbs.ts", + "check-redirects": "npx ts-node --skip-project utils/redirects.ts", "check-breadcrumbs":"npx ts-node --skip-project utils/breadcrumbs.ts", "index:docs": "npx ts-node --skip-project utils/algolia-indexer.ts", "dev": "next dev", diff --git a/pages/stack/features/send-raw-transaction-conditional.mdx b/pages/stack/features/send-raw-transaction-conditional.mdx index 5717ae5e..75cb7e8c 100644 --- a/pages/stack/features/send-raw-transaction-conditional.mdx +++ b/pages/stack/features/send-raw-transaction-conditional.mdx @@ -56,8 +56,8 @@ Successful submission does **NOT** guarantee inclusion! The caller must observe This feature can be enabled with the addition of a flag to op-geth. * `--rollup.sequencertxconditionalenabled` (default: false) a boolean flag which enables the rpc. -* `--rollup.sequencertxconditionalcostratelimit` (default: 5000) an integer flag that sets the rate limit for cost observable per second. +* `--rollup.sequencertxconditionalcostratelimit` (default: 5000) an integer flag that sets the rate limit for cost observable per second. - It is not advised to publicly expose this sequencer endpoint due to DoS concerns. This supplemental proxy, [op-txproxy](/stack/operators/features/op-txproxy), should be used to apply additional constraints on this endpoint prior to passing through to the sequencer. + It is not advised to publicly expose this sequencer endpoint due to DoS concerns. This supplemental proxy, [op-txproxy](/builders/chain-operators/tools/op-txproxy), should be used to apply additional constraints on this endpoint prior to passing through to the sequencer. diff --git a/pages/stack/interop/assets/deploy-superchain-erc20.mdx b/pages/stack/interop/assets/deploy-superchain-erc20.mdx index af506e23..19b1917a 100644 --- a/pages/stack/interop/assets/deploy-superchain-erc20.mdx +++ b/pages/stack/interop/assets/deploy-superchain-erc20.mdx @@ -13,7 +13,7 @@ import { Steps } from 'nextra/components' Interop is currently in active development and not yet ready for production use. The information provided here may change. Check back regularly for the most up-to-date information. -This guide explains how to issue new assets with the `SuperchainERC20` and bridge them effectively using the `SuperchainERC20Bridge`. If you want more information about the `SuperchainERC20 standard`, see our [`SuperchainERC20` standard explainer](/stack/interop/superchain-erc20) +This guide explains how to issue new assets with the `SuperchainERC20` and bridge them effectively using the `SuperchainERC20Bridge`. If you want more information about the `SuperchainERC20 standard`, see our [`SuperchainERC20` standard explainer](/stack/interop/assets/superchain-erc20) Note that bridging assets through the Superchain using `SuperchainERC20` never affects the total supply of your asset. The supply remains fixed, and bridging only changes the chain on which your asset is located. This keeps the token's total amount the same across all networks, ensuring its value stays stable during the move and that the `SuperchainERC20` retains a unified, global supply count. diff --git a/pages/stack/interop/explainer.mdx b/pages/stack/interop/explainer.mdx index b52b2880..3f84e1b0 100644 --- a/pages/stack/interop/explainer.mdx +++ b/pages/stack/interop/explainer.mdx @@ -24,7 +24,7 @@ Native OP Stack interoperability provides the ability to read messages and trans Superchain interop includes both the protocol layer message passing and the Superchain ERC20 token specification. * **Message passing protocol:** the initial + finalizing/executing [message](cross-chain-message) that fire events to be consumed by the chains in the [dependency set](https://specs.optimism.io/interop/dependency-set.html) -* **SuperchainERC20 token specification**: the [SuperchainERC20](superchain-erc20) turns message passing into asset transfer between chains in the interop set. Learn more about how the SuperchainERC20 token standard enables asset interoperability in the Superchain [here](/stack/interop/superchain-erc20) +* **SuperchainERC20 token specification**: the [SuperchainERC20](superchain-erc20) turns message passing into asset transfer between chains in the interop set. Learn more about how the SuperchainERC20 token standard enables asset interoperability in the Superchain [here](/stack/interop/assets/superchain-erc20) This means ETH and ERC-20s can seamlessly and securely move across L2s, and intent-based protocols (i.e., bridges) can build better experiences on top of the message passing protocol. diff --git a/utils/redirects.ts b/utils/redirects.ts new file mode 100644 index 00000000..bd2cb66b --- /dev/null +++ b/utils/redirects.ts @@ -0,0 +1,135 @@ +import * as fs from 'fs/promises'; +import * as path from 'path'; + +const rootDir = path.join(process.cwd(), 'pages'); +const redirectsPath = path.join(process.cwd(), 'public', '_redirects'); +const warnings: string[] = []; + +// ANSI color codes +const WHITE = '\x1b[37m'; +const GREEN = '\x1b[32m'; +const YELLOW = '\x1b[33m'; +const RESET = '\x1b[0m'; +const BOLD = '\x1b[1m'; + +interface Redirect { + from: string; + to: string; +} + +interface Summary { + total: number; + ok: number; + errors: number; +} + +function formatWarning(filePath: string, fromLink: string, toLink: string): string { + return `${WHITE}File "${filePath}" contains outdated link ${YELLOW}"${fromLink}"${WHITE} - should be updated to ${GREEN}"${toLink}"${RESET}`; +} + +async function getRedirects(): Promise { + const content = await fs.readFile(redirectsPath, 'utf-8'); + return content.split('\n') + .filter(line => line.trim() && !line.startsWith('#')) + .map(line => { + const [from, to] = line.split(/\s+/); + return { from, to }; + }); +} + +async function findMdxFiles(dir: string): Promise { + const files: string[] = []; + const entries = await fs.readdir(dir, { withFileTypes: true }); + + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory() && !entry.name.startsWith('_')) { + files.push(...await findMdxFiles(fullPath)); + } else if (entry.isFile() && /\.(md|mdx)$/.test(entry.name)) { + files.push(fullPath); + } + } + return files; +} + +function extractLinks(content: string): string[] { + const markdownLinkRegex = /\[([^\]]+)\]\(([^)]+)\)/g; + const hrefRegex = /href="([^"]+)"/g; + const links: string[] = []; + + let match; + while ((match = markdownLinkRegex.exec(content)) !== null) { + if (!match[2].startsWith('http')) { + links.push(match[2]); + } + } + while ((match = hrefRegex.exec(content)) !== null) { + if (!match[1].startsWith('http')) { + links.push(match[1]); + } + } + return links; +} + +async function checkFile(filePath: string, redirects: Redirect[]): Promise { + const content = await fs.readFile(filePath, 'utf-8'); + const links = extractLinks(content); + const relativeFilePath = path.relative(rootDir, filePath); + + links.forEach(link => { + const redirect = redirects.find(r => r.from === link); + if (redirect) { + warnings.push(formatWarning(relativeFilePath, link, redirect.to)); + } + }); +} + +function printSummary(summary: Summary) { + console.log('\nSummary:'); + console.log(`${WHITE}Total pages πŸ” - ${summary.total}`); + console.log(`${YELLOW}Pages broken 🚫 - ${summary.errors}`); + console.log(`${GREEN}Pages OK βœ… - ${summary.ok}${RESET}`); +} + +async function main() { + const summary: Summary = { + total: 0, + ok: 0, + errors: 0 + }; + + console.log('Starting redirect link check...'); + console.log('Root directory:', rootDir); + + try { + const redirects = await getRedirects(); + const files = await findMdxFiles(rootDir); + + summary.total = files.length; + + for (const file of files) { + await checkFile(file, redirects); + } + + summary.errors = warnings.length; + summary.ok = summary.total - summary.errors; + + if (warnings.length > 0) { + console.log(`${YELLOW}${BOLD}Links that need updating:${RESET}`); + warnings.forEach(warning => console.log(warning)); + printSummary(summary); + process.exit(1); + } else { + console.log(`${GREEN}All internal links are up to date.${RESET}`); + printSummary(summary); + } + } catch (error) { + console.error(`${YELLOW}${BOLD}Error checking redirects:${RESET}`, error); + process.exit(1); + } +} + +main().catch(error => { + console.error(`${YELLOW}${BOLD}Error in main process:${RESET}`, error); + process.exit(1); +}); \ No newline at end of file From e8d2b3596cfbe0e871d85e274975831702f034be Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 15 Nov 2024 16:14:10 +0100 Subject: [PATCH 35/53] updated the link checker --- package.json | 3 +- pages/builders.mdx | 2 +- pages/builders/app-developers/overview.mdx | 6 +- .../tutorials/cross-dom-bridge-erc20.mdx | 2 +- pages/builders/chain-operators/tutorials.mdx | 2 +- pages/chain/getting-started.mdx | 2 +- pages/chain/testing/dev-node.mdx | 2 +- pages/index.mdx | 2 +- pages/stack/differences.mdx | 4 +- pages/stack/getting-started.mdx | 2 +- utils/fix-redirects.ts | 126 ++++++++++++++++++ words.txt | 9 -- 12 files changed, 140 insertions(+), 22 deletions(-) create mode 100644 utils/fix-redirects.ts diff --git a/package.json b/package.json index 08b2b6dc..733b523e 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,13 @@ "description": "Optimism Docs", "scripts": { "lint": "eslint . --ext mdx --max-warnings 0 && pnpm spellcheck:lint && pnpm check-breadcrumbs && pnpm check-redirects", - "fix": "eslint . --ext mdx --fix && pnpm spellcheck:fix && pnpm check-breadcrumbs", + "fix": "eslint . --ext mdx --fix && pnpm spellcheck:fix && pnpm check-breadcrumbs && pnpm fix-redirects", "spellcheck:lint": "cspell lint \"**/*.mdx\"", "spellcheck:fix": "cspell --words-only --unique \"**/*.mdx\" | sort --ignore-case | uniq > words.txt", "linkcheck": "lychee --config ./lychee.toml --quiet \"./pages\"", "breadcrumbs":"npx ts-node --skip-project utils/create-breadcrumbs.ts", "check-redirects": "npx ts-node --skip-project utils/redirects.ts", + "fix-redirects": "npx ts-node --skip-project utils/fix-redirects.ts", "check-breadcrumbs":"npx ts-node --skip-project utils/breadcrumbs.ts", "index:docs": "npx ts-node --skip-project utils/algolia-indexer.ts", "dev": "next dev", diff --git a/pages/builders.mdx b/pages/builders.mdx index ab69e59b..98f4178c 100644 --- a/pages/builders.mdx +++ b/pages/builders.mdx @@ -15,6 +15,6 @@ Welcome to the Builders section. Here you'll find resources and guides for devel - +
diff --git a/pages/builders/app-developers/overview.mdx b/pages/builders/app-developers/overview.mdx index 21bed4d4..e38817e4 100644 --- a/pages/builders/app-developers/overview.mdx +++ b/pages/builders/app-developers/overview.mdx @@ -16,14 +16,14 @@ In this area of the Optimism Docs you'll find everything you need to know about If you're brand new to OP Mainnet, try starting with the guide on [deploying a basic contract](/chain/getting-started). It'll get you familiar with the basic steps required to get a contract deployed to the network. OP Mainnet is [EVM equivalent](https://web.archive.org/web/20231127160757/https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306) so you can feel confident that your existing Ethereum smart contract skills will carry over to OP Mainnet. -Just make sure to be aware of the few small [differences between Ethereum and OP Mainnet](/chain/differences). +Just make sure to be aware of the few small [differences between Ethereum and OP Mainnet](/stack/differences). You might also want to check out the [testing on OP Networks guide](/chain/testing/testing-apps) and the tutorial on [running a local development environment](/chain/testing/dev-node) to help you feel totally confident in your OP Mainnet deployment. - } /> + } /> - } /> + } /> } /> diff --git a/pages/builders/app-developers/tutorials/cross-dom-bridge-erc20.mdx b/pages/builders/app-developers/tutorials/cross-dom-bridge-erc20.mdx index c2de6433..883e4908 100644 --- a/pages/builders/app-developers/tutorials/cross-dom-bridge-erc20.mdx +++ b/pages/builders/app-developers/tutorials/cross-dom-bridge-erc20.mdx @@ -31,7 +31,7 @@ Make sure to check out the [Standard Bridge guide](/builders/app-developers/brid The Optimism SDK supports any of the [Superchain networks](/chain/networks). [Some Superchain networks](https://sdk.optimism.io/enums/l2chainid) are already included in the SDK by default. -If you want to use a network that isn't included by default, you can simply [instantiate the SDK with the appropriate contract addresses](/builders/chain-operators/tutorials/sdk). +If you want to use a network that isn't included by default, you can simply [instantiate the SDK with the appropriate contract addresses](/builders/app-developers/overview). ## Dependencies diff --git a/pages/builders/chain-operators/tutorials.mdx b/pages/builders/chain-operators/tutorials.mdx index e78b0bd6..6b2387f7 100644 --- a/pages/builders/chain-operators/tutorials.mdx +++ b/pages/builders/chain-operators/tutorials.mdx @@ -23,5 +23,5 @@ This section provides information on adding attributes to the derivation functio - +
diff --git a/pages/chain/getting-started.mdx b/pages/chain/getting-started.mdx index cf9703d4..d4af9fae 100644 --- a/pages/chain/getting-started.mdx +++ b/pages/chain/getting-started.mdx @@ -11,7 +11,7 @@ import { Steps } from 'nextra/components' This guide explains the basics of OP Mainnet development. OP Mainnet is [EVM equivalent](https://web.archive.org/web/20231127160757/https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306), meaning we run a slightly modified version of the same `geth` you run on mainnet. Therefore, the differences between OP Mainnet development and Ethereum development are minor. -But a few differences [do exist](/chain/differences). +But a few differences [do exist](/stack/differences). ## OP Mainnet and OP Sepolia endpoint URLs diff --git a/pages/chain/testing/dev-node.mdx b/pages/chain/testing/dev-node.mdx index 477176e7..6471f987 100644 --- a/pages/chain/testing/dev-node.mdx +++ b/pages/chain/testing/dev-node.mdx @@ -24,7 +24,7 @@ We generally recommend using the local development environment if your applicati 1. **You're building contracts on both OP Mainnet and Ethereum that need to interact with one another.** The local development environment is a great way to quickly test interactions between L1 and L2. The OP Mainnet and test networks have a communication delay between L1 and L2 that can make testing slow during the early stages of development. -2. **You're building an application that might be subject to one of the few [differences between Ethereum and OP Mainnet](/chain/differences).** Although OP Mainnet is [EVM equivalent](https://web.archive.org/web/20231127160757/https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306), it's not exactly the same as Ethereum. If you're building an application that might be subject to one of these differences, you should use the local development environment to double check that everything is running as expected. You might otherwise have unexpected issues when you move to testnet. We strongly recommend reviewing these differences carefully to see if you might fall into this category. +2. **You're building an application that might be subject to one of the few [differences between Ethereum and OP Mainnet](/stack/differences).** Although OP Mainnet is [EVM equivalent](https://web.archive.org/web/20231127160757/https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306), it's not exactly the same as Ethereum. If you're building an application that might be subject to one of these differences, you should use the local development environment to double check that everything is running as expected. You might otherwise have unexpected issues when you move to testnet. We strongly recommend reviewing these differences carefully to see if you might fall into this category. However, not everyone will need to use the local development environment. OP Mainnet is [EVM equivalent](https://web.archive.org/web/20231127160757/https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306), which means that OP Mainnet looks almost exactly like Ethereum under the hood. diff --git a/pages/index.mdx b/pages/index.mdx index 15d4aebd..fa4175cc 100644 --- a/pages/index.mdx +++ b/pages/index.mdx @@ -22,7 +22,7 @@ Whether you're a developer building a app on OP Mainnet, a node operator running } /> - } /> + } /> } /> diff --git a/pages/stack/differences.mdx b/pages/stack/differences.mdx index 9d6e6250..5f370f4b 100644 --- a/pages/stack/differences.mdx +++ b/pages/stack/differences.mdx @@ -16,11 +16,11 @@ However, there are some minor differences between the behavior of Ethereum and O ### Bridging - Deposit Transactions -Deposit transactions don't exist on L1's, and are how transactions on an L2 can be initiated from the L1. Importantly, this is how bridge applications can get L1 ETH or tokens into an L2 OP Stack chain. You can read more on deposit transactions [here](/stack/protocol/rollup/deposit-flow). +Deposit transactions don't exist on L1's, and are how transactions on an L2 can be initiated from the L1. Importantly, this is how bridge applications can get L1 ETH or tokens into an L2 OP Stack chain. You can read more on deposit transactions [here](/stack/transactions/deposit-flow). ### Bridging - Withdrawal Transactions and Fault Proofs -Withdrawal transactions are how the state of the L2 rollup can be proven to the L1. Often this involves users withdrawing tokens or ETH to the L1. Fault proofs are the mechanism by which withdrawal transactions are currently proven to the L1. You can read more about fault proofs [here](/stack/protocol/fault-proofs/explainer). +Withdrawal transactions are how the state of the L2 rollup can be proven to the L1. Often this involves users withdrawing tokens or ETH to the L1. Fault proofs are the mechanism by which withdrawal transactions are currently proven to the L1. You can read more about fault proofs [here](/stack/fault-proofs/explainer). ## Opcodes diff --git a/pages/stack/getting-started.mdx b/pages/stack/getting-started.mdx index 67096b0d..a3f5a13a 100644 --- a/pages/stack/getting-started.mdx +++ b/pages/stack/getting-started.mdx @@ -16,7 +16,7 @@ import { Callout } from 'nextra/components' The OP Stack consists of the many different software components managed and maintained by the Optimism Collective that, together, form the backbone of Optimism. The OP Stack is built as a public good for the Ethereum and Optimism ecosystems. -To understand how to operate an OP Stack chain, including roll-up and chain deployment basics, visit [Chain Operator guide](/builders/chain-operators/self-hosted). Check out these guides to get an overview of everything you need to know to properly support OP mainnet within your [exchange](/builders/cex-wallet-developers/cex-support) and [wallet](/builders/cex-wallet-developers/wallet-support). +To understand how to operate an OP Stack chain, including roll-up and chain deployment basics, visit [Chain Operator guide](/builders/chain-operators/self-hosted). Check out these guides to get an overview of everything you need to know to properly support OP mainnet within your [exchange](/builders/app-developers/overview) and [wallet](/builders/app-developers/overview). ## The OP Stack powers Optimism diff --git a/utils/fix-redirects.ts b/utils/fix-redirects.ts new file mode 100644 index 00000000..5d609c20 --- /dev/null +++ b/utils/fix-redirects.ts @@ -0,0 +1,126 @@ +import * as fs from 'fs/promises'; +import * as path from 'path'; + +const rootDir = path.join(process.cwd(), 'pages'); +const redirectsPath = path.join(process.cwd(), 'public', '_redirects'); +const updates: string[] = []; + +// ANSI color codes +const WHITE = '\x1b[37m'; +const GREEN = '\x1b[32m'; +const YELLOW = '\x1b[33m'; +const RESET = '\x1b[0m'; +const BOLD = '\x1b[1m'; + +interface Redirect { + from: string; + to: string; +} + +interface Summary { + total: number; + fixed: number; + skipped: number; +} + +async function getRedirects(): Promise { + const content = await fs.readFile(redirectsPath, 'utf-8'); + return content.split('\n') + .filter(line => line.trim() && !line.startsWith('#')) + .map(line => { + const [from, to] = line.split(/\s+/); + return { from, to }; + }); +} + +async function findMdxFiles(dir: string): Promise { + const files: string[] = []; + const entries = await fs.readdir(dir, { withFileTypes: true }); + + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory() && !entry.name.startsWith('_')) { + files.push(...await findMdxFiles(fullPath)); + } else if (entry.isFile() && /\.(md|mdx)$/.test(entry.name)) { + files.push(fullPath); + } + } + return files; +} + +async function fixFile(filePath: string, redirects: Redirect[]): Promise { + let content = await fs.readFile(filePath, 'utf-8'); + let hasChanges = false; + const relativeFilePath = path.relative(rootDir, filePath); + + redirects.forEach(redirect => { + const markdownRegex = new RegExp(`\\[([^\\]]+)\\]\\(${redirect.from}\\)`, 'g'); + const hrefRegex = new RegExp(`href="${redirect.from}"`, 'g'); + + if (content.match(markdownRegex) || content.match(hrefRegex)) { + content = content + .replace(markdownRegex, `[$1](${redirect.to})`) + .replace(hrefRegex, `href="${redirect.to}"`); + + updates.push(`${WHITE}Fixed in "${relativeFilePath}": ${YELLOW}${redirect.from}${WHITE} β†’ ${GREEN}${redirect.to}${RESET}`); + hasChanges = true; + } + }); + + if (hasChanges) { + await fs.writeFile(filePath, content); + } + + return hasChanges; +} + +function printSummary(summary: Summary) { + console.log('\nSummary:'); + console.log(`${WHITE}Total files πŸ” - ${summary.total}`); + console.log(`${GREEN}Files fixed βœ… - ${summary.fixed}`); + console.log(`${WHITE}Files skipped ⏭️ - ${summary.skipped}${RESET}`); +} + +async function main() { + const summary: Summary = { + total: 0, + fixed: 0, + skipped: 0 + }; + + console.log('Starting to fix redirect links...'); + console.log('Root directory:', rootDir); + + try { + const redirects = await getRedirects(); + const files = await findMdxFiles(rootDir); + + summary.total = files.length; + + for (const file of files) { + const wasFixed = await fixFile(file, redirects); + if (wasFixed) { + summary.fixed++; + } else { + summary.skipped++; + } + } + + if (updates.length > 0) { + console.log(`${GREEN}${BOLD}Fixed links:${RESET}`); + updates.forEach(update => console.log(update)); + printSummary(summary); + } else { + console.log(`${GREEN}No broken links found. Everything is up to date.${RESET}`); + printSummary(summary); + } + } catch (error) { + console.error(`${YELLOW}${BOLD}Error fixing redirects:${RESET}`, error); + process.exit(1); + } +} + +main().catch(error => { + console.error(`${YELLOW}${BOLD}Error in main process:${RESET}`, error); + process.exit(1); +}); \ No newline at end of file diff --git a/words.txt b/words.txt index f5ae76fb..0efd003b 100644 --- a/words.txt +++ b/words.txt @@ -10,7 +10,6 @@ Allnodes Allocs allocs ANDI -Ankr Apeworx Arweave authrpc @@ -150,7 +149,6 @@ holesky IERC IGNOREPRICE ignoreprice -Immunefi implicity Inator inator @@ -200,7 +198,6 @@ minsuggestedpriorityfee Mintable Mintplex MIPSEVM -Mitigations Monitorism Moralis Mordor @@ -295,8 +292,6 @@ Proxied Proxyd proxyd pseudorandomly -Pyth -Pyth's QRNG Quicknode quicknode @@ -331,9 +326,6 @@ safedb Schnorr secp SELFDESTRUCT -SEPOLIA -Sepolia -sepolia seqnr SEQUENCERHTTP sequencerhttp @@ -404,7 +396,6 @@ VMDEBUG vmdebug VMODULE vmodule -voxel Warpcast xlarge XORI From dc23b5e5e42b37563f61a09485f55dd137d51a73 Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 15 Nov 2024 16:32:07 +0100 Subject: [PATCH 36/53] Documented the steps involved to automate the redirect --- notes/fix-redirects.md | 83 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 notes/fix-redirects.md diff --git a/notes/fix-redirects.md b/notes/fix-redirects.md new file mode 100644 index 00000000..206c09c8 --- /dev/null +++ b/notes/fix-redirects.md @@ -0,0 +1,83 @@ +# Redirect links management guide + +## Scripts overview +Two scripts help maintain internal links when pages are redirect: + +* `check-redirects`: Identifies links that need updating based on the `_redirects` file. +* `fix-redirects`: Automatically updates links to match `_redirects` entries. + +## Checking for broken links + +Run the check script: + +```bash +pnpm check-redirects //OR +pnpm lint +``` +## What it does + +* Scans all `.mdx` files in the docs +* Compares internal links against `_redirects` file +* Reports any outdated links that need updating +* Provides a summary of total, broken, and valid links + +## Example output + +```bash +File "builders/overview.mdx" contains outdated link "/chain/overview" - should be updated to "/stack/overview" + +Summary: +Total pages πŸ” - 50 +Pages broken 🚫 - 2 +Pages OK βœ… - 48 + +``` + +## Fixing broken links + +Fix links automatically: + +```bash +pnpm fix-redirects //OR +pnpm fix +``` + +## What it does + +* Updates all internal links to match `_redirects` entries +* Preserves other content and formatting +* Shows which files and links were updated +* Provides a summary of changes made + +## Example output + +```bash +Fixed in "builders/overview.mdx": /chain/overview β†’ /stack/overview + +Summary: +Total files πŸ” - 50 +Files fixed βœ… - 2 +Files skipped ⏭️ - 48 +``` + +## Best practices + +1. Before running + + * Commit current changes + * Review `_redirects` file is up-to-date + * Run `check-redirects` first to preview changes + + +2. After running + + * Review git diff of updated files + * Test updated links locally + * Commit changes with descriptive message + + + +## Common issues + +* Script fails: Ensure `_redirects` file exists in public folder, it should always be there! +* No broken links found: Verify `_redirects` entries are correct. \ No newline at end of file From 11f7939892e468e03fdf63af11b0a3ae37d9b4db Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 15 Nov 2024 16:35:50 +0100 Subject: [PATCH 37/53] revert changes made in lychee --- lychee.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/lychee.toml b/lychee.toml index 9ecd097e..adae3d22 100644 --- a/lychee.toml +++ b/lychee.toml @@ -13,9 +13,6 @@ remap = [ "file:///(.*?)/pages/img/(.*) file:///$1/public/img/$2", "file:///(.*?)/pages/resources/(.*) file:///$1/public/resources/$2", "file:///([^#.?]+)(#.*)?$ file:///$1.mdx$2", - "file:///([^#]+)#.*$ file:///$1.mdx", - "/([^#]+)#.*$ file:///pages/$1.mdx", - "^/([^#]+)$ file:///pages/$1.mdx", "\\\\& &" ] From 7458aef9067ed3393a8c305b84ddb7e1f08ee0c8 Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 15 Nov 2024 16:37:43 +0100 Subject: [PATCH 38/53] revert previous changes to lychee file --- lychee.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/lychee.toml b/lychee.toml index adae3d22..73b34c1e 100644 --- a/lychee.toml +++ b/lychee.toml @@ -27,9 +27,6 @@ exclude_loopback = true # Exclude all mail addresses from checking. exclude_mail = true -# Exclude all external links except ethereum-optimism GitHub -exclude_links = ['http[s]?://(?!github\.com/ethereum-optimism).*'] - # Exclude RPC URLs from checking. exclude = [ 'https://mainnet.optimism.io', From 071e411e96464cda12023b786fb5d0fd587ae5e8 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Fri, 15 Nov 2024 17:20:15 +0100 Subject: [PATCH 39/53] Update notes/fix-redirects.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- notes/fix-redirects.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes/fix-redirects.md b/notes/fix-redirects.md index 206c09c8..1bcb28af 100644 --- a/notes/fix-redirects.md +++ b/notes/fix-redirects.md @@ -1,7 +1,7 @@ # Redirect links management guide ## Scripts overview -Two scripts help maintain internal links when pages are redirect: +Two scripts help maintain internal links when pages are redirected: * `check-redirects`: Identifies links that need updating based on the `_redirects` file. * `fix-redirects`: Automatically updates links to match `_redirects` entries. From 4a791af0dedb739087047c6ff53263f4a312fd28 Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 15 Nov 2024 18:22:39 +0100 Subject: [PATCH 40/53] fix lint issues --- next-env.d.ts | 2 +- words.txt | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03d..a4a7b3f5 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. diff --git a/words.txt b/words.txt index 0efd003b..f5ae76fb 100644 --- a/words.txt +++ b/words.txt @@ -10,6 +10,7 @@ Allnodes Allocs allocs ANDI +Ankr Apeworx Arweave authrpc @@ -149,6 +150,7 @@ holesky IERC IGNOREPRICE ignoreprice +Immunefi implicity Inator inator @@ -198,6 +200,7 @@ minsuggestedpriorityfee Mintable Mintplex MIPSEVM +Mitigations Monitorism Moralis Mordor @@ -292,6 +295,8 @@ Proxied Proxyd proxyd pseudorandomly +Pyth +Pyth's QRNG Quicknode quicknode @@ -326,6 +331,9 @@ safedb Schnorr secp SELFDESTRUCT +SEPOLIA +Sepolia +sepolia seqnr SEQUENCERHTTP sequencerhttp @@ -396,6 +404,7 @@ VMDEBUG vmdebug VMODULE vmodule +voxel Warpcast xlarge XORI From ccf131300a7dadeea31bb2ccebf646ba5ab21d4f Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 15 Nov 2024 18:24:31 +0100 Subject: [PATCH 41/53] update the command --- notes/fix-redirects.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/notes/fix-redirects.md b/notes/fix-redirects.md index 1bcb28af..fdb47fdb 100644 --- a/notes/fix-redirects.md +++ b/notes/fix-redirects.md @@ -11,8 +11,8 @@ Two scripts help maintain internal links when pages are redirected: Run the check script: ```bash -pnpm check-redirects //OR -pnpm lint +pnpm lint //OR +pnpm check-redirects ``` ## What it does @@ -38,8 +38,8 @@ Pages OK βœ… - 48 Fix links automatically: ```bash -pnpm fix-redirects //OR -pnpm fix +pnpm fix //OR +pnpm fix-redirects ``` ## What it does From 5148ca95103eab4fef53998bb133f59891c42ff9 Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 15 Nov 2024 18:36:30 +0100 Subject: [PATCH 42/53] revert changes --- next-env.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/next-env.d.ts b/next-env.d.ts index a4a7b3f5..4f11a03d 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. +// see https://nextjs.org/docs/basic-features/typescript for more information. From f902d7e5731207213f7aee1175dbc6273ea32882 Mon Sep 17 00:00:00 2001 From: Bryer <0xbryer@gmail.com> Date: Sun, 17 Nov 2024 11:45:43 +0200 Subject: [PATCH 43/53] Typo Update OpProposerDescriptionShort.md Fix incorrect preposition in the description of op-proposer service --- content/OpProposerDescriptionShort.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/OpProposerDescriptionShort.md b/content/OpProposerDescriptionShort.md index 08f3f928..babd3da5 100644 --- a/content/OpProposerDescriptionShort.md +++ b/content/OpProposerDescriptionShort.md @@ -1 +1 @@ -`op-proposer` is the service that submits the output roots to the L1. This is to enable trustless execution of L2-to-L1 messaging and creates the view into the L2 state from the L1's perspective. \ No newline at end of file +`op-proposer` is the service that submits the output roots to the L1. This is to enable trustless execution of L2-to-L1 messaging and creates the view of the L2 state from the L1's perspective. From 7e3ac407a2383be669970e7312ab70a4620348b6 Mon Sep 17 00:00:00 2001 From: codeesura <120671243+codeesura@users.noreply.github.com> Date: Fri, 15 Nov 2024 22:04:31 +0300 Subject: [PATCH 44/53] docs: fix SuperchainERC20 deployment guide URL --- pages/stack/interop/assets/superchain-erc20.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/assets/superchain-erc20.mdx b/pages/stack/interop/assets/superchain-erc20.mdx index fab6af88..0fb654df 100644 --- a/pages/stack/interop/assets/superchain-erc20.mdx +++ b/pages/stack/interop/assets/superchain-erc20.mdx @@ -81,7 +81,7 @@ Application developers must do two things to make their tokens `SuperchainERC20` For now, application developers should view `SuperchainERC20`as ERC20 tokens with additional built-in functions that allow cross-chain asset movement that will be enabled once Interop goes live. -For step-by-step information on implementing SuperchainERC20, see [Deploy assets using SuperchainERC20](/stack/interop/deploy-superchain-erc20) +For step-by-step information on implementing SuperchainERC20, see [Deploy assets using SuperchainERC20](/stack/interop/assets/deploy-superchain-erc20) To enable asset interoperability, `SuperchainERC20` must give access to the address where the future `SuperchainERC20Bridge` will live. From 21b3dc556359a00973ab27c20e564f1483cc7a31 Mon Sep 17 00:00:00 2001 From: Yusuf Kehinde Hussein <41796074+brokewhale@users.noreply.github.com> Date: Tue, 19 Nov 2024 09:41:02 +0100 Subject: [PATCH 45/53] Update rollup.mdx updated the l2BlockTime to < from <= --- pages/builders/chain-operators/configuration/rollup.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/builders/chain-operators/configuration/rollup.mdx b/pages/builders/chain-operators/configuration/rollup.mdx index 323b0f85..52600572 100644 --- a/pages/builders/chain-operators/configuration/rollup.mdx +++ b/pages/builders/chain-operators/configuration/rollup.mdx @@ -257,7 +257,7 @@ These fields apply to L2 blocks: Their timing, when they need to be written to L #### l2BlockTime -Number of seconds between each L2 block. Must be \< = L1 block time (12 on mainnet and Sepolia). +Number of seconds between each L2 block. Must be \< L1 block time (12 on mainnet and Sepolia). * **Type:** Number of seconds * **Default value:** None From e9e04e5dfeb2460e519ef6279bb402ee2688898b Mon Sep 17 00:00:00 2001 From: Hopium <135053852+Hopium21@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:44:06 +0100 Subject: [PATCH 46/53] Update addresses.mdx --- pages/chain/addresses.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/chain/addresses.mdx b/pages/chain/addresses.mdx index eb1e0d7e..b768b476 100644 --- a/pages/chain/addresses.mdx +++ b/pages/chain/addresses.mdx @@ -15,7 +15,7 @@ This reference guide lists all the contract addresses for Mainnet and Testnet, a See the [Smart Contracts Overview](/stack/smart-contracts) for high-level details and access to the source code. -This page is automatically generated from packages in the [superchain-registry](https://github.com/ethereum-optimism/superchain-registry/tree/main) which keeps the content synched and up-to-date. +This page is automatically generated from packages in the [superchain-registry](https://github.com/ethereum-optimism/superchain-registry/tree/main) which keeps the content synced and up-to-date. ## Mainnet From b7814fae4933a406ba0f91e4be5a4606bb562e4e Mon Sep 17 00:00:00 2001 From: Hopium <135053852+Hopium21@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:45:23 +0100 Subject: [PATCH 47/53] Update security-policy.mdx --- pages/chain/security/security-policy.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/chain/security/security-policy.mdx b/pages/chain/security/security-policy.mdx index 661a510a..1e50b509 100644 --- a/pages/chain/security/security-policy.mdx +++ b/pages/chain/security/security-policy.mdx @@ -11,7 +11,7 @@ import { Callout } from 'nextra/components' This page describes general best practices for reporting bugs and provides specific reporting guidelines for OP Stack and OP Mainnet code contained within the [ethereum-optimism](https://github.com/ethereum-optimism) GitHub organization. - **Do not** disclose vulnerabilities publicly or by executing them against a production network. If you do, will you not only be putting users at risk, but you will forfeit your right to a reward. Always follow the appropriate reporting pathways as described below. + **Do not** disclose vulnerabilities publicly or by executing them against a production network. If you do, you will not only be putting users at risk, but you will forfeit your right to a reward. Always follow the appropriate reporting pathways as described below. * **Do not** disclose the vulnerability publicly, for example by filing a public ticket. * **Do not** test the vulnerability on a publicly available network, either the testnet or the mainnet. From b05ddc5e6b184d126cc245f275029806845bad88 Mon Sep 17 00:00:00 2001 From: Hopium <135053852+Hopium21@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:45:48 +0100 Subject: [PATCH 48/53] Update 404.mdx --- pages/404.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/404.mdx b/pages/404.mdx index ee0616b0..d3d50dda 100644 --- a/pages/404.mdx +++ b/pages/404.mdx @@ -1,7 +1,7 @@ --- title: Page Not Found lang: en-US -description: 404 page not found and directs users to submit an git issue. +description: 404 page not found and directs users to submit a git issue. --- # Page Not Found From 2390a3a5608cefac92a5525b7251d02bf9640f59 Mon Sep 17 00:00:00 2001 From: Hopium <135053852+Hopium21@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:46:57 +0100 Subject: [PATCH 49/53] Update index.mdx --- pages/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/index.mdx b/pages/index.mdx index fa4175cc..6d4853af 100644 --- a/pages/index.mdx +++ b/pages/index.mdx @@ -13,7 +13,7 @@ Information about the Optimism Collective's governance, community, and mission c ## Guides for builders -Whether you're a developer building a app on OP Mainnet, a node operator running an OP Mainnet node, or a chain operator launching your own OP Stack chain, you'll find everything you need to get started right here. +Whether you're a developer building an app on OP Mainnet, a node operator running an OP Mainnet node, or a chain operator launching your own OP Stack chain, you'll find everything you need to get started right here. } /> From 0cdd15a8d9ec84064f87c820144186fdb54e8970 Mon Sep 17 00:00:00 2001 From: soyboy <85043086+sbvegan@users.noreply.github.com> Date: Tue, 19 Nov 2024 20:04:08 +0800 Subject: [PATCH 50/53] Update pages/404.mdx --- pages/404.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/404.mdx b/pages/404.mdx index d3d50dda..0726bb9a 100644 --- a/pages/404.mdx +++ b/pages/404.mdx @@ -1,7 +1,7 @@ --- title: Page Not Found lang: en-US -description: 404 page not found and directs users to submit a git issue. +description: 404 page not found and directs users to submit a GitHub issue. --- # Page Not Found From 0e800258627005b42fb1a63bc30cad4176d682fa Mon Sep 17 00:00:00 2001 From: Yusuf Kehinde Hussein <41796074+brokewhale@users.noreply.github.com> Date: Tue, 19 Nov 2024 08:53:17 +0100 Subject: [PATCH 51/53] Update oracles.mdx tags --- pages/builders/tools/build/oracles.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/builders/tools/build/oracles.mdx b/pages/builders/tools/build/oracles.mdx index 77ba3a07..d3da77ea 100644 --- a/pages/builders/tools/build/oracles.mdx +++ b/pages/builders/tools/build/oracles.mdx @@ -2,6 +2,7 @@ title: Oracles lang: en-US description: Learn about different oracles and how you can use them to access offchain data onchain as well as random number generation. +tags: ["devops-tooling", "performance-tooling", "eng-devx"] --- import { Callout } from 'nextra/components' From e6d3bc32c18defaf28e3ba8419b894dd244e3779 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Tue, 19 Nov 2024 15:31:29 +0100 Subject: [PATCH 52/53] fix lint issues --- words.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/words.txt b/words.txt index f5ae76fb..01dad65f 100644 --- a/words.txt +++ b/words.txt @@ -80,6 +80,7 @@ Devnet devnet devnets Devnode +devx direnv DISABLETXPOOLGOSSIP disabletxpoolgossip From 4a9df6f9fe90c820c298a7f5671fd8e927357a35 Mon Sep 17 00:00:00 2001 From: saimeunt Date: Tue, 19 Nov 2024 16:43:55 +0100 Subject: [PATCH 53/53] Sync with latest README --- next-env.d.ts | 2 +- .../chain-operators/tools/op-scan.mdx | 52 +++++++++++-------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03d..a4a7b3f5 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. diff --git a/pages/builders/chain-operators/tools/op-scan.mdx b/pages/builders/chain-operators/tools/op-scan.mdx index f41f3245..2c658bec 100644 --- a/pages/builders/chain-operators/tools/op-scan.mdx +++ b/pages/builders/chain-operators/tools/op-scan.mdx @@ -8,8 +8,7 @@ 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. +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 focused on being lightweight so that anyone can run it locally next to an OP Stack devnet or any other compatible OP Stack based rollup. Check out the [OP Scan README](https://github.com/walnuthq/op-scan) for @@ -20,6 +19,12 @@ It's purpose built to be lightweight, so that anyone can run it locally next to # βš™οΈ Installation +### Getting Started Video + +[Here's a video walkthrough](https://www.loom.com/share/3b79f0b25e44443eb16d296aba021764) on how to launch the explorer locally configured for OP Sepolia testnet. + +### Required Dependencies + The app requires the following dependencies: ``` @@ -48,15 +53,15 @@ 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" +NEXT_PUBLIC_L1_RPC_URL="https://ethereum-sepolia-rpc.publicnode.com" +NEXT_PUBLIC_L2_CHAIN_ID="11155420" +NEXT_PUBLIC_L2_NAME="OP Sepolia" +NEXT_PUBLIC_L2_RPC_URL="https://optimism-sepolia-rpc.publicnode.com" ``` -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 can get free node rpcs url by signing up to services such as [Alchemy](https://www.alchemy.com/), [Infura](https://www.infura.io/) or [QuickNode](https://www.quicknode.com/). -You will also need to provide your L1 contracts addresses: +You will also need to provide your L1 contracts addresses when using a devnet: ``` NEXT_PUBLIC_OPTIMISM_PORTAL_ADDRESS="..." @@ -66,22 +71,22 @@ 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 don't want to run the explorer with your local chain setup, you will find all the necessary environment variables 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="..." +NEXT_PUBLIC_REOWN_PROJECT_ID="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): +To run the indexer, you first need to setup your `DATABASE_URL` in `.env.local` (we use SQLite by default but you can switch to PostgreSQL by changing the Prisma provider in `prisma/schema.prisma`) as well as websocket connections to your L1/L2 chains: ``` 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" +L1_RPC_WS="wss://ethereum-sepolia-rpc.publicnode.com" +L2_RPC_WS="wss://optimism-sepolia-rpc.publicnode.com" ``` Then you can sync your local database with the Prisma schema: @@ -90,7 +95,6 @@ Then you can sync your local database with the Prisma schema: 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 @@ -111,15 +115,19 @@ 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: +When indexing non-local chains you will probably encounter 429 errors related to rate-limiting, you may provide up to 5 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" +NEXT_PUBLIC_L1_FALLBACK1_RPC_URL="https://rpc.ankr.com/eth_sepolia" +NEXT_PUBLIC_L2_FALLBACK1_RPC_URL="https://rpc.ankr.com/optimism_sepolia" +NEXT_PUBLIC_L1_FALLBACK2_RPC_URL="https://endpoints.omniatech.io/v1/eth/sepolia/public" +NEXT_PUBLIC_L2_FALLBACK2_RPC_URL="https://endpoints.omniatech.io/v1/op/sepolia/public" +NEXT_PUBLIC_L1_FALLBACK3_RPC_URL="https://sepolia.drpc.org" +NEXT_PUBLIC_L2_FALLBACK3_RPC_URL="https://optimism-sepolia.drpc.org" +NEXT_PUBLIC_L1_FALLBACK4_RPC_URL="https://eth-sepolia.g.alchemy.com/v2/FALLBACK4_API_KEY" +NEXT_PUBLIC_L2_FALLBACK4_RPC_URL="https://opt-sepolia.g.alchemy.com/v2/FALLBACK4_API_KEY" +NEXT_PUBLIC_L1_FALLBACK5_RPC_URL="https://sepolia.infura.io/v3/FALLBACK5_API_KEY" +NEXT_PUBLIC_L2_FALLBACK5_RPC_URL="https://optimism-sepolia.infura.io/v3/FALLBACK5_API_KEY" ``` You can pass several parameters to the indexer to control the indexing range and execution: @@ -150,7 +158,7 @@ Make sure your local chain is started and the indexer is running, then launch th pnpm start ``` -Alternatively you can launch the explorer in dev mode if you want to customize it +Alternatively you can launch the explorer in dev mode if you want to customize it: ```sh pnpm dev