Extend examples in README
This commit is contained in:
36
README.md
36
README.md
@@ -1,31 +1,28 @@
|
|||||||
# SonicClient
|
# SonicClient
|
||||||
This is a rudimentary [Sonic](https://github.com/valeriansaliou/sonic)
|
This is a rudimentary [Sonic](https://github.com/valeriansaliou/sonic) command-line client that I'm using to interact with a locally running service.
|
||||||
command-line client that I'm using to interact with a locally running
|
|
||||||
service.
|
|
||||||
|
|
||||||
## Server
|
## Server
|
||||||
You'll need a server running, to spin one up you can
|
You'll need a server running, to spin one up you can use the `docker-compose.yml` file in the `demo` directory, which pulls down the docker image from the docker hub.
|
||||||
use the `docker-compose.yml` file in the `demo`
|
|
||||||
directory, which pulls down the docker image from
|
|
||||||
the docker hub.
|
|
||||||
|
|
||||||
The required directory structure (`data/kv` and `data/fst`)
|
The required directory structure (`data/kv` and `data/fst`) is already in place, so to spin it up you only need to:
|
||||||
is already in place, so to spin it up you only need to:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ docker-compose up -d; docker-compose logs -f
|
$ docker-compose up -d; docker-compose logs -f
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Press `^C` whenever you want to stop viewing the server's logs.
|
||||||
|
|
||||||
## Client
|
## Client
|
||||||
To build the client you need a [Nim](https://nim-lang.org/) compiler
|
To build the client you need a [Nim](https://nim-lang.org/) compiler for your target architecture; once it's available, along with the `nimble` tool; you can build the client with:
|
||||||
for your target architecture; once it's available, along with the
|
|
||||||
`nimble` tool, you can build the client with:
|
|
||||||
```sh
|
```sh
|
||||||
|
$ # Build with a locally set up Nim compiler
|
||||||
$ nimble build --verbose -d:release
|
$ nimble build --verbose -d:release
|
||||||
```
|
```
|
||||||
|
|
||||||
and the binary will be left in the `./dist` directory.
|
and the binary will be left in the `./dist` directory.
|
||||||
|
|
||||||
## Usage
|
## Use
|
||||||
Once the client is build, run:
|
Once the client is build, run:
|
||||||
```
|
```
|
||||||
$ ./dist/sc --help
|
$ ./dist/sc --help
|
||||||
@@ -33,13 +30,10 @@ $ ./dist/sc --help
|
|||||||
to display the commands and options required.
|
to display the commands and options required.
|
||||||
|
|
||||||
## Environment variables
|
## Environment variables
|
||||||
The file `_envrc` contains an `.envrc` template for your
|
The file `_envrc` contains an `.envrc` template for your convenience; the client needs these three environment variables set up so it knows what server to interact with:
|
||||||
convenience; the client needs these three environment variables
|
|
||||||
set up so it knows what server to interact with:
|
|
||||||
|
|
||||||
* `SONIC_HOST`
|
* `SONIC_HOST` - hostname or IP address of Sonic server
|
||||||
* `SONIC_PORT`
|
* `SONIC_PORT` - tcp port Sonic server is listening on
|
||||||
* `SONIC_SECRET`
|
* `SONIC_SECRET` - password to connect to the server
|
||||||
|
|
||||||
You may use any method to set them up, and the `.envrc` method
|
You may use any method to set them up, and the `.envrc` method is just a convenience for all `direnv` users.
|
||||||
is just a convenience for those that use `direnv`.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user