From edd5ca12b18218f0a5dbe01ab1b20ecc01f4bd56 Mon Sep 17 00:00:00 2001 From: OGUNLEYE AYODAMOLA Date: Sat, 23 Mar 2024 14:12:56 +0100 Subject: [PATCH 1/4] Readme.md modified by ogunleye0720 --- docker/README.md | 250 +++++++++++++++++++++++++++++------------------ 1 file changed, 156 insertions(+), 94 deletions(-) diff --git a/docker/README.md b/docker/README.md index 3117818e73..2753a0a6eb 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,120 +1,182 @@ # Celestia `txsim` Docker Image Usage Guide -The `txsim` binary is a tool that can be used to simulate transactions on the Celestia network. It can be used to test the performance of the Celestia network. -This guide provides instructions on how to use the Celestia `txsim` Docker image. The `txsim` Docker image is designed to run the `txsim` binary with a variety of configurable options. +--- +Sidebar_label: Docker images +Description: Running Celestia-App using Docker. +--- ## Table of Contents -1. [Celestia `txsim` Docker Image Usage Guide](#celestia-txsim-docker-image-usage-guide) - 1. [Table of Contents](#table-of-contents) - 2. [Prerequisites](#prerequisites) - 3. [Running the Docker Image](#running-the-docker-image) - 1. [Docker Run](#docker-run) - 2. [Docker Compose](#docker-compose) - 3. [Kubernetes Deployment](#kubernetes-deployment) - 4. [Flag Breakdown](#flag-breakdown) + 1. [Docker Setup](#docker-setup) + 2. [Overview of celestia-app txsim](#overview-of-celestial-app-txsim) + 3. [Prerequisites](#prerequisites) + 4. [Quick-Start](#quick-start) + 5. [Docker Compose](#docker-compose) + 6. [Kubernetes Deployments](#kubernetes-deployments) + 7. [Flag Breakdown](#flag-breakdown) + +## 🐳 Docker setup + +This documentation provides a step by step guide on how to start up a celestia +app using a docker image. Docker provides a seamless setup for celestia-app +in an isolated environment on your machine. With Docker, +you do not have to worry about the manual configuration of the required +dependencies, which can be a pain. + +## Overview of celestia-app txsim + +The celestia-app `txsim` binary is a tool that can be +used to simulate transactions on the Celestia network. +The `txsim` Docker image is designed to run the `txsim` binary with a +variety of configurable options. ## Prerequisites -Before you can use the `txsim` Docker image, you must have a prefunded account set up. The `txsim` binary requires a prefunded account to function correctly. The keyring for this account should be stored in a file that can be accessed by the Docker container. +- [Docker Desktop for Mac or Windows](https://docs.docker.com/get-docker) or +[Docker Engine for Linux](https://docs.docker.com/engine/install/) +and a basic understanding of Docker. + +- A prefunded account set up with the keyring stored in a file, +to be accessed by an instance of the docker image. -## Running the Docker Image +## Quick-Start -### Docker Run +1. In your local machine, navigate to the home directory -You can run the `txsim` Docker image using the `docker run` command. Here's an example: + ```bash + cd $HOME + ``` -```bash -docker run -it -v ${HOME}/.celestia-app:/home/celestia ghcr.io/celestiaorg/txsim -k 0 -r http://consensus-validator-robusta-rc6.celestia-robusta.com:26657,http://consensus-full-robusta-rc6.celestia-robusta.com:26657 -g consensus-validator-robusta-rc6.celestia-robusta.com:9090 -t 10s -b 10 -d 100 -e 10 -``` +2. Create a file in which the keyring would be stored. +The file would be mounted as a volume into the docker container. -In this command, the `-v` option is used to mount the `${HOME}/.celestia-app` directory from the host to the `/home/celestia` directory in the Docker container. This allows the `txsim` binary to access the keyring for the prefunded account. + ```bash + touch .celestia-app + ``` -### Docker Compose +3. Using a suitable text editor of your choice, open the +.celestia-app file and paste the keyring of the prefunded account. -You can also run the `txsim` Docker image using Docker Compose. Here's an example `docker-compose.yml` file: +4. We recommend that you set the necessary file permission for the +.celestia-app file. A simple read access is all that is required for the +docker container to access the content of the file. -```yaml -version: '3' -services: - txsim: - image: ghcr.io/celestiaorg/txsim - command: > - -k 0 - -g consensus-validator-robusta-rc6.celestia-robusta.com:9090 - -t 10s - -b 10 - -d 100 - -e 10 - volumes: - - /Users/txsimp/.celestia-app:/home/celestia -``` +5. You can run the txsim Docker image using the docker run command below. -In this file, the `volumes` key is used to mount the `/Users/txsimp/.celestia-app` directory from the host to the `/home/celestia` directory in the Docker container. + ```bash + docker run -it \ + -v $HOME/.celestia-app:/home/celestia ghcr.io/celestiaorg/txsim \ + -k 0 \ + -r http://consensus-validator-robusta-rc6.celestia-robusta.com:26657, \ + http://consensus-full-robusta-rc6.celestia-robusta.com:26657 \ + -g consensus-validator-robusta-rc6.celestia-robusta.com: \ + -t 10s -b 10 -d 100 -e 10 + ``` -### Kubernetes Deployment +6. In this command, the -v option is used to mount the +$HOME/.celestia-app directory from the host to the /home/celestia +directory in the Docker container. +This allows the txsim binary to access the keyring for the prefunded account. -Finally, you can run the `txsim` Docker image in a Kubernetes cluster. Here's an example `deployment.yaml` file: +Congratulations! You have successfuly set up celestia-app in Docker 😎. -```yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: txsim-deployment -spec: - replicas: 1 - selector: - matchLabels: - app: txsim - template: - metadata: - labels: +## Docker Compose + +You can also run the `txsim` Docker image using Docker Compose. +Here's an example `docker-compose.yml` file: + + ```yaml + version: '3' + services: + txsim: + image: ghcr.io/celestiaorg/txsim + command: > + -k 0 + -g consensus-validator-robusta-rc6.celestia-robusta.com:9090 + -t 10s + -b 10 + -d 100 + -e 10 + volumes: + - /Users/txsimp/.celestia-app:/home/celestia + ``` + +In this file, the `volumes` key is used to mount +the `/Users/txsimp/.celestia-app directory from the host to +the `/home/celestia` directory in the Docker container. + +## Kubernetes Deployment + +Finally, you can run the `txsim` Docker image in a Kubernetes cluster. +Here's an example `deployment.yaml` file: + + ```yaml + apiVersion: apps/v1 + kind: Deployment + metadata: + name: txsim-deployment + spec: + replicas: 1 + selector: + matchLabels: app: txsim - spec: - containers: - - name: txsim - image: ghcr.io/celestiaorg/txsim - args: - - "-k" - - "0" - - "-g" - - "consensus-validator-robusta-rc6.celestia-robusta.com:9090" - - "-t" - - "10s" - - "-b" - - "10" - - "-d" - - "100" - - "-e" - - "10" - volumeMounts: + template: + metadata: + labels: + app: txsim + spec: + containers: + - name: txsim + image: ghcr.io/celestiaorg/txsim + args: + - "-k" + - "0" + - "-g" + - "consensus-validator-robusta-rc6.celestia-robusta.com:9090" + - "-t" + - "10s" + - "-b" + - "10" + - "-d" + - "100" + - "-e" + - "10" + volumeMounts: + - name: keyring-volume + mountPath: /home/celestia + volumes: - name: keyring-volume - mountPath: /home/celestia - volumes: - - name: keyring-volume - hostPath: - path: /Users/txsimp/.celestia-app -``` + hostPath: + path: /Users/txsimp/.celestia-app + ``` -In this file, the `volumeMounts` and `volumes` keys are used to mount the `/Users/txsimp/.celestia-app` directory from the host to the `/home/celestia` directory in the Docker container. +In this file, the `volumeMounts` and `volumes` keys are used to mount the +`/Users/txsimp/.celestia-app` directory from the host to the `/home/celestia` +directory in the Docker container. ## Flag Breakdown -Here's a breakdown of what each flag means: - -- `-k`: Whether a new key should be created (1 for yes, 0 for no) -- `-p`: The path to the keyring for the prefunded account -- `-g`: The gRPC endpoint for the `txsim` binary -- `-t`: The poll time for the `txsim` binary -- `-b`: The number of blob sequences to run -- `-a`: The range of blobs to send per PFB in a sequence -- `-s`: The range of blob sizes to send -- `-m`: The mnemonic for the keyring -- `-d`: The seed for the random number generator -- `-e`: The number of send sequences to run -- `-i`: The amount to send from one account to another -- `-v`: The number of send iterations to run per sequence -- `-u`: The number of stake sequences to run -- `-w`: The amount of initial stake per sequence - -Please replace the placeholders in the examples with the actual values you want to use. +The table below provides a brief explanation of the +flags used in the docker run command in step 5 of the quick start instructions. + +| FLAG | DESCRIPTION | DEFAULT | OPTION | +| ---- | ---- | ---- | :----: | +|`-k`|Whether a new key should be created|0|1 for yes, 0 for no| +|`-p`|Path to keyring for prefunded account|-|-| +|`-g`|gRPC endpoint|consensus-validator-robusta-rc6.celestia-robusta.com:9090|| +|`-t`|Poll time for the `txsim` binary|10s|1s,2s,3s,4s,...| +|`-b`|Number of blob sequences to run|10|any integer value(1,2,3,...)| +|`-a`|Range of blobs to send per PFB in a sequence|-|-| +|`-s`|Range of blob sizes to send|-|-| +|`-m`|Mnemonic for the keyring |-|-| +|`-d`|Seed for the random number generator|100|any integer value (1,2,3,...)| +|`-e`|Number of send sequences to run|10|any integer value (1,2,3,...)| +|`-i`|Amount to send from one account to another|-|any integer value (1,2,3,...)| +|`-v`|Number of send iterations to run per sequence|-|any integer value (1,2,3,...)| +|`-u`|Number of stake sequences to run|-|any integer value (1,2,3,...)| +|`-w`|Amount of initial stake per sequence|-|any integer value (1,2,3,...)| + +Kindly replace the placeholders in the example docker run +command in step 5 of the quick start instructions, +with the actual values you want to use. + From b6fda4da94e141f8678d20a7b9cc54c28c351e7e Mon Sep 17 00:00:00 2001 From: OGUNLEYE AYODAMOLA Date: Sat, 23 Mar 2024 14:39:19 +0100 Subject: [PATCH 2/4] Readme.md modified by ogunleye0720 --- docker/README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docker/README.md b/docker/README.md index 2753a0a6eb..da3a60e5fc 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,10 +1,5 @@ # Celestia `txsim` Docker Image Usage Guide ---- -Sidebar_label: Docker images -Description: Running Celestia-App using Docker. ---- - ## Table of Contents 1. [Docker Setup](#docker-setup) From 9eef93fd99bf5a7a12d60caf1d14cee1fdd4fe4c Mon Sep 17 00:00:00 2001 From: OGUNLEYE AYODAMOLA Date: Sat, 23 Mar 2024 14:43:27 +0100 Subject: [PATCH 3/4] Readme.md modified by ogunleye0720 --- docker/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/README.md b/docker/README.md index da3a60e5fc..a1d2880dd4 100644 --- a/docker/README.md +++ b/docker/README.md @@ -3,11 +3,11 @@ ## Table of Contents 1. [Docker Setup](#docker-setup) - 2. [Overview of celestia-app txsim](#overview-of-celestial-app-txsim) + 2. [Overview of celestia-app txsim](#overview-of-celestia-app-txsim) 3. [Prerequisites](#prerequisites) 4. [Quick-Start](#quick-start) 5. [Docker Compose](#docker-compose) - 6. [Kubernetes Deployments](#kubernetes-deployments) + 6. [Kubernetes Deployments](#kubernetes-deployment) 7. [Flag Breakdown](#flag-breakdown) ## 🐳 Docker setup @@ -18,7 +18,7 @@ in an isolated environment on your machine. With Docker, you do not have to worry about the manual configuration of the required dependencies, which can be a pain. -## Overview of celestia-app txsim +## Overview of celestia app txsim The celestia-app `txsim` binary is a tool that can be used to simulate transactions on the Celestia network. From e14aa8f6b330bce6e079a5c9566645f553a5c618 Mon Sep 17 00:00:00 2001 From: OGUNLEYE AYODAMOLA Date: Sat, 23 Mar 2024 14:49:27 +0100 Subject: [PATCH 4/4] Readme.md modified by ogunleye0720 --- docker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index a1d2880dd4..edb269c955 100644 --- a/docker/README.md +++ b/docker/README.md @@ -12,7 +12,7 @@ ## 🐳 Docker setup -This documentation provides a step by step guide on how to start up a celestia +This documentation provides a step-by-step guide on how to start up a celestia app using a docker image. Docker provides a seamless setup for celestia-app in an isolated environment on your machine. With Docker, you do not have to worry about the manual configuration of the required