Getting started
Run flexpoold in three minutes with Docker, then from source.
With Docker (three minutes)π
git clone https://github.com/hupe1980/flexpool && cd flexpool
docker compose up -d --wait
curl -s localhost:8080/healthz
# {"status":"ok","version":"0.5.0","service":"flexpoold"}The daemon listens on 127.0.0.1:8080 only. Every response carries an x-request-id; every error is a problem document whose type links to the page that explains it.
curl -si localhost:8080/does-not-exist
# HTTP/1.1 404 Not Found
# content-type: application/problem+json
# {"type":".../problems/not-found/","title":"Not found","status":404,"code":"not-found",...}
docker compose downThe demo stack replays a market day on a test clock β see Sandbox and scenarios.
From sourceπ
With Rust 1.100 and just:
just run # flexpoold on 127.0.0.1:8080
just ci # the full gateTwo binariesπ
| Binary | What it does |
|---|---|
flexpoold | The daemon: flexpoold (or flexpoold serve), flexpoold check-config, flexpoold health |
flexpool | Offline tools: portfolio check, portfolio demo, scenario check, scenario run, alarms verify, alarms secret, token new, health |
just install puts flexpool on your path. It reads files only and never starts the daemon.
Configurationπ
Settings come from defaults, an optional TOML file and FLEXPOOL_* environment variables, in that order. check-config lists every setting with its value and where it came from, and reports every problem at once:
flexpoold check-config --config flexpoold.example.toml
FLEXPOOL_LOG_LEVEL=debug flexpoold check-config| Key | Default | Meaning |
|---|---|---|
http.listen | 127.0.0.1:8080 | Listen address |
http.body_limit_bytes | 1048576 | Maximum request body |
http.request_timeout_secs | 30 | Maximum request duration |
http.header_read_timeout_secs | 10 | Maximum time to read request headers |
http.max_in_flight | 256 | Requests in flight before answering 503 |
shutdown.grace_secs | 10 | Graceful shutdown window |
log.format | pretty | pretty or json |
log.level | info | Log filter |
docs.base_url | https://hupe1980.github.io/flexpool | Base of problem page links |
portfolio.dir | β | Directory with portfolio.toml and assets.csv (Portfolio) |
desk.dir | β | The built desk to serve at / (Desk) |
sandbox.scenario | β | Scenario file to replay on a test clock (Sandbox) |
sandbox.allow_remote | false | Allow clock control when listening beyond loopback |
auth.trusted_networks | 127.0.0.0/8,::1/128 | Peers that need no token (unless the request was forwarded) |
auth.token_hashes | β | SHA-256 of accepted bearer tokens, comma-separated (secret) |
auth.proxy_user_header | β | Identity header set by a trusted reverse proxy |
http.allowed_hosts | localhost,127.0.0.1,::1 | Host names answered to β add the public name behind a proxy (guards against DNS rebinding) |
alarms.journal | β | Alarm journal file, kept across restarts (Alarms) |
alarms.webhooks | β | Webhook URLs for paging, comma-separated (Alarms) |
alarms.webhook_secret | β | Standard Webhooks secret whsec_β¦ (secret) |
alarms.webhook_priority | 2 | Page priorities up to this number |
alarms.desk_url | β | Desk URL for links in pages |
events.source | β | CloudEvents source: a URI naming this deployment; required once events are sent (Events) |
events.webhooks | β | Webhook URLs for market events (offers, erasure confirmations), comma-separated |
events.webhook_secret | β | Standard Webhooks secret signing them (secret) |
events.inbound_secrets | β | Secrets that may sign events sent to POST /api/v1/events (secret) |
flex.domain | β | Our UFTP domain; empty: no offers (Flexibility market) |
flex.price_eur_per_mwh | 150 | Offer price per MWh of offered flexibility |
flex.min_activation_factor | 1 | Smallest share the grid operator may order |
erasure.consumer | flexpool | Name in erasure confirmations (Data protection) |
erasure.pending_file | β | Keeps erasures that wait for a person across restarts |
plan.round_trip_percent | 88 | Battery round-trip efficiency, 50β100 % (Plan) |
plan.cycle_cost | 0 | Cost per MWh discharged, 0β1,000 β¬/MWh |
book.max_order_mw | 0 | Pre-trade limit: largest order, MW (0: rated power) (Book) |
book.max_day_buy_eur | 0 | Pre-trade limit: largest worst-case purchase per day, β¬ (0: none) |
Exit codes: 0 success Β· 1 unhealthy Β· 2 configuration problems Β· 3 the listen address is taken.