Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many updates #27

Merged
merged 10 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,73 @@ sidebar_position: 1

# Digital Ocean

Deploy your rollup to Digital Ocean.
This guide will walk you through deploying a rollup full node on
Digital Ocean which uses the remote Astria shared sequencer network.

:::info
The list of local dependencies for the following instructions [can be found here](/docs/dusknet/1-overview.md).
:::
## Local Dependencies

Clone the [dev-cluster](https://github.com/astriaorg/dev-cluster/tree/main) and
install the astria cli [astria repo](https://github.com/astriaorg/astria):

The following assumes you are using [Digital Ocean Kubernetes
(DOKS)](https://www.digitalocean.com/products/kubernetes).
```bash
git clone [email protected]:astriaorg/dev-cluster.git
cargo install astria-cli --git=https://github.com/astriaorg/astria --locked
jbowen93 marked this conversation as resolved.
Show resolved Hide resolved
```

We recommend using Digital Ocean's Kubernetes [Quick Start Guide](https://docs.digitalocean.com/products/kubernetes/getting-started/quickstart/).
You'll also need to install the following tools:
- kubectl - <https://kubernetes.io/docs/tasks/tools/>
- helm - <https://helm.sh/docs/intro/install/>

## Dusknet Endpoints

The endpoints for the remote shared sequencer are:

| NAME | HOSTS | ADDRESS |
|-----|-----|-----|
| Sequencer RPC | rpc.sequencer.dusk-2.devnet.astria.org | 34.111.73.187 |
| Sequencer Faucet | faucet.sequencer.dusk-2.devnet.astria.org | 34.36.8.102 |

# Digital Ocean

We assume you are using Digital Ocean's hosted Kubernetes (K8s) service, we recommend following their [Quick Start Guide](https://docs.digitalocean.com/products/kubernetes/getting-started/quickstart/).

You must also install and configure `doctl`: https://docs.digitalocean.com/reference/doctl/how-to/install/

## Configure `kubectl` with `doctl`
## Create a New Cluster

In your Digital Ocean control panel, navigate to "Connecting to Kubernetes." Run the following command with the `magic-id`
generated for you.
Follow the instructions in Digital Ocean's [Quick Start Guide](https://docs.digitalocean.com/products/kubernetes/getting-started/)
create a (2) node cluster in the region of your choosing.

```bash
doctl kubernetes cluster kubeconfig save <magic-id>
```
## Configure `kubectl` with `doctl`

![doctl screenshot](../assets/doctl-screenshot.png)
Once your k8s cluster is created configure `kubectl`.

![doctl screenshot](assets/do-setup.png)

## Deploy Ingress Nginx Controller

We use the Ingress NGINX Controller for consistency across deployment environments:
We use the Nginx Ingress Controller, its documentation can be found [here](https://kubernetes.github.io/ingress-nginx/deploy/#digital-ocean/)

<https://kubernetes.github.io/ingress-nginx/deploy/#digital-ocean>
To install it run:

```bash
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.8.2/deploy/static/provider/do/deploy.yaml
```

This will create several Kubernetes (k8s) resources and a Digital Ocean loadbalancer.

## Verify Loadbalancer with external IP

Look for a new loadbalancer being created in the Digital Ocean console:
You should see a new loadbalancer being created in the Digital Ocean console:
https://cloud.digitalocean.com/networking/load_balancers

You can also check that your Digital Ocean load balancer was created using the
following command:
You can also check that your Digital Ocean load balancer was created with:

```bash
kubectl get svc -n ingress-nginx
```

You should see something like this:
It may take a few minutes for the `EXTERNAL-IP` field to be populated, you should see something like this:

```bash
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
Expand All @@ -63,25 +83,25 @@ ingress-nginx-controller-admission ClusterIP 10.245.106.99 <none>
:::tip
You must configure a DNS record because our ingress configuration uses name
based virtual routing.
More info here: https://kubernetes.io/docs/concepts/services-networking/ingress/#name-based-virtual-hosting

More info can be found [here](https://kubernetes.io/docs/concepts/services-networking/ingress/#name-based-virtual-hosting)
:::

How you create an `A` record will depend on where you purchased your domain from. Each
domain provider will have different steps required to set up an A record.
How you create an `A` record will depend on where you manage your domain.

An example for Google domains can be seen here: <https://support.google.com/a/answer/2579934?hl=en>

Create a wildcard `*` record pointing to the `EXTERNAL-IP` of your `ingress-nginx-controller`:
Create a wildcard record `*` pointing to the `EXTERNAL-IP` of your `ingress-nginx-controller`:

![a record screenshot](../assets/a-record.png)
![a record screenshot](assets/a-record.png)

## Create your Rollup Genesis Account(s)

:::danger
__NEVER__ use a private key you use on a live network.
:::

You can add genesis account(s) to your rollup during configuration.
You will now specify the accounts which will be funded at the genesis block of your EVM rollup.

You can create an account using:

Expand All @@ -100,7 +120,7 @@ Export the genesis private key, this will be used by the faucet included with th
export ROLLUP_FAUCET_PRIV_KEY=<GENESIS_PRIVATE_KEY>
```

Export the genesis address alongside with your desired initial balance, in Wei, we recommend using a value of `100000000000000000000` or larger:
Export the genesis address alongside with your desired initial balance (in Wei), we recommend using a value of `100000000000000000000` or larger:
```bash
export ROLLUP_GENESIS_ACCOUNTS=<GENESIS_ADDRESS>:<BALANCE>
```
Expand All @@ -111,18 +131,10 @@ You can specify multiple accounts to be funded at genesis as comma deliminated t
export ROLLUP_GENESIS_ACCOUNTS=<ADDRESS_1>:<BALANCE_1>,<ADDRESS_2>:<BALANCE_2>
```

## Install the `astria-cli`

Pull the [Astria repo](https://github.com/astriaorg/astria) and install the `astria-cli`

```bash
git clone [email protected]:astriaorg/astria.git
cd astria
just install-cli
```

## Create Rollup Config

You will now create the configuration manifest for your rollup.

Replace the tags in the commands and env vars below, as follows:

| Var Name | Var Type | Description |
Expand Down Expand Up @@ -180,6 +192,8 @@ ingress:

## Create new sequencer account

You must create an account on the Astria shared sequencer network where your rollup full node will submit transactions.

```bash
astria-cli sequencer account create
```
Expand All @@ -205,7 +219,7 @@ Navigate to <https://faucet.sequencer.dusk-2.devnet.astria.org/> to view the seq

Enter your `<SEQUENCER_ACCOUNT_ADDRESS>` into the text box to send funds to your account:

![Sequencer Faucet](../assets/sequencer-faucet.png)
![Sequencer Faucet](assets/sequencer-faucet.png)

Verify your account received the funds

Expand All @@ -215,7 +229,7 @@ astria-cli sequencer balance get $SEQUENCER_ACCOUNT_ADDRESS --sequencer-url=http

## Deploy the Rollup Node

Use the `astria-cli` to deploy the node.
Use the `astria-cli` to deploy the node providing both the rollup faucet private key and the sequencer private key.

```bash
astria-cli rollup deployment create \
Expand All @@ -224,32 +238,34 @@ astria-cli rollup deployment create \
--sequencer-private-key $SEQUENCER_PRIV_KEY
```

## Watch for pod startup
## Watch for rollup startup

You can watch for the Kubernetes pods of the rollup to start with:

```bash
kubectl get pods -n astria-dev-cluster -w
```

```bash
NAME READY STATUS RESTARTS AGE
<YOUR_ROLLUP_NAME>-blockscout-647745c66d-vz4ks 6/6 Running 1 (56s ago) 72s
<YOUR_ROLLUP_NAME>-faucet-68667bd895-pwqmz 1/1 Running 0 72s
<YOUR_ROLLUP_NAME>-geth-755cb8dd97-k5xp8 3/3 Running 0 72s
NAME READY STATUS RESTARTS AGE
<YOUR_ROLLUP_NAME>-blockscout-647745c66d-vz4ks 6/6 Running 1 (56s ago) 72s
<YOUR_ROLLUP_NAME>-celestia-node-light-mocha-4-0 2/2 Running 1 (56s ago) 72s
<YOUR_ROLLUP_NAME>-faucet-68667bd895-pwqmz 1/1 Running 0 72s
<YOUR_ROLLUP_NAME>-geth-755cb8dd97-k5xp8 3/3 Running 0 72s
```

## Observe your Deployment
## Your Rollup Endpoints

Your rollups utility endpoints are as follows:
Your rollup will automatically be configured with the several public endpoints using the DNS you configured:

| Utility | URL |
|-----|-----|
| Block Explorer | http://blockscout.<YOUR_ROLLUP_NAME>.<YOUR_HOSTNAME>/ |
| Faucet | http://faucet.<YOUR_ROLLUP_NAME>.<YOUR_HOSTNAME>/ |
| RPC | http://executor.<YOUR_ROLLUP_NAME>.<YOUR_HOSTNAME>/ |

Open the URLs in your browser to view your running rollup.

## Use `cast` to Interact with your Rollup
## Interact with your Rollup

```bash
export ETH_RPC_URL=http://executor.$ROLLUP_NAME.$ROLLUP_HOSTNAME/
Expand Down
8 changes: 8 additions & 0 deletions docs/cloud-rollup/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Deploy a Cloud Rollup",
"position": 3,
"link": {
"type": "generated-index",
"description": "To deploy a rollup to a cloud provider of your choice, select one of the guides below."
}
}
Binary file added docs/cloud-rollup/assets/do-setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 0 additions & 73 deletions docs/dev-cluster/1-overview.md

This file was deleted.

73 changes: 0 additions & 73 deletions docs/dev-cluster/2-deploy-a-local-rollup.md

This file was deleted.

Loading