From c4372a58bf28b367ae0d98c1999002e002868aa1 Mon Sep 17 00:00:00 2001 From: syntrust Date: Thu, 5 Dec 2024 16:40:26 +0800 Subject: [PATCH 1/8] fix comments in demo --- ethstorage/archiver/guide-devnet.md | 53 +++++++++++++++-------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/ethstorage/archiver/guide-devnet.md b/ethstorage/archiver/guide-devnet.md index 2a1019dd..c7ef28dd 100644 --- a/ethstorage/archiver/guide-devnet.md +++ b/ethstorage/archiver/guide-devnet.md @@ -9,9 +9,10 @@ - [Fill Out Environment Variables](#fill-out-environment-variables) 2. [L1 Setup](#l1-setup) - [Starting L1](#starting-l1) + - [Running a Proxy of L1 Beacon to Mock Short Retention Period of Blobs](#running-a-proxy-of-l1-beacon-to-mock-short-retention-period-of-blobs) +3. [Deploying Contracts](#deploying-contracts) - [Deploying EthStorage Contracts](#deploying-ethstorage-contracts) - - [Deploy BatchInbox](#deploy-batchinbox) - - [Running a Proxy of L1 Beacon](#running-a-proxy-of-l1-beacon) + - [Deploying BatchInbox Contract](#deploying-batchinbox-contract) 3. [Running EthStorage Node](#running-ethstorage-node) - [Installation](#installation) - [Initialization](#initialization) @@ -115,6 +116,19 @@ This command will start the following services: Now, navigate to the parent directory in preparation for the next steps. +### Running a Proxy of L1 Beacon to Mock Short Retention Period of Blobs + +The following commands start a proxy to Beacon API with a shorter blobs retension period: +```bash +git clone https://github.com/ethstorage/beacon-api-wrapper.git +cd beacon-api-wrapper +go run cmd/main.go -b http://localhost:5052 -p 3602 -g $GENESIS_TIME -r 2 +``` +If a blob request is within the latest 2 epochs or 64 slots, the proxy will retrieve blobs from `http://localhost:5052`. For requests older than that, it will return an empty list. +This setup allows you to test archive service effectively. + +## Deploying Contracts + ### Deploying EthStorage Contracts Begin by cloning the EthStorage contract repository and install the dependencies: @@ -122,7 +136,7 @@ Begin by cloning the EthStorage contract repository and install the dependencies git clone https://github.com/ethstorage/storage-contracts-v1.git cd storage-contracts-v1 git checkout op-devnet -npm install +npm run install:all ``` Create a `.env` file and populate it with the following content: @@ -142,7 +156,7 @@ export ES_CONTRACT=0x9B75f686F348d18AF9A4b98e0290D24350d742c4 # replace with th ``` Now, navigate to the parent directory in preparation for the next steps. -### Deploy BatchInbox +### Deploying BatchInbox Contract Clone and build the BatchInbox contract: ```bash @@ -182,28 +196,6 @@ Update the value of `batchInboxAddress` with the address of the contract you jus Now, navigate to the parent directory in preparation for the next steps. -### Running a Proxy of L1 Beacon - -For the convenience of testing, you will start a proxy for the Beacon API with a shorter blob retention period. - -First retrieve the beacon genesis time for later use: -```bash -curl -s http://localhost:5052/eth/v1/beacon/genesis | jq -r '.data.genesis_time' - -1732529739 - -export GENESIS_TIME=1732529739 // replace with the actual timestamp -``` - -The following commands start a proxy to Beacon API with a shorter blobs retension period: -```bash -git clone https://github.com/ethstorage/beacon-api-wrapper.git -cd beacon-api-wrapper -go run cmd/main.go -b http://localhost:5052 -p 3602 -g $GENESIS_TIME -r 1200 -``` -This setup allows you to test archive service effectively. -For blob requests, if the request is within the latest 1200 seconds or 100 slots, the proxy will retrieve blobs from `http://localhost:5052`. For requests older than that, it will return an empty list. - ## Running EthStorage Node @@ -228,6 +220,15 @@ Initialize es-node: ### Running ES Node in Archiver Mode +Retrieve the beacon genesis time for later use: +```bash +curl -s http://localhost:5052/eth/v1/beacon/genesis | jq -r '.data.genesis_time' + +1732529739 + +export GENESIS_TIME=1732529739 // replace with the actual timestamp +``` + Finally, run the es-node: ```bash From 1d0f7c2c445ee23b5c8c20baaaa889df1b97fcad Mon Sep 17 00:00:00 2001 From: syntrust Date: Thu, 5 Dec 2024 17:22:12 +0800 Subject: [PATCH 2/8] fix comments --- ethstorage/archiver/guide-devnet.md | 143 +++++++++++++++------------- 1 file changed, 76 insertions(+), 67 deletions(-) diff --git a/ethstorage/archiver/guide-devnet.md b/ethstorage/archiver/guide-devnet.md index c7ef28dd..5acef777 100644 --- a/ethstorage/archiver/guide-devnet.md +++ b/ethstorage/archiver/guide-devnet.md @@ -13,16 +13,17 @@ 3. [Deploying Contracts](#deploying-contracts) - [Deploying EthStorage Contracts](#deploying-ethstorage-contracts) - [Deploying BatchInbox Contract](#deploying-batchinbox-contract) -3. [Running EthStorage Node](#running-ethstorage-node) - - [Installation](#installation) - - [Initialization](#initialization) - - [Running ES Node in Archiver Mode](#running-es-node-in-archiver-mode) 4. [L2 Setup](#l2-setup) - [Running L2](#running-l2) - [Starting OP Geth](#starting-op-geth) - - [Starting the OP Node](#starting-the-op-node) -5. [Verifying Sync Status](#verifying-sync-status) -6. [Conclusion](#conclusion) + - [Starting OP Node](#starting-op-node) +5. [Running EthStorage Node](#running-ethstorage-node) + - [Installation](#installation) + - [Initialization](#initialization) + - [Running ES Node in Archiver Mode](#running-es-node-in-archiver-mode) +6. [Restarting OP Node With the Archiver Configured](#restarting-op-node-with-the-archiver-configured) +7. [Verifying Sync Status](#verifying-sync-status) +8. [Conclusion](#conclusion) ## Introduction @@ -196,61 +197,6 @@ Update the value of `batchInboxAddress` with the address of the contract you jus Now, navigate to the parent directory in preparation for the next steps. -## Running EthStorage Node - - -### Installation - -To set up the es-node, first clone the repository and build it: -```bash -git clone https://github.com/ethstorage/es-node.git -cd es-node -git checkout v0.1.16 -make -``` - -### Initialization - -Initialize es-node: -```bash -./init-rpc.sh \ ---l1.rpc http://localhost:8545 \ ---storage.l1contract $ES_CONTRACT -``` - -### Running ES Node in Archiver Mode - -Retrieve the beacon genesis time for later use: -```bash -curl -s http://localhost:5052/eth/v1/beacon/genesis | jq -r '.data.genesis_time' - -1732529739 - -export GENESIS_TIME=1732529739 // replace with the actual timestamp -``` - -Finally, run the es-node: - -```bash -./run-rpc.sh \ ---storage.l1contract $ES_CONTRACT \ ---l1.rpc http://localhost:8545 \ ---l1.beacon http://localhost:5052 \ ---l1.beacon-based-time $GENESIS_TIME \ ---l1.beacon-based-slot 0 \ ---p2p.listen.udp 30375 \ ---p2p.listen.tcp 9733 \ ---rpc.port 9745 \ ---archiver.port 6678 \ ---archiver.enabled -``` - -Shortly after the es-node starts, it will listen for the storage contract, download all blobs managed by the contract, and store them locally. In this instance, it collects all the blobs received by the BatchInbox contract. The es-node also serve blob queries in the format `/eth/v1/beacon/blob_sidecars/{slot}` on port 6678, similar to the Beacon API. - -Please note that this is a simplified version of the es-node designed solely for data access. In a standard EthStorage network, a p2p network is formed by storage providers who secure the data using a sophisticated proof-of-storage algorithm. For detailed information, please refer to [the documentation](docs.ethstorage.io). - -Now, navigate to the parent directory in preparation for the next steps. - ## L2 Setup ### Running L2 @@ -324,7 +270,7 @@ Start the OP Geth process: Now, navigate to the parent directory in preparation for the next steps. -### Starting the OP Node +### Starting OP Node Enter the Optimism monorepo and execute the following commands to start op-node as a validator: @@ -343,17 +289,80 @@ make op-node --rpc.enable-admin \ --l1=$L1_RPC_URL \ --l1.rpckind=$L1_RPC_KIND \ - --l1.beacon=http://localhost:3602 \ - --l1.beacon-archiver http://localhost:6678 + --l1.beacon=http://localhost:3602 ``` **Note:** 1. P2P is disabled so that it can only sync data from L1. 2. The L1 beacon URL is directed to the beacon proxy, where blobs expire quickly. -3. The beacon archiver is configured to point to the es-node archive service. -## Verifying Sync Status +You can observe that the validator node is unable to sync properly because it cannot retrieve expired blobs. The next steps are to set up an EthStorage node to store the expired blobs for the rollup. +Now, navigate to the parent directory in preparation for the next steps. + +## Running EthStorage Node + +### Installation + +To set up the es-node, first clone the repository and build it: +```bash +git clone https://github.com/ethstorage/es-node.git +cd es-node +git checkout v0.1.16 +make +``` + +### Initialization + +Initialize es-node: +```bash +./init-rpc.sh \ +--l1.rpc http://localhost:8545 \ +--storage.l1contract $ES_CONTRACT +``` + +### Running ES Node in Archiver Mode + +Retrieve the beacon genesis time for later use: +```bash +curl -s http://localhost:5052/eth/v1/beacon/genesis | jq -r '.data.genesis_time' + +1732529739 + +export GENESIS_TIME=1732529739 // replace with the actual timestamp +``` + +Finally, run the es-node: + +```bash +./run-rpc.sh \ +--storage.l1contract $ES_CONTRACT \ +--l1.rpc http://localhost:8545 \ +--l1.beacon http://localhost:5052 \ +--l1.beacon-based-time $GENESIS_TIME \ +--l1.beacon-based-slot 0 \ +--p2p.listen.udp 30375 \ +--p2p.listen.tcp 9733 \ +--rpc.port 9745 \ +--archiver.port 6678 \ +--archiver.enabled +``` + +Shortly after the es-node starts, it will listen for the storage contract, download all blobs managed by the contract, and store them locally. In this instance, it collects all the blobs received by the BatchInbox contract. The es-node also serve blob queries in the format `/eth/v1/beacon/blob_sidecars/{slot}` on port 6678, similar to the Beacon API. + +Please note that this is a simplified version of the es-node designed solely for data access. In a standard EthStorage network, a p2p network is formed by storage providers who secure the data using a sophisticated proof-of-storage algorithm. For detailed information, please refer to [the documentation](docs.ethstorage.io). + + +## Restarting OP Node With the Archiver Configured + +Enter the Optimism monorepo, stop the running op-node, and re-start op-node with the same command in [this section](#starting-op-node) but with an extra option: + +```bash +--l1.beacon-archiver http://localhost:6678 +``` +Note that the beacon archiver is configured to point to the es-node archive service. + +## Verifying Sync Status During the synchronization process, you can check that the validator node queries expired blobs from the es-node archive service. You may need to temporarily stop the validator node to allow the blobs to expire. From 78f562fc2cabe45b541efbb3969ea81a4fb04cf4 Mon Sep 17 00:00:00 2001 From: syntrust Date: Thu, 5 Dec 2024 18:04:11 +0800 Subject: [PATCH 3/8] fix comments --- ethstorage/archiver/guide-devnet.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ethstorage/archiver/guide-devnet.md b/ethstorage/archiver/guide-devnet.md index 5acef777..5723d9ab 100644 --- a/ethstorage/archiver/guide-devnet.md +++ b/ethstorage/archiver/guide-devnet.md @@ -216,9 +216,7 @@ This command will start the following services: Now, navigate to the parent directory in preparation for the next steps. -The following steps will add an additional OP Stack instance in validator mode, configured to sync expired blob data from the es-node. This aims to verify that the functions of the derivation pipeline are working correctly with the BatchInbox contract and the EthStorage archive service. - -Note: To ensure that the new OP Stack instance is genuinely derived from the "expired" blobs stored by EthStorage, you may need to wait for at least 100 slots before starting the next steps. +The following steps will add an additional OP Stack instance in validator mode only download blobs from the Beacon API proxy at first. ### Starting OP Geth @@ -272,6 +270,8 @@ Now, navigate to the parent directory in preparation for the next steps. ### Starting OP Node +Note: To ensure that the new OP Stack instance is trying to derived from the "expired" blobs, you may need to wait for at least 64 slots before starting the next steps, according to the setting of the Beacon proxy. + Enter the Optimism monorepo and execute the following commands to start op-node as a validator: ```bash @@ -296,7 +296,7 @@ make op-node 1. P2P is disabled so that it can only sync data from L1. 2. The L1 beacon URL is directed to the beacon proxy, where blobs expire quickly. -You can observe that the validator node is unable to sync properly because it cannot retrieve expired blobs. The next steps are to set up an EthStorage node to store the expired blobs for the rollup. +You can observe that the validator node is unable to sync properly with "derivation failed" error due to "failed to fetch blobs". Now, navigate to the parent directory in preparation for the next steps. From 2842f45dec79dbcd12c8dd05c6a4c6ad16e67982 Mon Sep 17 00:00:00 2001 From: syntrust Date: Fri, 6 Dec 2024 10:10:14 +0800 Subject: [PATCH 4/8] fix comments --- ethstorage/archiver/guide-devnet.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ethstorage/archiver/guide-devnet.md b/ethstorage/archiver/guide-devnet.md index 5723d9ab..7ab12f04 100644 --- a/ethstorage/archiver/guide-devnet.md +++ b/ethstorage/archiver/guide-devnet.md @@ -34,6 +34,8 @@ The test framework is based on the Bedrock devnet but allows for separate contro - The deployment of EthStorage contracts and BatchInbox contract that help to store batch data into EthStorage. - Launch an EthStorage node (es-node) in archiver mode. +You will have an intuitive experience and clear understanding of the difference made by EthStorage archive service as a long-term data availability solution. + ## Preparations ### Software Dependencies @@ -123,9 +125,9 @@ The following commands start a proxy to Beacon API with a shorter blobs retensio ```bash git clone https://github.com/ethstorage/beacon-api-wrapper.git cd beacon-api-wrapper -go run cmd/main.go -b http://localhost:5052 -p 3602 -g $GENESIS_TIME -r 2 +go run cmd/main.go -b http://localhost:5052 -p 3602 -r 3 ``` -If a blob request is within the latest 2 epochs or 64 slots, the proxy will retrieve blobs from `http://localhost:5052`. For requests older than that, it will return an empty list. +If a blob request is within the latest 3 epochs or 96 slots, the proxy will retrieve blobs from the Beacon URL (`http://localhost:5052`). For requests older than that, it will return an empty list. This setup allows you to test archive service effectively. ## Deploying Contracts @@ -331,6 +333,7 @@ curl -s http://localhost:5052/eth/v1/beacon/genesis | jq -r '.data.genesis_time' export GENESIS_TIME=1732529739 // replace with the actual timestamp ``` +Note: Before proceeding to the next step of launching the es-node, ensure that at least 2 epochs (approximately 13 minutes) have passed since the EthStorage contracts were deployed in [this step](#deploying-ethstorage-contracts), as the es-node needs to read the finalized states of the contract. Finally, run the es-node: From 20361de43bef0f31e6e8eb2ea9c3d482bc323b81 Mon Sep 17 00:00:00 2001 From: syntrust Date: Fri, 6 Dec 2024 10:11:15 +0800 Subject: [PATCH 5/8] update proxy --- ethstorage/archiver/guide-blob-test.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethstorage/archiver/guide-blob-test.md b/ethstorage/archiver/guide-blob-test.md index ca56ad32..7b1a6abc 100644 --- a/ethstorage/archiver/guide-blob-test.md +++ b/ethstorage/archiver/guide-blob-test.md @@ -36,10 +36,10 @@ To download and run a proxy for the Beacon client, execute the following command ```bash git clone https://github.com/ethstorage/beacon-api-wrapper.git cd beacon-api-wrapper -go run cmd/main.go -r 1800 +go run cmd/main.go -r 3 -b http://88.99.30.186:3500 ``` -This proxy functions like a standard Beacon API, except that it has a much shorter blob retention period—1800 seconds or 150 slots in this case. Consequently, when a `blob_sidecars` request is made for blobs older than this time frame, it will return an empty list: `{"data":[]}`. +This proxy functions like a standard Beacon API, except that it has a much shorter blob retention period - 3 epochs or 96 slots in this case. Consequently, when a `blob_sidecars` request is made for blobs older than this time frame, it will return an empty list: `{"data":[]}`. Note: The default RPC port for the mocked Beacon API is 3600. From a1441b6389138c583ed4798973c7851a3102182f Mon Sep 17 00:00:00 2001 From: syntrust Date: Fri, 6 Dec 2024 14:50:05 +0800 Subject: [PATCH 6/8] fix comments --- ethstorage/archiver/guide-devnet.md | 170 ++++++++++++++-------------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/ethstorage/archiver/guide-devnet.md b/ethstorage/archiver/guide-devnet.md index 7ab12f04..7e2d4395 100644 --- a/ethstorage/archiver/guide-devnet.md +++ b/ethstorage/archiver/guide-devnet.md @@ -1,29 +1,30 @@ # Testing OP Stack with EthStorage as Archive Service: A Step-by-Step Guide -[Introduction](#introduction) - -1. [Preparations](#preparations) - - [Software Dependencies](#software-dependencies) - - [Get the Correct Code Branch](#get-the-correct-code-branch) - - [Source of Gas](#source-of-gas) - - [Fill Out Environment Variables](#fill-out-environment-variables) -2. [L1 Setup](#l1-setup) - - [Starting L1](#starting-l1) - - [Running a Proxy of L1 Beacon to Mock Short Retention Period of Blobs](#running-a-proxy-of-l1-beacon-to-mock-short-retention-period-of-blobs) -3. [Deploying Contracts](#deploying-contracts) - - [Deploying EthStorage Contracts](#deploying-ethstorage-contracts) - - [Deploying BatchInbox Contract](#deploying-batchinbox-contract) -4. [L2 Setup](#l2-setup) - - [Running L2](#running-l2) - - [Starting OP Geth](#starting-op-geth) - - [Starting OP Node](#starting-op-node) -5. [Running EthStorage Node](#running-ethstorage-node) - - [Installation](#installation) - - [Initialization](#initialization) - - [Running ES Node in Archiver Mode](#running-es-node-in-archiver-mode) -6. [Restarting OP Node With the Archiver Configured](#restarting-op-node-with-the-archiver-configured) -7. [Verifying Sync Status](#verifying-sync-status) -8. [Conclusion](#conclusion) +## Table of Contents + +1. [Introduction](#introduction) +2. [Preparations](#preparations) + - 2.1 [Software Dependencies](#software-dependencies) + - 2.2 [Getting the Correct Code Branch](#getting-the-correct-code-branch) + - 2.3 [Source of Gas](#source-of-gas) + - 2.4 [Filling Out Environment Variables](#filling-out-environment-variables) +3. [L1 Setup](#l1-setup) + - 3.1 [Starting L1](#starting-l1) + - 3.2 [Running a Proxy of L1 Beacon to Mock Short Retention Period of Blobs](#running-a-proxy-of-l1-beacon-to-mock-short-retention-period-of-blobs) +4. [EthStorage Setup](#ethstorage-setup) + - 4.1 [Deploying EthStorage Contracts](#deploying-ethstorage-contracts) + - 4.2 [Building EthStorage Node](#building-ethstorage-node) + - 4.3 [Initializing EthStorage Node](#initializing-ethstorage-node) + - 4.4 [Running ES Node in Archiver Mode](#running-es-node-in-archiver-mode) +5. [L2 Setup](#l2-setup) + - 5.1 [Deploying BatchInbox Contract](#deploying-batchinbox-contract) + - 5.2 [Running L2](#running-l2) + - 5.3 [Starting OP Geth](#starting-op-geth) + - 5.4 [Starting OP Node](#starting-op-node) + - 5.5 [Restarting OP Node with the Archiver Configured](#restarting-op-node-with-the-archiver-configured) +6. [Verifying Sync Status](#verifying-sync-status) +7. [Conclusion](#conclusion) + ## Introduction @@ -52,7 +53,7 @@ You will have an intuitive experience and clear understanding of the difference | docker | ^27 | `docker --version` | -### Get the Correct Code Branch +### Getting the Correct Code Branch First clone the Optimism monorepo and check out the branch `long-term-da`: @@ -81,7 +82,7 @@ and store the private key in your environment: export PRIVATE_KEY=bf7604d9d3a1c7748642b1b7b05c2bd219c9faa91458b370f85e5a40f3b03af7 ``` -### Fill Out Environment Variables +### Filling Out Environment Variables To configure the environment variables, begin by copying the example configuration file: ``` @@ -130,7 +131,7 @@ go run cmd/main.go -b http://localhost:5052 -p 3602 -r 3 If a blob request is within the latest 3 epochs or 96 slots, the proxy will retrieve blobs from the Beacon URL (`http://localhost:5052`). For requests older than that, it will return an empty list. This setup allows you to test archive service effectively. -## Deploying Contracts +## EthStorage Setup ### Deploying EthStorage Contracts @@ -159,6 +160,61 @@ export ES_CONTRACT=0x9B75f686F348d18AF9A4b98e0290D24350d742c4 # replace with th ``` Now, navigate to the parent directory in preparation for the next steps. + +### Building EthStorage Node + +To set up the es-node, first clone the repository and build it: +```bash +git clone https://github.com/ethstorage/es-node.git +cd es-node +git checkout v0.1.16 +make +``` + +### Initializing EthStorage Node + +Initialize es-node: +```bash +./init-rpc.sh \ +--l1.rpc http://localhost:8545 \ +--storage.l1contract $ES_CONTRACT +``` + +### Running ES Node in Archiver Mode + +Retrieve the beacon genesis time for later use: +```bash +curl -s http://localhost:5052/eth/v1/beacon/genesis | jq -r '.data.genesis_time' + +1732529739 + +export GENESIS_TIME=1732529739 // replace with the actual timestamp +``` +Note: Before proceeding to the next step of launching the es-node, ensure that at least 2 epochs (approximately 13 minutes) have passed since the EthStorage contracts were deployed in [this step](#deploying-ethstorage-contracts), as the es-node needs to read the finalized states of the contract. + +Finally, run the es-node: + +```bash +./run-rpc.sh \ +--storage.l1contract $ES_CONTRACT \ +--l1.rpc http://localhost:8545 \ +--l1.beacon http://localhost:5052 \ +--l1.beacon-based-time $GENESIS_TIME \ +--l1.beacon-based-slot 0 \ +--p2p.listen.udp 30375 \ +--p2p.listen.tcp 9733 \ +--rpc.port 9745 \ +--archiver.port 6678 \ +--archiver.enabled +``` + +Shortly after the es-node starts, it will listen for the storage contract, download all blobs managed by the contract, and store them locally. In this instance, it collects all the blobs received by the BatchInbox contract. The es-node also serve blob queries in the format `/eth/v1/beacon/blob_sidecars/{slot}` on port 6678, similar to the Beacon API. + +Please note that this is a simplified version of the es-node designed solely for data access. In a standard EthStorage network, a p2p network is formed by storage providers who secure the data using a sophisticated proof-of-storage algorithm. For detailed information, please refer to [the documentation](docs.ethstorage.io). + + +## L2 Setup + ### Deploying BatchInbox Contract Clone and build the BatchInbox contract: @@ -199,11 +255,9 @@ Update the value of `batchInboxAddress` with the address of the contract you jus Now, navigate to the parent directory in preparation for the next steps. -## L2 Setup - ### Running L2 -Once again, enter the Optimism monorepo and start the Layer 2 environment by executing the following command: +Enter the Optimism monorepo and start the Layer 2 environment by executing the following command: ```bash make devnet-up-l2 ``` @@ -302,61 +356,7 @@ You can observe that the validator node is unable to sync properly with "derivat Now, navigate to the parent directory in preparation for the next steps. -## Running EthStorage Node - -### Installation - -To set up the es-node, first clone the repository and build it: -```bash -git clone https://github.com/ethstorage/es-node.git -cd es-node -git checkout v0.1.16 -make -``` - -### Initialization - -Initialize es-node: -```bash -./init-rpc.sh \ ---l1.rpc http://localhost:8545 \ ---storage.l1contract $ES_CONTRACT -``` - -### Running ES Node in Archiver Mode - -Retrieve the beacon genesis time for later use: -```bash -curl -s http://localhost:5052/eth/v1/beacon/genesis | jq -r '.data.genesis_time' - -1732529739 - -export GENESIS_TIME=1732529739 // replace with the actual timestamp -``` -Note: Before proceeding to the next step of launching the es-node, ensure that at least 2 epochs (approximately 13 minutes) have passed since the EthStorage contracts were deployed in [this step](#deploying-ethstorage-contracts), as the es-node needs to read the finalized states of the contract. - -Finally, run the es-node: - -```bash -./run-rpc.sh \ ---storage.l1contract $ES_CONTRACT \ ---l1.rpc http://localhost:8545 \ ---l1.beacon http://localhost:5052 \ ---l1.beacon-based-time $GENESIS_TIME \ ---l1.beacon-based-slot 0 \ ---p2p.listen.udp 30375 \ ---p2p.listen.tcp 9733 \ ---rpc.port 9745 \ ---archiver.port 6678 \ ---archiver.enabled -``` - -Shortly after the es-node starts, it will listen for the storage contract, download all blobs managed by the contract, and store them locally. In this instance, it collects all the blobs received by the BatchInbox contract. The es-node also serve blob queries in the format `/eth/v1/beacon/blob_sidecars/{slot}` on port 6678, similar to the Beacon API. - -Please note that this is a simplified version of the es-node designed solely for data access. In a standard EthStorage network, a p2p network is formed by storage providers who secure the data using a sophisticated proof-of-storage algorithm. For detailed information, please refer to [the documentation](docs.ethstorage.io). - - -## Restarting OP Node With the Archiver Configured +### Restarting OP Node With the Archiver Configured Enter the Optimism monorepo, stop the running op-node, and re-start op-node with the same command in [this section](#starting-op-node) but with an extra option: From ac796350bc9f060d2ca7f0beb0f895d643eb6214 Mon Sep 17 00:00:00 2001 From: syntrust Date: Fri, 6 Dec 2024 15:23:15 +0800 Subject: [PATCH 7/8] navigation directories --- ethstorage/archiver/guide-devnet.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ethstorage/archiver/guide-devnet.md b/ethstorage/archiver/guide-devnet.md index b4b79bb2..448b318b 100644 --- a/ethstorage/archiver/guide-devnet.md +++ b/ethstorage/archiver/guide-devnet.md @@ -131,6 +131,8 @@ go run cmd/main.go -b http://localhost:5052 -p 3602 -r 3 If a blob request is within the latest 3 epochs or 96 slots, the proxy will retrieve blobs from the Beacon URL (`http://localhost:5052`). For requests older than that, it will return an empty list. This setup allows you to test the archive service effectively. +Now, navigate to the parent directory in preparation for the next steps. + ## EthStorage Setup ### Deploying EthStorage Contracts @@ -213,6 +215,7 @@ Shortly after the es-node starts, it will listen for the storage contract, downl Please note that this is a simplified version of the es-node designed solely for data access. In a standard EthStorage network, a p2p network is formed by storage providers who secure the data using a sophisticated proof-of-storage algorithm. For detailed information, please refer to [the documentation](docs.ethstorage.io). +Now, navigate to the parent directory in preparation for the next steps. ## L2 Setup @@ -258,11 +261,9 @@ Finally, navigate to the Optimism monorepo and locate `batchInboxAddress` in the ``` Update the value of `batchInboxAddress` with the address of the contract you just deployed. -Now, navigate to the parent directory in preparation for the next steps. - ### Running L2 -Enter the Optimism monorepo and start the Layer 2 environment by executing the following command: +In the Optimism monorepo, start the Layer 2 environment by executing the following command: ```bash make devnet-up-l2 ``` @@ -331,7 +332,7 @@ Now, navigate to the parent directory in preparation for the next steps. ### Starting OP Node -Note: To ensure that the new OP Stack instance is trying to derived from the "expired" blobs, you may need to wait for at least 64 slots before starting the next steps, according to the setting of the Beacon proxy. +Note: To ensure that the new OP Stack instance is trying to derived from the "expired" blobs, you may need to wait for at least 96 slots before starting the next steps, according to the setting of the Beacon proxy. Enter the Optimism monorepo and execute the following commands to start op-node as a validator: @@ -357,13 +358,11 @@ make op-node 1. P2P is disabled so that it can only sync data from L1. 2. The L1 beacon URL is directed to the beacon proxy, where blobs expire quickly. -You can observe that the validator node is unable to sync properly with "derivation failed" error due to "failed to fetch blobs". - -Now, navigate to the parent directory in preparation for the next steps. +You can observe that the validator node is unable to sync properly with "derivation failed" error due to "failed to fetch blobs", which is a expected result because there is no way to retreive the expired blobs. ### Restarting OP Node With the Archiver Configured -Enter the Optimism monorepo, stop the running op-node, and re-start op-node with the same command in [this section](#starting-op-node) but with an extra option: +Now, stop the running op-node, and re-start op-node with the same command in [the last step](#starting-op-node) but with an extra option: ```bash --l1.beacon-archiver http://localhost:6678 From 7aad61fabec47d35f3307184bf3e06a214b7e9dc Mon Sep 17 00:00:00 2001 From: syntrust Date: Fri, 6 Dec 2024 15:24:57 +0800 Subject: [PATCH 8/8] minor --- ethstorage/archiver/guide-devnet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethstorage/archiver/guide-devnet.md b/ethstorage/archiver/guide-devnet.md index 448b318b..59396930 100644 --- a/ethstorage/archiver/guide-devnet.md +++ b/ethstorage/archiver/guide-devnet.md @@ -358,7 +358,7 @@ make op-node 1. P2P is disabled so that it can only sync data from L1. 2. The L1 beacon URL is directed to the beacon proxy, where blobs expire quickly. -You can observe that the validator node is unable to sync properly with "derivation failed" error due to "failed to fetch blobs", which is a expected result because there is no way to retreive the expired blobs. +You can observe that the validator node is unable to sync properly with "derivation failed" error due to "failed to fetch blobs", which is an expected result because there is no way to retreive the expired blobs. ### Restarting OP Node With the Archiver Configured