diff --git a/docs/dusknet/assets/cname-record-example.png b/docs/dusknet/assets/cname-record-example.png new file mode 100644 index 00000000..e20df5c4 Binary files /dev/null and b/docs/dusknet/assets/cname-record-example.png differ diff --git a/docs/dusknet/cloud-rollup-deployment/3-azure.md b/docs/dusknet/cloud-rollup-deployment/3-azure.md index 83bf5e39..ab328786 100644 --- a/docs/dusknet/cloud-rollup-deployment/3-azure.md +++ b/docs/dusknet/cloud-rollup-deployment/3-azure.md @@ -92,6 +92,7 @@ curl 20.72.189.135 ``` + ## Creating your own Genesis Account You can add genesis account(s) to your rollup during configuration. @@ -261,12 +262,12 @@ Export this file to the env vars as follows: export ROLLUP_CONF_FILE=-rollup-conf.yaml ``` +## Create new sequencer account + ```bash astria-cli sequencer account create ``` -## Create new sequencer account - ```bash Create Sequencer Account diff --git a/docs/dusknet/cloud-rollup-deployment/4-aws.md b/docs/dusknet/cloud-rollup-deployment/4-aws.md index 01c03b67..f7ed4d3d 100644 --- a/docs/dusknet/cloud-rollup-deployment/4-aws.md +++ b/docs/dusknet/cloud-rollup-deployment/4-aws.md @@ -18,20 +18,18 @@ https://portal.aws.amazon.com/gp/aws/developer/registration/index.html ## Install `aws` CLI -https://formulae.brew.sh/formula/awscli - -```bash -brew install awscli -``` +Installation links for your OS can be found here: +- https://aws.amazon.com/cli/ ## Create an Access Key -https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html - - +:::danger +This doesn’t follow best security practices, do not do this on an important AWS +account which has production resources on it. +::: Go to IAM section of console: https://console.aws.amazon.com/iam/ @@ -97,13 +95,18 @@ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/cont ```bash kubectl get svc -n ingress-nginx +``` +You should see something like this: + +```bash NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE ingress-nginx-controller LoadBalancer 10.100.151.220 ac1f86093ea7240c89457da3d5f71fc4-947b3172412ab75c.elb.us-east-1.amazonaws.com 80:30416/TCP,443:31448/TCP 3m55s ingress-nginx-controller-admission ClusterIP 10.100.208.56 443/TCP 3m55s ``` -Check the console for a new Elastic Load Balancer (ELB) in the EC2 > Load Balancers section +Check the console for a new Elastic Load Balancer (ELB) in the EC2 > Load +Balancers section using the `EXTERNAL-IP` from the previous `kubectl` output. ```bash curl ac1f86093ea7240c89457da3d5f71fc4-947b3172412ab75c.elb.us-east-1.amazonaws.com @@ -119,23 +122,73 @@ curl ac1f86093ea7240c89457da3d5f71fc4-947b3172412ab75c.elb.us-east-1.amazonaws.c ## Create a friendly CNAME record - +`export` the private key to the env vars using: +```bash +export ROLLUP_FAUCET_PRIV_KEY= +``` -![Screenshot 2023-10-17 at 8.14.12 PM.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/c6b9fdea-c5a3-4c8e-aa04-45f2a9a65eca/2dcc4c16-0813-461c-bd34-7ee65a4e7cf9/Screenshot_2023-10-17_at_8.14.12_PM.png) +:::danger +__NEVER__ use a private key you use on a live network. +::: ## Configure and Deploy Rollup -### Modify Dev-Cluster +### Update the `helm` Chart + +Pull the [Astria dev-cluster repo](https://github.com/astriaorg/dev-cluster): +```bash +git clone git@github.com:astriaorg/dev-cluster.git +cd dev-cluster +``` - +```yaml +... +- host: executor.{{ .Values.config.rollup.name }}. +... +- host: ws-executor.{{ .Values.config.rollup.name }}. +... +- host: faucet.{{ .Values.config.rollup.name }}. +... +- host: blockscout.{{ .Values.config.rollup.name }}. +... +``` -Modify https://github.com/astriaorg/dev-cluster/blob/main/charts/rollup/templates/ingress.yaml +Add an IngressClass so that the `metadata` section in the same file looks like: ```yaml metadata: @@ -145,77 +198,123 @@ metadata: kubernetes.io/ingress.class: nginx ``` -```yaml -- host: executor.{{ .Values.config.rollup.name }}.cryptarch.xyz -- host: ws-executor.{{ .Values.config.rollup.name }}.cryptarch.xyz -- host: faucet.{{ .Values.config.rollup.name }}.cryptarch.xyz -- host: blockscout.{{ .Values.config.rollup.name }}.cryptarch.xyz -``` +:::tip +You can see an example of these changes in [this PR here](https://github.com/astriaorg/dev-cluster/pull/119/files). +::: -### Get Sequencer Block Height +## Install the `astria-cli` + +Pull the [Astria repo](https://github.com/astriaorg/astria) and install the `astria-cli` ```bash -curl -s https://rpc.sequencer.dusk-1.devnet.astria.org/block | jq .result.block.header.height +git clone git@github.com:astriaorg/astria.git +cd astria +just install-cli +``` -"9452" +### Get Current Sequencer Block Height + +```bash +astria-cli sequencer blockheight get \ + --sequencer-url https://rpc.sequencer.dusk-1.devnet.astria.org/ ``` +Save the returned value for later. You will replace the +`` tag in the following sections with this +value. + ### Set Environment Variables -```yaml +Replace the tags in the commands and env vars below, as follows: + +| Var Name | Var Type | Description | +|-----|-----|-----| +| `` | String | The name of your rollup | +| `` | u64 | The id of your network | +| `` | u64 | The height of the sequencer (found above) | +| `` | [u8; 40] | A wallet address | +| `` | u64 | A balance. It is useful to make this a large value. | + + + + + +You can use environment variables to set the configuration for the rollup +config creation. Replace all the `<>` tags with their corresponding values. + +```bash export ROLLUP_USE_TTY=true export ROLLUP_LOG_LEVEL=DEBUG -export ROLLUP_NAME=josh-aws -export ROLLUP_CHAIN_ID=0x1234 -export ROLLUP_NETWORK_ID=111121 +export ROLLUP_NAME= +export ROLLUP_NETWORK_ID= export ROLLUP_SKIP_EMPTY_BLOCKS=false -# address from cast new -export ROLLUP_GENESIS_ACCOUNTS=0x7380E82605879574c468959508A7A5868b8AB022:100000000000000000000 -export ROLLUP_SEQUENCER_INITIAL_BLOCK_HEIGHT=9452 +export ROLLUP_GENESIS_ACCOUNTS=: +export ROLLUP_SEQUENCER_INITIAL_BLOCK_HEIGHT= export ROLLUP_SEQUENCER_WEBSOCKET=wss://rpc.sequencer.dusk-1.devnet.astria.org/websocket export ROLLUP_SEQUENCER_RPC=https://rpc.sequencer.dusk-1.devnet.astria.org ``` ### Create Config +Once the environment variables shown above are set, run the following command to +create the rollup config: ```bash -./astria-cli rollup config create +astria-cli rollup config create ``` -```bash -cat josh-aws-rollup-conf.yaml +You can then run: + +```sh +cat -rollup-conf.yaml +``` +to print out the config file contents to double check everything: + +```sh config: useTTY: true logLevel: DEBUG rollup: - name: josh-aws - chainId: '0x1234' - networkId: 111121 - skipEmptyBlocks: false - genesisAccounts: - - address: 7380E82605879574c468959508A7A5868b8AB022 - balance: '100000000000000000000' + name: + chainId: # derived from rollup name + networkId: + skipEmptyBlocks: true + genesisAccounts: + - address: 0x + balance: '' sequencer: - initialBlockHeight: 9452 - websocket: wss://rpc.sequencer.dusk-1.devnet.astria.org/websocket - rpc: https://rpc.sequencer.dusk-1.devnet.astria.org + initialBlockHeight: + websocket: ws://rpc.sequencer.dusk-1.devnet.astria.org/websocket + rpc: http://rpc.sequencer.dusk-1.devnet.astria.org + celestia: + fullNodeUrl: http://celestia-service:26658 +``` + +Export this file to the env vars as follows: +```bash +export ROLLUP_CONF_FILE=-rollup-conf.yaml ``` +## Create new sequencer account + ```bash -./astria-cli sequencer account create +astria-cli sequencer account create +``` +```bash Create Sequencer Account -Private Key: "7ff36352b6348e72ef0a1578f6b350ee0f2d6e4c3c3f2490915f805af2ad7c2d" -Public Key: "76d8d3b44ef9ddf4b3b554c04c78620934142dc86cc9db83283a0bc3c66d1e91" -Address: "34f2832ff6d3c23404a4adbe3eef504f82bc6b50" +Private Key: "0981...691c" +Public Key: "f08e...8a4d" +Address: "8f40...64fb" ``` ```bash -export COMPOSER_PRIV_KEY=7ff36352b6348e72ef0a1578f6b350ee0f2d6e4c3c3f2490915f805af2ad7c2d -# priv key from cast new -export ROLLUP_FAUCET_PRIV_KEY=e71016b4bd662720f8424972bad190a9ed1793a020a4a96af93772c3eae6e05f +export SEQUENCER_PRIV_KEY=0981...691c ``` ### Create Namespace @@ -224,13 +323,28 @@ export ROLLUP_FAUCET_PRIV_KEY=e71016b4bd662720f8424972bad190a9ed1793a020a4a96af9 kubectl apply -f kubernetes/namespace.yml ``` -### Deploy Rollup +### Use locally modified chart + +:::danger +You __must__ have modified your local `helm` chart to use your own domain name +as described in [this section here](#update-the-helm-chart). +::: + +Because you needed to modify the host names inside your ingress template you must deploy your rollup using your local chart: + +```bash +export ROLLUP_CHART_PATH="/your_path_to/dev-cluster/charts/rollup" +``` + +### Deploy the Rollup Node + +Use the `astria-cli` to deploy the node. ```bash -./astria-cli rollup deployment create \ - --config josh-aws-rollup-conf.yaml \ +astria-cli rollup deployment create \ + --config $ROLLUP_CONF_FILE \ --faucet-private-key $ROLLUP_FAUCET_PRIV_KEY \ - --sequencer-private-key $COMPOSER_PRIV_KEY --chart-path charts/rollup + --sequencer-private-key $SEQUENCER_PRIV_KEY ``` ## Observe your Deployment