Overview of Scroll SDK Stack
Stack Technical Overview
The architecture of a Scroll SDK chain is based on Scroll, and the architecture specifics of a Scroll SDK chain will match what Scroll’s network. For more information on how Scroll works, please see the Technology section.
The articles in this section will be focus on the various parts a Scroll SDK chain operator will need to deploy and run.
Scroll SDK Repo
Scroll SDK can be found on GitHub. The repo is private, so please ask a member of the Scroll team for access.
The repo consists of these major components:
- Example config files for various customizations (see Customization)
- Helm charts for deploying the necessary services and contracts (see Services)
- A docker image for building the correct configuration files for these services (see Smart Contracts)
- An Ansible playbook for setting up a zk prover (see Proof Generation)
Deployment Process
We provide two deployment options for Scroll SDK: a local devnet and a production deployment. Because of the different requirements for each, we handle them separately.
In Devnet, all services are deployed by a single “chart” and we deploy additional services like a database in the cluster. We assume users are working inside their clone of the scroll-sdk
repo.
In Production, each service is an independent chart, and we assume services like a database will be provided by the chain operator. Because of the additional modularity and flexibility, there is also additional configuration needed and some knowledge of Kubernetes may be required. outside the cluster. We also assume users will create a new repo for storing their production workflow.
Devnet
PreReqs
To run a local devnet with all services running on a single machine (using minikube), you’ll want the following items installed from a base Ubuntu installation:
Before getting started, be sure to install the following:
- Docker Engine (or Docker Desktop)
- kubectl
- minikube (for local dev cluster)
- Helm
Docker and minikube will need to be running before starting the deployment process.
Deployment
For more in-depth information on deploying a Scroll SDK devnet, see the Devnet Deployment guides.
-
Clone the Scroll SDK repo and navigate to the
./devnet
directory. -
Fetch all charts and create configuration files.
-
(Optional) Modify
./scroll-sdk/config.toml
with your settings and accounts.For more information on modifying config.toml, see Customization.
-
(Optional) Modify
./scroll-sdk/values.yaml
to disable any unneeded services.For more information on which services to set
enable:true
, see Services. -
(Optional) If modifications were made, run
make config
to update the configuration files. -
Launch the Scroll SDK services by running:
-
Wait for services to start and contracts to deploy, and you’ve got a new Scroll SDK chain!
Production
PreReqs
Before getting started, be sure to install the following:
- Docker Engine (or Docker Desktop)
- kubectl
- Helm
For a production environment, you’ll want to have a working Kubernetes cluster and kubectl
configured to point to it. We assume users will create a new repo for storing their production workflow. Docker will be used locally in the configuration preparation workflow.
In addition, you’ll want to prepare the following items:
- A PostgreSQL-compatible database with an admin user
- Up to 3 for chain services, optionally 1 more for Blockscout
- A Kubernetes Monitor Service (i.e. Prometheus)
- A Kubernetes Ingress Controller (i.e. Nginx)
- A Secret Store for storing sensitive information (i.e. AWS Secrets, Hashicorp Vault) and a way to access it from Kubernetes using External Secrets
More information on choosing and setting up these services for various cloud providers will be provided in the Guides section.
Deployment
We’ll provide a high-level overview here, but for helper scripts and more detailed information, see the soon-to-be-completed Production Deployment guide.
-
Create a new directory to host your git repo and Scroll SDK deployment files.
-
Copy the
config.toml
template and fill in your settings. -
Generate you configuration files
-
Generate your Secrets files (note: this will be automated in a Make command)
-
Move all generated files into a new
./secrets
directory, then push them to your External Secrets provider. -
This will be a Make command, but for now: Pull SDK charts and untar them:
-
Push each config file into the configs folder of each chart (note: this will be automated soon)
-
Manually modify the
production.yaml
file in each chart to match yourconfig.toml
file (note: this will be automated soon) -
Install each chart:
-
Wait for services to start and contracts to deploy, and you’ve got a new Scroll SDK chain!