lox/crates/lox-distributor
onyinyang f7fc44cbb1
Fix up metrics for invites distributed
2023-10-31 11:15:47 -04:00
..
src Fix up metrics for invites distributed 2023-10-31 11:15:47 -04:00
.gitignore Tentative structure for request handler 2023-01-25 15:49:40 -05:00
Cargo.toml Update metrics to count bridges 2023-10-30 15:21:40 -04:00
LICENSE Add License to Lox Distributor 2023-07-25 15:36:58 +00:00
README.md Add documentation for db setup and more frequent save 2023-09-13 14:21:15 -04:00
config.json Add prometheus http server 2023-10-30 15:20:23 -04:00

README.md

Lox Distributor

The Lox distributor receives resources from rdsys and writes them to Lox BridgeLines. Concurrently, it receives and responds to requests from Lox clients. It saves the LoxContext to a database every time the Lox bridgetable is updated and before the distributor is shutdown.

Configure rdsys stream

A test config.json is included for testing on a local instance of rdsys. This can be edited to correspond to the desired types of resources, endpoints and database configuration.

Test Run

For testing purposes, you will need a running instance of rdsys as well as a running Lox client.

Run rdsys locally

First clone rdsys from here then change into the backend directory:

cd rdsys/cmd/backend

Finally run rdsys:

 ./backend --config config.json

Database Config

The database has a few configuration options. The path for where the database should be read/written can be specified in the config.json. Rolling back to a previous version of the database is also possible by passing the roll_back_date flag at runtime and providing the date/time as a %Y-%m-%d_%H:%M:%S string. This argument should be passed if the LoxContext should be rolled back to a previous state due to, for example, a mass blocking event that is likely not due to Lox user behaviour. If the exact roll back date/time is not known, the last db entry within 24 hours from the passed roll_back_date will be used or else the program will fail gracefully.

Run Lox Distributor locally

Simply run cargo run -- config.json :)

Run a Lox client locally

First clone lox-wasm from here. Follow the instructions in the README to build and test the Lox client.