Crates.io | coingecko_cache_loader |
lib.rs | coingecko_cache_loader |
version | 0.1.0 |
source | src |
created_at | 2020-11-17 00:14:31.5808 |
updated_at | 2020-11-17 00:14:31.5808 |
description | CoinGecko API poller for coin dominance and database loader for snapshots |
homepage | https://github.com/ferrosync/coingecko-cache |
repository | https://github.com/ferrosync/coingecko-cache |
max_upload_size | |
id | 313123 |
size | 124,585 |
Since CoinGecko doesn't have a historical API for cryptocurrency coin dominance, this functions as a workaround to cache and provide historical snapshots via a REST API.
This contains the following subprojects:
coingecko-cache-api
-- the REST API build on actix-web
coingecko-cache-loader
-- the CoinGecko API fetcher and database loaderThis project by default targets x86_64-unknown-linux-musl
to allow it to be
compiled statically and ran on any Linux machine without having to recompile.
In other words, once you build it, you can scp
the two binaries onto any Linux
machine.
To build everything for production, within the project root directory, run:
cargo build --release
The release binaries will be located in target/x86_64-unknown-linux-musl/release/
.
The two binaries require a Postgres instance (preferably Postgres 13, but Postgres 10 or above should work).
A docker-compose.yml
is provided which will automatically setup a Postgres 13
instance and run init.sql
to create the database schema for you. This
requires that you have Docker Compose installed.
To create the database, within the project root directory, run:
docker-compose up
Alternatively, simply run init.sql
on Postgres >=10 database and update the
.env
file accordingly.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.