Skip to content

Commit

Permalink
chore: update README files to reflect latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kchrist-rocketfueldev committed Nov 2, 2023
1 parent 779ecdb commit 003eb32
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 20 deletions.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**

Expand All @@ -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

Expand Down Expand Up @@ -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="<recovery phrase>"
```

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 <pool id> --valaccount "$VALACCOUNT" --cache memory --rpc <rpc address> --rest <rest address> --chain-id=<chain id> --request-backoff 50 --debug
```
- `<recovery phrase>`: Replace this with your recovery phrase.
- `<pool id>`: Specify the pool ID you want to join.
- `<rpc address>`: Provide the RPC address of the network.
- `<rest address>`: Provide the REST API address.
- `<chain id>`: 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 <method> <args>
```
- `<method>`: Replace this with the name of the runtime method you want to test.
- `<args>`: 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
Expand Down
3 changes: 2 additions & 1 deletion common/docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion docker-integrations/tendermint/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 2 additions & 17 deletions docker-integrations/tendermint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
},
"workspaces": [
"common/*",
"docker-integrations/*",
"integrations/*",
"tools/*"
],
Expand Down

0 comments on commit 003eb32

Please sign in to comment.