bors[bot]
b9d8a7ba39
836: Introduce a supervisor actor that can restart another actor. r=thomaseizinger a=thomaseizinger 866: Bump vergen from 5.2.0 to 6.0.0 r=thomaseizinger a=dependabot[bot] Bumps [vergen](https://github.com/rustyhorde/vergen) from 5.2.0 to 6.0.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/rustyhorde/vergen/releases">vergen's releases</a>.</em></p> <blockquote> <h2>v6.0.0</h2> <ul> <li>The <code>Copy</code> impl was dropped from the <code>Config</code> struct to facilitate specifying a non-standard git base path.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago | |
---|---|---|
.. | ||
migrations | Save counterparty identity for cfds to the database | 3 years ago |
src | Merge #836 #866 #867 #868 #869 #870 | 3 years ago |
tests | Merge #831 | 3 years ago |
Cargo.toml | Merge #836 #866 #867 #868 #869 #870 | 3 years ago |
README.md | Add logging library and initialize by default | 3 years ago |
build.rs | Add new taker-frontend and rename old to maker-frontend | 3 years ago |
clippy.toml | Disallow calls to tokio::spawn outside dedicated extension trait | 3 years ago |
prepare_db.sh | Add script for preparing the DB for convenience | 3 years ago |
sqlx-data.json | Save counterparty identity for cfds to the database | 3 years ago |
README.md
Maker & Taker Daemon
Daemon that enables the frontend. The frontend is just a very thin display layer, the daemon does all the heavy lifting and calculations.
Database
We use an sqlite
database managed by sqlx
.
To make sqlx
handle the rust types correctly you have to generate sqlx-data.json
file upon every query change.
So, if you develop on the DB and change queries you will have to update the sqlx
rust mappings like this:
# crated temporary DB
DATABASE_URL=sqlite:tempdb cargo sqlx database create
# run the migration scripts to create the tables
DATABASE_URL=sqlite:tempdb cargo sqlx migrate run
# prepare the sqlx-data.json rust mappings
DATABASE_URL=sqlite:./daemon/tempdb cargo sqlx prepare -- --bin taker
Currently the database for taker and maker is the same.
The taker
binary is used as an example to run the prepare
command above, but it is irrelevant if you run it for taker or maker.
The tempdb
created can be deleted, it should not be checked into the repo.
You can keep it around and just run the prepare
statement multiple times when working on the database.
Logging
maker
and taker
both make use of a log library which can be controlled using the environment variable RUST_LOG
.
By default, logging is set to debug
for application specific logs only.
If you want to see logs by third party libraries, you need to set RUST_LOG=
.
For example, to enable logs for rocket, use:
RUST_LOG=rocket=debug cargo run --bin taker
Additionally, logs can be formatted in json format by passing --json
or -j
.