Skip to content

"Elite: Dangerous Trade Ear", a tool for ingesting and storing live E:D trade data

License

Notifications You must be signed in to change notification settings

mattyoung101/edtear

Folders and files

NameName
Last commit message
Last commit date

Latest commit

679a192 · Mar 22, 2025

History

26 Commits
Mar 6, 2025
Dec 19, 2024
Mar 6, 2025
Dec 16, 2024
Dec 14, 2024
Jan 2, 2025
Mar 6, 2025
Jan 2, 2025
Mar 22, 2025
Nov 20, 2024
Mar 22, 2025
Jan 17, 2025

Repository files navigation

EDTear

This is the "Elite: Dangerous Trade Ear", a service that subscribes to EDDN, and ingests nightly dumps from EDSM and Spansh, and sends all that to a PostgreSQL database with PostGIS enabled. It also allows you to see some interesting statistics about the Elite: Dangerous trade universe, once the data has been collected.

EDTear is used to create the data for Kural, my other project to build a high-performance trade-route calculator based on integer linear programming.

Parts of the SQL queries are based on Galos by Nathan Lilienthal.

Running

Requires a recent Rust version (I'm using 1.82), PostgresSQL 16+ with PostGIS, and the Rust sqlx CLI.

Setup database:

sqlx database create
sqlx migrate run

Import EDSM data:

cargo run --release -- ingest-edsm --systems-json-path systemsPopulated.json --stations-json-path stations.json --url postgres://postgres:password@localhost/edtear

Import Spansh's data (for landing pad sizes, which are not part of EDSM):

cargo run --release -- ingest-spansh --systems --galaxy-stations-json-path stations.json --url postgres://postgres:password@localhost/edtear

Listen to data from EDDN:

cargo run --release -- listen --url postgres://postgres:password@localhost/edtear

See some interesting statistics about the data, once collected:

cargo run --release -- stats --url postgres://postgres:password@localhost/edtear

Running in Docker Compose

Once you've set up the database locally, you can also run EDTear through Docker Compose, which may be useful for server deployments.

Make a file named postgres.env in this directory (and on the server) with the contents:

POSTGRES_PASSWORD=<password>

On your host system, dump the local database:

sudo -u postgres pg_dump -Fc edtear > edtear.dump

On the server, run docker compose up -d postgres to spawn a Postgres instance.

Import the data on the server (should prompt you for your password):

pg_restore -U postgres -h localhost -p 6543 -d edtear edtear.dump

Shutdown the current Postgres: docker compose down

And now deploy with the imported data: docker compose up -d

Licence

Copyright (c) 2024 Matt Young.

EDTear is available under the ISC licence.

Thanks

Special thanks to Nathan Lilienthal, EDSM, Spansh, and all the commanders who generously provide data to EDDN.

About

"Elite: Dangerous Trade Ear", a tool for ingesting and storing live E:D trade data

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published