From 298009086625b1885524fa670a1f18ac03a8bd58 Mon Sep 17 00:00:00 2001 From: Daniel Helm Date: Wed, 30 Oct 2024 16:02:05 -0500 Subject: [PATCH] add ubuntu to devnet guide --- .../docs/en/sdk/guides/devnet-deployment.mdx | 348 ++++++++++++------ .../sdk/operation/security-and-recovery.mdx | 5 + 2 files changed, 244 insertions(+), 109 deletions(-) diff --git a/src/content/docs/en/sdk/guides/devnet-deployment.mdx b/src/content/docs/en/sdk/guides/devnet-deployment.mdx index 7d617bce1..5c3ac8e80 100644 --- a/src/content/docs/en/sdk/guides/devnet-deployment.mdx +++ b/src/content/docs/en/sdk/guides/devnet-deployment.mdx @@ -10,7 +10,7 @@ excerpt: "Run the Scroll SDK devnet locally to get started." import Aside from "../../../../../components/Aside.astro" import ToggleElement from "../../../../../components/ToggleElement.astro" import Steps from '../../../../../components/Steps/Steps.astro'; - +import { Tabs, TabsContent } from "../../../../../components/Tabs" ## Overview @@ -22,39 +22,34 @@ We’ve written this guide because local deployments for Kubernetes clusters can By the end of the guide, you should have a Scroll SDK running with a block explorer, RPC, webUI, monitoring and metrics, and a local L1. These are all accessible to wallets, browsers, and applications running on your local machine. - */}
Updates to the Guide
- - - August 26, 2024 - - Changes for repository refactor, including new CLI tool commands. - - July 31, 2024 - - Adding additional `make` commands and `minikube` config - - June 26, 2024 - - Minor typography fixes i.e. `docker v` to `docker -v` - - June 19, 2024 - - Removed external `bjw-s` dependency and prerequisite - - Removed manual modification of `.env.frontends` - - Updated docker image name used in generating config files - - June 18, 2024 - - Fixed `minikube addons enable` commands (missing “addons”) - + - October 30, 2024 + - Updated for Scroll SDK v0.1.0
## Prerequisites + + +macOS +Ubuntu + 1. Install dependencies (using `brew` is strongly recommended): - [Brew](https://brew.sh/) (optional) - - `/bin/bash -c "$(curl -fsSL [https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh](https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh))"` + - `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` - Docker ([Docker Desktop](https://docs.docker.com/desktop/install/mac-install/)) - `brew install --cask docker` - [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/) @@ -65,6 +60,7 @@ This guide does not include running the coordinator or a prover. The coordinator - `brew install helm` - [docker-mac-net-connect](https://github.com/chipmk/docker-mac-net-connect) (macOS ARM64 only) - `brew install chipmk/tap/docker-mac-net-connect` + 2. *Optional:* Install dependencies for support CLI tool: - [node >=18](https://nodejs.org/en/download/package-manager) - `brew install nvm` @@ -81,56 +77,123 @@ This guide does not include running the coordinator or a prover. The coordinator - Or, in one step: `scrollsdk test dependencies` + + + +1. Update system packages: + ```bash + sudo apt update + sudo apt-get install make + ``` + +2. Install [Docker](https://docs.docker.com/engine/install/ubuntu/): + ```bash + # Add Docker's official GPG key + sudo apt-get install ca-certificates curl + sudo install -m 0755 -d /etc/apt/keyrings + sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc + sudo chmod a+r /etc/apt/keyrings/docker.asc + + # Add repository to Apt sources + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + + sudo apt-get update + sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + sudo usermod -aG docker $USER + ``` + +3. Install [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/): + ```bash + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + ``` - +Next, we start minikube. -### Starting minikube + +macOS +Ubuntu + -To start minikube, run: +Mac requires extra commands as a work-around for `ingress-dns` not working correctly on arm64 MacOS. Hopefully the issue will be resolved in later versions of minikube. ```bash minikube start --driver=docker minikube addons enable ingress minikube addons enable ingress-dns -``` -#### Getting minikube to work with custom DNS names on MacOS +# Additional steps for MacOS DNS resolution +minikube ssh "sudo apt-get update && sudo apt-get -y install qemu-user-static" +sudo brew services start chipmk/tap/docker-mac-net-connect +``` -Now run the following commands: + + ```bash -minikube ssh "sudo apt-get update && sudo apt-get -y install qemu-user-static" +minikube start --driver=docker minikube addons enable ingress minikube addons enable ingress-dns -sudo brew services start chipmk/tap/docker-mac-net-connect ``` - - + + ## Installing Scroll SDK - */} 1. **Clone the `scroll-sdk` repo and find `devnet` directory** - *You’ll need If you need repo access, reach out to `@dghelm` on Telegram.* - ```bash git clone git@github.com:scroll-tech/scroll-sdk.git cd scroll-sdk/devnet @@ -144,15 +207,15 @@ Then, set it as a env var and run: `echo $GHCR_PAT | docker login ghcr.io -u [gi make bootstrap ``` - */} 1. Optional: **Configure `values.yaml` and `config.toml`** - This is the time to adjust what services run on your stack and their configuration. I’d suggest not altering these on your first installation, but see `charts/scroll-sdk/values.yaml` ([view on Github](https://github.com/scroll-tech/scroll-sdk/blob/develop/charts/scroll-sdk/values.yaml)) and `config.toml` ([view on Github](https://github.com/scroll-tech/scroll-sdk/blob/develop/charts/scroll-sdk/config.toml)). + This is the time to adjust what services run on your stack and their configuration. We suggest not altering these on your first installation, but see `charts/scroll-sdk/values.yaml` ([view on Github](https://github.com/scroll-tech/scroll-sdk/blob/develop/charts/scroll-sdk/values.yaml)) and `config.toml` ([view on Github](https://github.com/scroll-tech/scroll-sdk/blob/develop/charts/scroll-sdk/config.toml)). - If you do make changes, you’ll need to run `make config` to regenerate the additional configuration files. + If you do make changes, you’ll need to run `make config` after to regenerate the additional configuration files. No services directly read from the `config.toml` file. 1. **Launch the chain!** @@ -161,53 +224,24 @@ Then, set it as a env var and run: `echo $GHCR_PAT | docker login ghcr.io -u [gi make install ``` - Your chain is now starting! Run `kubectl get pods` to check in on their progress. In the next section we’ll expose the chain to your local machine so you can interact with the stack. + Your chain is now starting! Run `kubectl get pods` to check in on their progress. In the next section we'll expose the chain to your local machine so you can interact with the stack. -