From ab2262f249b5858d96fe47b88f9dfd5f215e3ba7 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 20:56:44 +0000 Subject: [PATCH 1/3] docs: update development.md with improved formatting and REPL command documentation Co-Authored-By: vinh@avaprotocol.org --- docs/development.md | 126 +++++++++++++++++++++++++------------------- 1 file changed, 71 insertions(+), 55 deletions(-) diff --git a/docs/development.md b/docs/development.md index d47c213d..55d726e9 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,122 +1,138 @@ -# Install protoc +# Development Guide -``` -# For working with grpc +## Installation Prerequisites + +Before you can start developing, you'll need to install the following tools: + +```bash +# For working with gRPC brew install grpc protobuf -# For generate abibinding +# For generating ABI bindings go install github.com/ethereum/go-ethereum/cmd/abigen@latest +# For gRPC tools npm install -g grpc-tools ``` -# Spin up local node +## Running a Local Node -For node that connect to Ava pre-deployed AVS contract on Holesky testnet, we need to create a `config/aggregator.yaml`. Ask a dev on how to construct this file. +For a node that connects to Ava pre-deployed AVS contract on Holesky testnet, you need to create a `config/aggregator.yaml` file. Contact a developer for help with constructing this file. -After having the config file, we can run the aggregator: +After having the config file, you can run the aggregator: -``` +```bash make dev-build make dev-agg ``` -Or use docker compsose directly: +Or use Docker Compose directly: -``` -# Only need to rebuild when having code change +```bash +# Only needed when code changes docker compose build +# Start the services docker compose up ``` +Once Docker Compose is up, there are two services running: -Once the docker compose is up, there are 2 services running: - -1. The aggregator on localhost:2206 -2. A GRPC webui to inspect and debug content on localhost:8080 +1. The aggregator on `localhost:2206` +2. A gRPC web UI to inspect and debug content on `localhost:8080` -Visit http://localhost:8080 and you can interactively create and construct -request to our grpc node. +Visit http://localhost:8080 to interactively create and construct requests to the gRPC node. -For detail of each method and payload, check the protocol.md docs. Look into `examples` to run example workflow against the local node +For details on methods and payloads, check the `protocol.md` documentation. Look into the `examples` directory to run example workflows against the local node. -# Run operator locally +## Running an Operator Locally -Run an operator locally allow you to schedule and seeing job execution. First, you need to prepare an `config/operator.yaml` file then run +Running an operator locally allows you to schedule and see job execution. First, prepare a `config/operator.yaml` file, then run: -``` +```bash make dev-op ``` -This local operator will connect to EigenLayer Holesky env, so you will need to make sure you have an existing operator keys onboard with EigenLayer. - +This local operator will connect to the EigenLayer Holesky environment, so you will need to make sure you have existing operator keys onboarded with EigenLayer. +## Live Reload -# Live reload +To automatically compile and live reload the node during development, run: -To auto compile and live reload the node, run: - - -``` +```bash make dev-live ``` ## Client SDK -We generate the client sdk for JavaScript. The code is generated based on our -protobuf definition on this file. +We generate the client SDK for JavaScript. The code is generated based on our protobuf definition files. ## Storage REPL -To inspect storage we use a simple repl. +To inspect storage, we use a simple REPL (Read-Eval-Print Loop) interface. Connect to it with: -``` +```bash telnet /tmp/ap.sock ``` -The repl support a few commands: +### Supported Commands -``` -list * -get -set -gc -`` - -Example: +The REPL supports the following commands: -### List everything +#### `list *` +Lists all keys that match the given prefix pattern. The asterisk (*) is used as a wildcard. -``` +Example: +```bash +# List all keys in the database list * -``` - -### List active tasks -``` +# List all active tasks list t:a:* ``` -### Read a key +#### `get ` +Retrieves and displays the value associated with the specified key. -``` +Example: +```bash +# Get the value of a specific task get t:a:01JD3252QZKJPK20CPH0S179FH ``` -### Set a key +#### `set ` +Sets a key to the specified value. You can also load values from files by prefixing the file path with an @ symbol. -``` +Examples: +```bash +# Set a key with a direct value set t:a:01JD3252QZKJPK20CPH0S179FH 'value here' -``` -Checkout repl.go for more information +# Set a key with the contents of a file +set t:a:01JD3252QZKJPK20CPH0S179FH @/path/to/file +``` +#### `gc` +Triggers garbage collection on the database with a ratio of 0.7. This helps reclaim space from deleted data. -## Reset storage +```bash +gc +``` -During development, we may have to reset storage to erase bad data due to schema change. Once we're mature we will implement migration to migrate storage. For now to wipe out storage run: +#### `exit` +Closes the REPL connection. +```bash +exit ``` + +#### `trigger` +This command is currently under development and not fully implemented. + +## Resetting Storage + +During development, you may need to reset storage to erase bad data due to schema changes. In the future, we will implement migration to properly migrate storage. For now, to wipe out storage, run: + +```bash make dev-clean ``` From a8a4dd9d57934140496343da9da39fa587974be3 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 21:15:12 +0000 Subject: [PATCH 2/3] docs: add missing rm and backup commands to development.md Co-Authored-By: vinh@avaprotocol.org --- docs/development.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/development.md b/docs/development.md index 55d726e9..e4aefe36 100644 --- a/docs/development.md +++ b/docs/development.md @@ -126,6 +126,22 @@ Closes the REPL connection. exit ``` +#### `rm *` +Deletes all keys that match the given prefix pattern. The command first lists all matching keys and then deletes them. + +```bash +# Delete all active tasks +rm t:a:* +``` + +#### `backup ` +Creates a backup of the database to the specified directory. The backup is stored in a timestamped subdirectory with a filename of `badger.backup`. + +```bash +# Backup the database to the /tmp/backups directory +backup /tmp/backups +``` + #### `trigger` This command is currently under development and not fully implemented. From 783991d14a2857e0b52af83bd50b2a6d7a00ff8a Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 21:21:09 +0000 Subject: [PATCH 3/3] docs: update rm command example to use generic prefix Co-Authored-By: vinh@avaprotocol.org --- docs/development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/development.md b/docs/development.md index e4aefe36..3814b92e 100644 --- a/docs/development.md +++ b/docs/development.md @@ -130,8 +130,8 @@ exit Deletes all keys that match the given prefix pattern. The command first lists all matching keys and then deletes them. ```bash -# Delete all active tasks -rm t:a:* +# Delete keys with a specific prefix +rm prefix:* ``` #### `backup `