From b46b15dbb48a7c1920ff1429cadef809e7f51b3d Mon Sep 17 00:00:00 2001 From: Ana-Maria Calin Date: Thu, 2 May 2024 17:15:29 -0700 Subject: [PATCH] feat(blockchain-guides): arbitrum and celo guides updated to v2 --- .../arbitrum-archive-kubernetes-guide.md | 135 +++++++++--------- .../guides/celo-archive-kubernetes-guide.md | 39 +++-- docs/launchpad/guides/goerli-indexer-guide.md | 71 --------- 3 files changed, 87 insertions(+), 158 deletions(-) delete mode 100644 docs/launchpad/guides/goerli-indexer-guide.md diff --git a/docs/launchpad/guides/arbitrum-archive-kubernetes-guide.md b/docs/launchpad/guides/arbitrum-archive-kubernetes-guide.md index cbec7f0b..b2f44fba 100644 --- a/docs/launchpad/guides/arbitrum-archive-kubernetes-guide.md +++ b/docs/launchpad/guides/arbitrum-archive-kubernetes-guide.md @@ -2,116 +2,117 @@ --- # Arbitrum Archive Mainnet Node Guide -:::warning -This Quick Start guide has not yet been updated for Launchpad V2. -::: +## Introduction +This guide provides an end-to-end walkthrough for setting up an Indexer on the Graph Protocol Mainnet for the Arbitrum One network. It details the steps for deploying both Arbitrum Classic and Arbitrum Nitro. -This guide is intended to be an end to end walk-through of setting up an Indexer running on the Graph Protocol Mainnet on the Arbitrum One network. +## Sync Duration +- **Arbitrum Classic**: Approximately 1 week is required to sync on dedicated hardware. +- **Arbitrum Nitro**: Typically syncs within 3 days due to a shorter historical data span. -Sync times are reported to be in the range of 1 week on dedicated hardware. The node consists of 2 parts, the classic part and the nitro hardfork. The classic part is only required to request archive data for blocks before the hardfork and takes the aforementioned 1 weeks to sync from scratch. The nitro history is shorter and can be quickly synced within 3 days. +## Architecture Overview +Arbitrum Nitro includes a built-in proxy that automatically redirects queries for blocks older than its genesis to the Arbitrum Classic node. -Newer versions of Arbitrum Nitro require beaconchain url -Arbitrum Nitro has a built-in proxy to redirect queries with block numbers below it’s genesis block (they’re sent to the Arbitrum Classic node). +## Setup Environment +This guide assumes operation within a Kubernetes cluster: +- For setups using Launchpad, follow the steps outlined [here](#kubernetes-cluster-using-launchpad). +- For setups using Helm only, refer to the instructions [here](#deploying-with-helm-in-a-kubernetes-cluster-outside-launchpad). ## Prerequisites +Before you begin, ensure you have the following: +- An `ethereum-mainnet` RPC endpoint. +- CPU: 4 Cores / 8 Threads. +- RAM: 16 GiB. +- Storage: 3 TiB NVMe SSD. -All the [Launchpad Prerequisites](../prerequisites) apply, so be sure to read them first. +## Kubernetes Cluster Using Launchpad -You will need: -- an `ethereum-mainnet` RPC endpoint -- CPU: 4 Cores / 8 Threads -- RAM: 16 GiB -- Storage: 3 TiB NVMe SSD +Ensure all [Launchpad Prerequisites](../prerequisites) are met before proceeding. -## If running a Kubernetes cluster using `Launchpad` +### Initial Configuration -1. Check that the cluster is running and healthy - review [Quick Start](../quick-start/) guide for more info. -2. In your private infra repo pull in latest `launchpad-starter` changes +1. Confirm your cluster is operational by consulting our [Quick Start](../quick-start/) guide. +2. In your private infra repo pull in latest `launchpad-starter` changes: ```shell task launchpad:pull-upstream-starter ``` -1. **blockchain node data snapshot** The [Arbitrum-One namespace](https://github.com/graphops/launchpad-namespaces/blob/main/arbitrum-one/README.md) contains default configurations for both Arbitrum Classic and Arbitrum Nitro to download data from a snapshot. The snapshots have been set by default: -- for Arbitrum Classic + +### Data Restoration and Configuration + +1. **Blockchain node data snapshot** The [Arbitrum-One namespace](https://github.com/graphops/launchpad-namespaces/blob/main/arbitrum-one/README.md) contains default configurations for both Arbitrum Classic and Arbitrum Nitro to download data from a snapshot. The snapshots have been set by default: +- for [Arbitrum Classic](https://github.com/graphops/launchpad-namespaces/blob/585f4a0aa711b27adedd2493daa57b28f01eeca1/arbitrum/values/one/arbitrum-classic.yaml.gotmpl#L20-L24) ```yaml -arbitrum: - restoreSnapshot: - enable: true - snapshotUrl: https://snapshot.arbitrum.foundation/arb1/classic-archive.tar +restoreSnapshot: + enabled: true + snapshotUrl: https://snapshot.arbitrum.foundation/arb1/classic-archive.tar ``` -- for Arbitrum Nitro +- for [Arbitrum Nitro](https://github.com/graphops/launchpad-namespaces/blob/585f4a0aa711b27adedd2493daa57b28f01eeca1/arbitrum/values/one/arbitrum-nitro.yaml.gotmpl#L11-L13) ```yaml -nitro: - restoreSnapshot: - enabled: true - snapshotUrl: "https://snapshot.arbitrum.foundation/arb1/nitro-archive.tar" +restoreSnapshot: + enabled: true + snapshotUrl: https://snapshot.arbitrum.foundation/arb1/nitro-archive.tar ``` -1. **connect to eth-mainnet-rpc-node** Both Arbitrum Classic and Arbitrum Nitro connect to l1 via the following commands: -- for Arbitrum Nitro - update values in [`/helmfiles/release-names/arbitrum-mainnet/arbitrum-classic-archive-trace-mainnet.yaml`](https://github.com/graphops/launchpad-starter/blob/main/helmfiles/release-values/arbitrum-mainnet/arbitrum-classic-archive-trace-mainnet.yaml) as needed. Example: +you can overwrite both of these values in [`/namespaces/arbitrum-one.yaml`](https://github.com/graphops/launchpad-starter/blob/main/namespaces/arbitrum-one.yaml) + +2. **Connect to eth-mainnet-rpc-node** Both Arbitrum Classic and Arbitrum Nitro connect to l1, and recent versions of Arbitrum Nitro require connection to a beacon chain RPC: +- for **Arbitrum Classic** - update values in [`/namespaces/arbitrum-one.yaml`](https://github.com/graphops/launchpad-starter/blob/main/namespaces/arbitrum-one.yaml) as needed. Example: ```yaml -arbitrum: - extraArgs: - - --node.chain-id=42161 # determines Arbitrum network - 42161 mainnet - - --l1.url=http://a-link-to-your-eth-mainnet-url:8545 +arbitrum-classic: + values: + arbitrum: + config: + parentChainUrl: http://your-eth-mainnet-url:8545 ## changeme ``` -- for Arbitrum Nitro - update values in [`/helmfiles/release-names/arbitrum-mainnet/arbitrum-nitro-archive-trace-mainnet.yaml`](https://github.com/graphops/launchpad-starter/blob/main/helmfiles/release-values/arbitrum-mainnet/arbitrum-nitro-archive-trace-mainnet.yaml) as needed. Example: +- for **Arbitrum Nitro** - update values in [`/helmfiles/namespaces/arbitrum-one.yaml`](https://github.com/graphops/launchpad-starter/blob/main/namespaces/arbitrum-one.yaml) as needed. Example: ```yaml -nitro: - extraArgs: - - --http.api=net,web3,eth,debug - - --l2.chain-id=42161 # determines Arbitrum network - 42161 mainnet - - --l1.url=http://a-link-to-your-eth-mainnet-url:8545 - - --node.rpc.classic-redirect=http://arbitrum-classic-archive-trace-mainnet-0:8547/ - - --init.url=https://snapshot.arbitrum.io/mainnet/nitro.tar +arbitrum-nitro: + values: + nitro: + config: + parentChainUrl: http://your-eth-mainnet-url:8545 ## changeme + parentChainBeaconUrl: http://your-eth-consensus-node-url:5052 ## changeme ``` -## Deploying with helm in a Kubernetes cluster outside Launchpad - -You can find blockchain related helm packages ['here'](https://github.com/graphops/launchpad-charts/tree/main/charts) +## Deploying with helm in a Kubernetes Cluster Outside Launchpad -Given that Arbitrum needs both Nitro and classic to run use the following commands: +You can find blockchain related helm packages [here](https://github.com/graphops/launchpad-charts/tree/main/charts) ### Deploy Arbitrum Classic We'll first deploy Arbitrum Classic as Arbitrum Nitro needs to connect to the Classic endpoint. -Create a values `arbitrum-classic.yaml` file with the following contents +1. Prepare your configuration file, `arbitrum-classic.yaml`, with the necessary RPC URL and optional snapshot URL: ```yaml arbitrum: - extraArgs: - - --node.chain-id=42161 # determines Arbitrum network - 42161 mainnet - - --l1.url=http://a-link-to-your-eth-mainnet-url:8545 + config: + parentChainUrl: http://your-eth-mainnet-url:8545 ## changeme restoreSnapshot: - enable: true - snapshotUrl: https://a-link-to-your-snapshot-archive.tar.gz - mode: streaming # or multipart depending on chain + enabled: true + snapshotUrl: https://a-link-to-your-snapshot-archive.tar.gz ## specify only if overriding default ``` -Deploy helm-chart: +2. Add the Helm repository and deploy: ```sh helm repo add graphops http://graphops.github.io/launchpad-charts -``` - -```sh -helm install --dry-run arbitrum-classic graphops/arbitrum-classic:latest --namespace arbitrum-mainnet --value arbitrum-classic.yaml +helm install --dry-run arbitrum-classic graphops/arbitrum-classic:latest --namespace arbitrum-one --value arbitrum-classic.yaml ``` ### Deploy Arbitrum Nitro - -Create a values `arbitrum-nitro.yaml` file with the following contents +1. Prepare your configuration file, `arbitrum-nitro.yaml`, with the necessary RPC URLs, classic node URLs and optional snapshot URL: ```yaml nitro: - extraArgs: - - --http.api=net,web3,eth,debug - - --l2.chain-id=42161 # determines Arbitrum network - 42161 mainnet - - --l1.url=http://a-link-to-your-eth-mainnet-url:8545 - - --node.rpc.classic-redirect=http://arbitrum-classic:8547/ # replace `arbitrum-classic` with the name of your arbitrum-classic release deployed at the previous step - - --init.url=https://snapshot.arbitrum.io/mainnet/nitro.tar + config: + parentChainUrl: http://your-eth-mainnet-url:8545 ## changeme + parentChainBeaconUrl: http://your-eth-consensus-node-url:5052 ## changeme + classicUrl: http://arbitrum-classic:8547/ # replace `arbitrum-classic` with the name of your arbitrum-classic release deployed at the previous step + restoreSnapshot: + enabled: true + snapshotUrl: https://a-link-to-your-snapshot-archive.tar.gz ## specify only if overriding default ``` -Deploy helm-chart: +2. Deploy using helm: ```sh -helm install --dry-run arbitrum-nitro graphops/arbitrum-classic:latest --namespace arbitrum-mainnet --value arbitrum-nitro.yaml +helm install --dry-run arbitrum-nitro graphops/arbitrum-classic:latest --namespace arbitrum-one --value arbitrum-nitro.yaml ``` diff --git a/docs/launchpad/guides/celo-archive-kubernetes-guide.md b/docs/launchpad/guides/celo-archive-kubernetes-guide.md index 7c6b2fbb..7d83aac6 100644 --- a/docs/launchpad/guides/celo-archive-kubernetes-guide.md +++ b/docs/launchpad/guides/celo-archive-kubernetes-guide.md @@ -2,16 +2,18 @@ --- # Celo Archive Mainnet Node Guide -:::warning -This Quick Start guide has not yet been updated for Launchpad V2. -::: - +## Introduction This guide is intended to be an end to end walk-through of running an Celo Archive Mainnet Node in an existing Kubernetes cluster. + +## Sync Duration Sync times are reported to be in the range of 4 days on dedicated hardware. -## Prerequisites +## Setup Environment +This guide assumes operation within a Kubernetes cluster: +- For setups using Launchpad, follow the steps outlined [here](#kubernetes-cluster-using-launchpad). +- For setups using Helm only, refer to the instructions [here](#deploying-with-helm-in-a-kubernetes-cluster-outside-launchpad). -All the [Launchpad Prerequisites](../prerequisites) apply if running a Kubernetes cluster using `Launchpad`, so be sure to read them first. This guide can be used with existing Kubernetes clusters as well. +## Prerequisites For Celo workload you will need: - CPU: 4 Cores / 8 Threads @@ -20,18 +22,18 @@ For Celo workload you will need: ## If running a Kubernetes cluster using `Launchpad` -1. Check that the cluster is running and healthy - review [Quick Start](../quick-start/) guide for more info. -2. In your private infra repo pull in latest `launchpad-starter` changes +All the [Launchpad Prerequisites](../prerequisites) apply if running a Kubernetes cluster using `Launchpad`, so be sure to read them first. This guide can be used with existing Kubernetes clusters as well. + +1. Confirm your cluster is operational by consulting our [Quick Start](../quick-start/) guide. + +2. In your private infra repo pull in latest `launchpad-starter` changes: ```shell task launchpad:pull-upstream-starter ``` -3. Pull in `latest-core` changes -```shell -task launchpad:update-core -``` -4. Check default values- double-check values and update as needed in [`/helmfiles/release-names/arbitrum-mainnet/celo-archive-trace-mainnet-0.yaml`](https://github.com/graphops/launchpad-starter/blob/main/helmfiles/release-values/arbitrum-mainnet/celo-archive-trace-mainnet-0.yaml) -5. Deploy celo-mainnet namespace +1. Check default values and update as needed in [`/helmfiles/namespaces/celo-mainnet.yaml`](https://github.com/graphops/launchpad-starter/blob/main/namespaces/celo-mainnet.yaml) + +2. Deploy celo-mainnet namespace ```shell task releases:apply celo-mainnet ``` @@ -40,7 +42,7 @@ task releases:apply celo-mainnet You can find blockchain related helm packages [here](https://github.com/graphops/launchpad-charts/tree/main/charts) -Create a values `celo-mainnet.yaml` file with the following contents or similar: +1. Prepare your configuration file, `celo-mainnet.yaml`, to override chart default values as necessary. Example: ```yaml celo: extraArgs: @@ -54,12 +56,9 @@ celo: - --http.api=eth,net,web3,debug,admin,personal ``` -Deploy helm-chart: +2. Add the Helm repository and deploy: -```sh +```shell helm repo add graphops http://graphops.github.io/launchpad-charts -``` - -```sh helm install --dry-run celo graphops/celo:latest --namespace celo-mainnet --values celo-mainnet.yaml ``` diff --git a/docs/launchpad/guides/goerli-indexer-guide.md b/docs/launchpad/guides/goerli-indexer-guide.md deleted file mode 100644 index 4d895885..00000000 --- a/docs/launchpad/guides/goerli-indexer-guide.md +++ /dev/null @@ -1,71 +0,0 @@ ---- ---- -# Goerli Indexer Guide - -This guide is intended to be an end to end walk-through of setting up an Indexer running on the Graph Protocol Testnet on the Ethereum Goerli network. - -## Prerequisites - -All the [Launchpad Prerequisites](../prerequisites) apply, so be sure to read them first. - -You will need: -- At least one server running Ubuntu 22.04 with keypair authenticated SSH access -- A web browser with MetaMask installed - -## What we're going to do - -1. Create all the relevant Ethereum accounts, fund them, register them on-chain with the protocol -1. Follow the [Quick Start](../quick-start) guide to set up our local machine, and then set up our cluster of servers, and finally deploy the Graph Stack -1. Configure DNS, verify ingress and TLS is working -1. Allocate to subgraph deployments -1. Verify that we are serving queries - -## Create the Indexer and Operator Ethereum accounts - -We will need to set up two new Ethereum accounts: - -1. The Indexer account: this account is your Indexer's identity, and is used to stake GRT into the protocol. This account owns your in-protocol GRT. This key should be kept very safe! -1. The Operator account: this account is authorised to perform some operational actions (like managing allocations) on behalf of your Indexer. The key for this account will live on your server(s). The Indexer Software uses this account to automate interactions with the protocol. This account does not own your GRT, but can take actions that put your GRT at risk (e.g. submitting a bad POI could make you liable to slashing). You can replace the Operator account with a new one at any time. - -## Generating mnemonics for your new accounts - -[Ian Coleman's BIP39 generator](https://iancoleman.io/bip39/) is great for quickly generating new mnemonics and their derived accounts. - -1. Set the "Coin" to "ETH - Ethereum". -1. Click Generate -1. Take note of: the mnemonic and (optionally, if you follow this guide) all details for the first derived address - -Generate two new mnemonics and save their details. - -:::tip -When setting up your Indexer account for mainnet, use a more secure method, like a hardware wallet, for generating your Indexer account. -::: - -## Funding our new accounts - -Both our new accounts will need ETH in order to pay for transaction costs. The Operator account will be used for all automated protocol interactions, so it will need a lot more ETH than the Indexer account. The Indexer account will need to pay for gas to stake GRT into the protocol, and set various metadata and parameters. - -For the Goeli testnet, there are a number of ETH faucets that can be used to fund your new accounts. You can find various options here: https://faucetlink.to/goerli - -Our Indexer account will also need at least 100,000 Goerli GRT in order to stake in the protocol. If you are a MIPs participant, you should follow the relevant instructions to get that GRT. Otherwise there is a Goerli GRT faucet available in the [Graph Protocol Discord](https://thegraph.com/discord). - -## Registering our Indexer and Operator accounts - -We will use [The Graph's Testnet Network app](https://testnet.thegraph.com) to register our new accounts with the protocol on-chain. - -1. Use MetaMask to import the private key for your Indexer mnemonic's first derived account. This will allow us to transact as our Indexer. -1. Navigate to "Indexing" under your profile dropdown menu -1. Click the Stake button and Stake at least 100k GRT (first allowing GRT token access with an approval transaction, followed by the stake transaction) -1. Navigate to "Settings" under your profile dropdown menu, and then to "Operators" in the left hand menu -1. Click the plus symbol, paste in your Operator mnemonic's first derived address, click Add and submit the transaction -1. (optionally) Navigate to other settings to configure profile details - -## Launching off the pad! - -Now that our accounts are ready, let's follow the [Quick Start](../quick-start) guide to: - -1. Create a new repository for our infrastructure -1. Configure our local machine to command our cluster -1. Configure our servers into a Kubernetes cluster -1. Deploy core cluster services and the Graph Indexing stack into our cluster -