From 225a9e92e25bc2008a47a7e64891cf7e6a44aad4 Mon Sep 17 00:00:00 2001 From: piersy Date: Fri, 27 Sep 2024 20:45:52 +0100 Subject: [PATCH] Switch operator instructions ordering (#1504) This changes the node operator instructions so that op-geth is executed before op-node, ensuring that op-node won't fail when executed because it can't find op-geth. Also removes the step to manually create the jwt token because op-geth will do this automatically if no token is found at the configured path. --- docs/cel2/l2-operator-guide.md | 126 ++++++++++++++++----------------- 1 file changed, 61 insertions(+), 65 deletions(-) diff --git a/docs/cel2/l2-operator-guide.md b/docs/cel2/l2-operator-guide.md index af4cc34d07..8a2f921cbf 100644 --- a/docs/cel2/l2-operator-guide.md +++ b/docs/cel2/l2-operator-guide.md @@ -63,8 +63,8 @@ To set up your node, you'll need to run three services: `op-node`, `op-geth`, an If you plan to run multiple L2 nodes, you’ll need separate instances of `op-node` and `op-geth` for each node, but you can share a single instance of `eigenda-proxy`. Additionally, you'll need an endpoint for the L1 RPC, which can either be a public node or your own L1 node. For Alfajores, the L1 used is [Holesky](https://chainlist.org/chain/17000). - [Running EigenDA Proxy](#running-eigenda-proxy) -- [Running op-node](#running-op-node) - [Running op-geth](#running-op-geth) +- [Running op-node](#running-op-node) ### Running EigenDA Proxy @@ -135,63 +135,6 @@ docker run --platform linux/amd64 -d \ You can check the logs running `docker logs -f eigenda-proxy` to ensure the service is running correctly. -### Running op-node - -Op-node is not a resource-demanding service. We recommend running it on any modern CPU (amd64 or arm64) with at least 2GB of memory. It is stateless, so it does not require any persistent storage. - -1. To run op-node, you can use the container image: `us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/op-node:celo9`. Alternatively, you can clone the [celo-org/optimism repository](https://github.com/celo-org/optimism) and build op-node from source: - -```bash -git clone https://github.com/celo-org/optimism.git -cd optimism/op-node -git checkout celo9 -make op-node -``` - -2. Download the rollup config file and generate a JWT secret (this value will also be required for configuring the op-geth client): - -```bash -OP_NODE_DIR=/tmp/alfajores/op-node -mkdir -p ${OP_NODE_DIR} -wget https://storage.googleapis.com/cel2-rollup-files/alfajores/rollup.json --output-document=${OP_NODE_DIR}/rollup.json - -openssl rand -hex 32 > ${OP_NODE_DIR}/jwt.txt -``` - -3. Run the container (or the binary if preferred). You can use the following example as a reference. If you're using snap sync mode, you need to add the flag `--syncmode=execution-layer`. - -```bash -OP_NODE_IMAGE=us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/op-node:celo9 - -docker run --platform linux/amd64 -d \ - --name op-node \ - --network=host \ - --restart=always \ - -v ${OP_NODE_DIR}:/data \ - ${OP_NODE_IMAGE} \ - op-node \ - --l1.trustrpc=true \ - --l1=https://ethereum-holesky-rpc.publicnode.com \ - --l1.beacon=https://ethereum-holesky-beacon-api.publicnode.com \ - --l2=http://localhost:8551 \ - --l2.jwt-secret=/data/jwt.txt \ - --rollup.load-protocol-versions=true \ - --rollup.config=/data/rollup.json \ - --verifier.l1-confs=4 \ - --rpc.addr=127.0.0.1 \ - --rpc.port=9545 \ - --p2p.listen.tcp=9222 \ - --p2p.listen.udp=9222 \ - --p2p.priv.path=/data/op-node_p2p_priv.txt \ - --p2p.static=/ip4/35.197.25.52/tcp/9222/p2p/16Uiu2HAmQEdyLRSAVZDr5SqbJ1RnKmNDhtQJcEKmemrVxe4FxKwR,/ip4/34.105.22.4/tcp/9222/p2p/16Uiu2HAm1SZBDSugT5MMu7vBY8auDgfZFNhoDeXPLc9Me5FsAxwT,/ip4/34.83.209.168/tcp/9222/p2p/16Uiu2HAmGJAiUX6HLSo4nLh8T984qxzokwL23cVsYuNZy2SrK7C6,/ip4/34.83.214.149/tcp/9222/p2p/16Uiu2HAmAko2Kr3eAjM7tnshtEhYrxQYfKUvN2kwiygeFoBAoi8S,/ip4/34.169.5.52/tcp/9222/p2p/16Uiu2HAmKc6YKHzYgsjBDaj36uAufxpgZFgrzDqVBt6zTPwdhhJD \ - --altda.enabled=true \ - --altda.da-server=http://localhost:4242 \ - --altda.da-service=true \ - --altda.verify-on-read=false -``` - -You can check the logs running `docker logs -f op-node`. If you start op-node before op-geth, it will shut down after a few seconds if it cannot connect to its corresponding op-geth instance. This is normal behavior. It will run successfully once op-geth is running and it can connect to it. - ### Running op-geth Now, let's move on to the op-geth execution client. It will be responsible for executing transactions and generating blocks. We recommend running op-geth on a machine with 8 modern cores (amd64 or arm64), at least 8GB of memory and 200GB of storage. Feel free to adjust these values based on your specific requirements. @@ -350,9 +293,6 @@ Please check in your migration logs that the resulting migration block must look ` ::: -##### Start your L2 Node - -Now that we have the migrated chaindata, we can start our L2 node using your own migrated chaindata (the `new-db` path) and the genesis file generated by the migration script. You can also use the `rollup.json` file generated by the migration script for your op-node. Please continue with [executing op-geth](#executing-op-geth) instructions to start your L2 node. #### Executing op-geth @@ -371,8 +311,6 @@ make geth ```bash OP_GETH_IMAGE=us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/op-geth:celo8 -cp ${OP_NODE_DIR}/jwt.txt ${OP_GETH_DATADIR}/jwt.txt - docker run -d \ --name op-geth \ --network=host \ @@ -386,7 +324,7 @@ docker run -d \ --port=30303 \ --authrpc.addr=127.0.0.1 \ --authrpc.port=8551 \ - --authrpc.jwtsecret=/datadir/jwt.txt \ + --authrpc.jwtsecret=/datadir/jwt.hex \ --authrpc.vhosts='*' \ --http \ --http.addr=127.0.0.1 \ @@ -400,7 +338,65 @@ docker run -d \ To see the logs, you can run `docker logs -f op-geth`. -#### Configuring a HistoricalRPCService +### Running op-node + +Op-node is not a resource-demanding service. We recommend running it on any modern CPU (amd64 or arm64) with at least 2GB of memory. It is stateless, so it does not require any persistent storage. + +1. To run op-node, you can use the container image: `us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/op-node:celo9`. Alternatively, you can clone the [celo-org/optimism repository](https://github.com/celo-org/optimism) and build op-node from source: + +```bash +git clone https://github.com/celo-org/optimism.git +cd optimism/op-node +git checkout celo9 +make op-node +``` + +2. Make a directory for op node config and download the rollup config file: + +```bash +OP_NODE_DIR=/tmp/alfajores/op-node +mkdir -p ${OP_NODE_DIR} +wget https://storage.googleapis.com/cel2-rollup-files/alfajores/rollup.json --output-document=${OP_NODE_DIR}/rollup.json +``` + +3. Run the container (or the binary if preferred). You can use the following example as a reference. If you're using snap sync mode, you need to add the flag `--syncmode=execution-layer`. + +```bash +OP_NODE_IMAGE=us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/op-node:celo9 + +cp ${OP_GETH_DATADIR}/jwt.hex ${OP_NODE_DIR}/jwt.hex + +docker run --platform linux/amd64 -d \ + --name op-node \ + --network=host \ + --restart=always \ + -v ${OP_NODE_DIR}:/data \ + ${OP_NODE_IMAGE} \ + op-node \ + --l1.trustrpc=true \ + --l1=https://ethereum-holesky-rpc.publicnode.com \ + --l1.beacon=https://ethereum-holesky-beacon-api.publicnode.com \ + --l2=http://localhost:8551 \ + --l2.jwt-secret=/data/jwt.hex \ + --rollup.load-protocol-versions=true \ + --rollup.config=/data/rollup.json \ + --verifier.l1-confs=4 \ + --rpc.addr=127.0.0.1 \ + --rpc.port=9545 \ + --p2p.listen.tcp=9222 \ + --p2p.listen.udp=9222 \ + --p2p.priv.path=/data/op-node_p2p_priv.txt \ + --p2p.static=/ip4/35.197.25.52/tcp/9222/p2p/16Uiu2HAmQEdyLRSAVZDr5SqbJ1RnKmNDhtQJcEKmemrVxe4FxKwR,/ip4/34.105.22.4/tcp/9222/p2p/16Uiu2HAm1SZBDSugT5MMu7vBY8auDgfZFNhoDeXPLc9Me5FsAxwT,/ip4/34.83.209.168/tcp/9222/p2p/16Uiu2HAmGJAiUX6HLSo4nLh8T984qxzokwL23cVsYuNZy2SrK7C6,/ip4/34.83.214.149/tcp/9222/p2p/16Uiu2HAmAko2Kr3eAjM7tnshtEhYrxQYfKUvN2kwiygeFoBAoi8S,/ip4/34.169.5.52/tcp/9222/p2p/16Uiu2HAmKc6YKHzYgsjBDaj36uAufxpgZFgrzDqVBt6zTPwdhhJD \ + --altda.enabled=true \ + --altda.da-server=http://localhost:4242 \ + --altda.da-service=true \ + --altda.verify-on-read=false +``` + +You can check the logs running `docker logs -f op-node`. If you start op-node before op-geth, it will shut down after a few seconds if it cannot connect to its corresponding op-geth instance. This is normal behavior. It will run successfully once op-geth is running and it can connect to it. + + +#### Supporting historical execution The Celo L2 node alone cannot serve RPC requests requiring historical state or execution from before the migration. To serve such requests, you must configure a HistoricalRPCService URL pointing to a Celo L1 node. The Celo L2 node will then proxy requests for historical state / execution out to the Celo L1 node.