From 003eb328fbde2dd432aaefe6b1b5568940d56ecd Mon Sep 17 00:00:00 2001 From: Kostas Christopoulos Date: Thu, 2 Nov 2023 11:13:25 +0200 Subject: [PATCH] chore: update README files to reflect latest changes --- README.md | 57 +++++++++++++++++++++++ common/docker/package.json | 3 +- docker-integrations/tendermint/Dockerfile | 2 +- docker-integrations/tendermint/README.md | 19 +------- package.json | 1 - 5 files changed, 62 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index da2458c4..f7f9a1fc 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ KYVE, the Web3 data lake solution, is a protocol that enables data providers to - [@kyvejs/types](common/types/README.md) - holds all types for the KYVE application in typescript - [@kyvejs/sdk](common/sdk/README.md) - development kit for communicating with the KYVE blockchain - [@kyvejs/protocol](common/protocol/README.md) - core functionality for running validators on the KYVE network +- [@kyvejs/docker](common/docker/README.md) - core functionality facilitating dockerising KYVE functionality and communicating with dockerised runtimes via gRPC **Tools:** @@ -52,6 +53,7 @@ KYVE, the Web3 data lake solution, is a protocol that enables data providers to - [@kyvejs/tendermint](integrations/tendermint/README.md) - The official KYVE Tendermint sync integration - [@kyvejs/tendermint-bsync](integrations/tendermint-bsync/README.md) - The official KYVE Tendermint block sync integration +- [@kyvejs/tendermint-ssync](integrations/tendermint-ssync/README.md) - The official KYVE Tendermint block sync integration ## Build Integration Binaries @@ -85,6 +87,61 @@ yarn build:binaries The binaries can then be found in the `/out` folder +## Dockerized Execution + +In the Kyve project, the binaries can now be easily executed within a Docker container. This allows for simplified deployment and consistent runtime environments. Before running the Kyve binaries in a Docker container, please ensure that you have set up a Docker network. If you haven't already, you can create a Docker network using the following command: + +``` +docker network create --driver bridge kyve +``` + +**Building the Docker Image** + +To build a Docker image for Kyve Core, you can use the provided Dockerfile. Use the following command to build the image, while being in the root directory: + +``` +docker build -t kyve-core -f Dockerfile . +``` + +**Running Kyve Core in a Docker Container** + +Once you have built the Docker image, you can run Kyve Core in a Docker container. Below are the instructions for running Kyve Core as a node: + +1. Set your recovery phrase as the VALACCOUNT environment variable: + +``` +export VALACCOUNT="" +``` + +2. Run the Kyve Core container, replacing the placeholders with your specific parameters: + +``` +docker run --rm --name kyve-core --network kyve -e VALACCOUNT=$VALACCOUNT kyve-core ./kyve start --pool --valaccount "$VALACCOUNT" --cache memory --rpc --rest --chain-id= --request-backoff 50 --debug +``` +- ``: Replace this with your recovery phrase. +- ``: Specify the pool ID you want to join. +- ``: Provide the RPC address of the network. +- ``: Provide the REST API address. +- ``: Specify the chain ID you want to interact with. + +**Development and Testing** + +For development and testing purposes, you can also run specific runtime methods in the Dockerized Kyve Core. Here's how to do it: + +Run the Kyve Core container for a specific runtime method and arguments: +``` +docker run --rm --name kyve-core --network kyve kyve-core ./kyve runtime +``` +- ``: Replace this with the name of the runtime method you want to test. +- ``: Provide any required arguments for the runtime method. + +By following these instructions, you can easily dockerize and run Kyve Core and perform testing and development tasks. The Dockerized runtime provides a convenient and isolated environment for your Kyve project. + + + + + + ## How to contribute Checkout new branch to implement new features/fixes there diff --git a/common/docker/package.json b/common/docker/package.json index 56e07901..330fde73 100644 --- a/common/docker/package.json +++ b/common/docker/package.json @@ -27,7 +27,8 @@ "@kyvejs/protocol": "1.0.14", "ajv": "^8.12.0", "axios": "^0.27.2", - "dotenv": "^16.3.1" + "dotenv": "^16.3.1", + "lerna": "^7.1.1" }, "devDependencies": { "pkg": "^5.8.0", diff --git a/docker-integrations/tendermint/Dockerfile b/docker-integrations/tendermint/Dockerfile index 79656ffa..a09e1389 100644 --- a/docker-integrations/tendermint/Dockerfile +++ b/docker-integrations/tendermint/Dockerfile @@ -23,7 +23,7 @@ COPY package.json tsconfig.json ./ RUN yarn install --frozen-lockfile # Copy common files -COPY src ./src +COPY ./src ./src # Build the docker core RUN TARGET=latest-${TARGETOS}-${BINARYARCH} yarn run build:binaries diff --git a/docker-integrations/tendermint/README.md b/docker-integrations/tendermint/README.md index 650b2339..f0424638 100644 --- a/docker-integrations/tendermint/README.md +++ b/docker-integrations/tendermint/README.md @@ -44,23 +44,8 @@ on which tendermint chain gets archived the minimum hardware requirements are at This integration includes a Dockerfile which can be used to build a docker image. This Dockerfile uses multiple stages to separate the build time from the runtime requirements. The final image bundles all the architecture specific binaries and can be used to run the runtime on any architecture. The image can be built with the following command: -`cd ../ && docker build -t tendermint-grpc:v0.3 -f tendermint/Dockerfile .` -The image can be run for a specific architecture with the following command: - -`docker run --rm -p 50051:50051 tendermint-grpc:v0.2 ./kyve-linux-arm64` - -The allowed values for the last argument are: -* `./kyve-linux-arm64` -* `./kyve-linux-x64` -* `./kyve-macos-x64` - -### Docker assumptions - -This integration assumes that the `proto.runtime` file exists inside the `/src` folder. This file is used to generate the gRPC client and server code. The Dockerfile copies this file into the image and uses it to generate the code. If the file is not present, the build will not fail and the application will fail to start at runtime. - -At the moment the file is linked from the docker integration folder by use of a symbolic link. This is done to avoid having to copy the file into the integration folder every time it is changed. This is not ideal and should be changed in the future. - -`cd src/ && ln ../../docker/src/proto/runtime.proto runtime.proto` +`docker build -t tendermint-grpc:v0.3 -f Dockerfile .` +The image can will automatically build the appropriate binary based on your system and architecture. ## Integrations currently live diff --git a/package.json b/package.json index 8f74aebf..3f063628 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ }, "workspaces": [ "common/*", - "docker-integrations/*", "integrations/*", "tools/*" ],