Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius authored Mar 3, 2024
1 parent 4188180 commit 1fcf5e6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,29 @@ To interact with the system, run the client as follows:
./client --node 127.0.0.1:8001:1
```
The client expects an input string to be added to the distributed log. If the input string starts with an underscore (`_`), it should be followed by a number (e.g., `_ 3`). In this case, the client will attempt to read the log entry at the specified number.


### Distributed Key-Value Store Example

Additionally, there's an example implementing a distributed key-value (KV) store.

#### Starting KV Store Servers

To start the KV store servers, use:
```
./kv --server --id 1 --node 127.0.0.1:8001:1 --node 127.0.0.1:8002:2 --node 127.0.0.1:8003:3
./kv --server --id 2 --node 127.0.0.1:8001:1 --node 127.0.0.1:8002:2 --node 127.0.0.1:8003:3
./kv --server --id 3 --node 127.0.0.1:8001:1 --node 127.0.0.1:8002:2 --node 127.0.0.1:8003:3
```

#### Running the KV Client

To run the KV client, use:
```
./kv --client --node 127.0.0.1:8001:1
```
The KV client expects commands as input:
1. `set <key> <value>` - Adds or updates a value in the KV store.
2. `get <key>` - Retrieves a value by its key.
3. `list` - Displays all key/value pairs in the store.
4. `del <key>` - Deletes a key from the store.

0 comments on commit 1fcf5e6

Please sign in to comment.