Powered by SunriseSunset.io
Using Cargo
If this is your first time working with Rust, set it up using rustup
# fetch the source
git clone https://github.com/solid-stack-solutions/terralux-backend
cd terralux-backend
# build and run
cargo runUsing Docker
# fetch source
git clone https://github.com/solid-stack-solutions/terralux-backend
cd terralux-backend
# build image
docker build -t terralux-backend:latest .
# prepare state file volume
touch state.json
# run image with state file volume
docker run -p 5000:5000 -v ./state.json:/root/.local/share/terralux-backend-state.json terralux-backend:latestUsing Nix Flakes
# option 1: fully automatic
nix run github:solid-stack-solutions/terralux-backend
# option 2: fetch source, build and run
git clone https://github.com/solid-stack-solutions/terralux-backend
cd terralux-backend
nix run# build and run while mocking connection to smart plug
cargo run -F mock_plug
# build and run with accelerated flow of time
cargo run -F demo_mode
### build and run with more logging
# in posix-compliant shells like bash you can do the following
# to set the environment variable RUST_LOG to a value like
# "terralux_backend=debug" just for executing one command (cargo run).
# on windows using cmd or powershell you might need different syntax.
RUST_LOG=terralux_backend=debug cargo run # more logging
RUST_LOG=terralux_backend=trace cargo run # too much logging