diff --git a/README.md b/README.md index 1faae61..09ff1a7 100644 --- a/README.md +++ b/README.md @@ -14,58 +14,58 @@ If started on non-default dhcp port, it is assumed this is for testing, and dora [see example.yaml for all available options](./example.yaml). -## Build/Run +### Building dora for development -[To build and run dora in docker see docs/docker.md](./docs/docker.md) +You will need `sqlx-cli` to build, as sql queries written in Rust are checked against the database at compile time. [Install sqlx-cli](https://crates.io/crates/sqlx-cli) -`dora` requires a config file to start. See [example.yaml](./example.yaml) for all available options. +From workspace root run: -Use `DORA_LOG` env var for adjusting log level and which targets, see [here](https://docs.rs/tracing-subscriber/0.2.20/tracing_subscriber/fmt/index.html#filtering-events-with-environment-variables) for more options. +``` +sqlx database create +sqlx migrate run +``` -### Run dora quickly from source +This should create the `em.db` database specified in `.env`, it uses the `DATABASE_URL` env var so make sure that's not in use elsewhere, it can also be passed using `-d/--database-url`. -To run dora, bind to the default v4 addr (`0.0.0.0:67`) with a particular config use: +Use standard cargo subcommands to build (with the `--release` flag for no debug symbols): ``` -cargo run --bin dora -- -c path/to/config.json -d leases.db +cargo build ``` -### Build a dora binary +and run (by default dora will try to bind to privileged ports, which may require sudo), see the main dora binary [README](bin/README.md) for parameters. + +Or run help: ``` -cargo build +cargo run --bin dora -- --help ``` -optional: use `--release` flag for optimized binary without debug symbols +## Build/Run -binary will be present in target/{debug,release}/dora +[To build and run dora in docker see docs/docker.md](./docs/docker.md) -### Building dora for development +`dora` requires a config file to start. See [example.yaml](./example.yaml) for all available options. -You will need `sqlx-cli` to build, as sql queries written in Rust are checked against the database at compile time. [Install sqlx-cli](https://crates.io/crates/sqlx-cli) +Use `DORA_LOG` env var for adjusting log level and which targets, see [here](https://docs.rs/tracing-subscriber/0.2.20/tracing_subscriber/fmt/index.html#filtering-events-with-environment-variables) for more options. -From workspace root run: +### Run dora quickly from source + +To run dora, bind to the default v4 addr (`0.0.0.0:67`) with a particular config use: ``` -sqlx database create -sqlx migrate run +cargo run --bin dora -- -c path/to/config.json -d leases.db ``` -This should create the `em.db` database specified in `.env`, it uses the `DATABASE_URL` env var so make sure that's not in use elsewhere, it can also be passed using `-d/--database-url`. - -Use standard cargo subcommands to build (with the `--release` flag for no debug symbols): +### Build a dora binary ``` cargo build ``` -and run (by default dora will try to bind to privileged ports, which may require sudo), see the main dora binary [README](bin/README.md) for parameters. - -Or run help: +optional: use `--release` flag for optimized binary without debug symbols -``` -cargo run --bin dora -- --help -``` +binary will be present in target/{debug,release}/dora ### Cross compiling to ARM