You need to run local PostgreSQL instance to allow compiler to check SQL quieries in advance:
- Create
kollider
user withkollider
password. - Allow database creation for the user. That is required for temporary databases for tests.
- Create
kollider_hedge
database and addkollider
as owner. - Set env variable with connection string
DATABASE_URL=postgresql://kollider:kollider@localhost:5432/kollider_hedge
- Run initial migrations with the following command:
cargo run --bin kollider-hedge-db migrate
- Run build (don't forget to set
DATABASE_URL
at the step 3):
cargo build
- Run tests:
cargo test
Provide the connection URL KOLLIDER_HEDGE_POSTGRES
environment or pass it via dbconnect
argument
KOLLIDER_HEDGE_POSTGRES=postgresql://kollider:kollider@localhost:5432/kollider_hedge kollider-hedge serve
Another example with all flags
kollider-hedge --api-key "<SOME_KEY>" --api-secret "<SOME_SECRET>" --password "<SOME_PASS>" --pair ".BTCUSD" --symbol "BTCEUR.PERP" serve
a --pair
option ".BTCUSD"
and type of contract --symbol "BTCEUR.PERP"
as well should be both supported by Kollider.
Alsow you can run CLI to access API of the plugin from the terminal:
kollider-hedge-cli --help
The environment variable RUST_LOG
manages output levels. Please refer to Documentation for full information.
The most verbosive option is RUST_LOG=trace
. We recommended to set up RUST_LOG=debug
for full debugging and RUST_LOG=kollider_hedge::api,kollider_hedge=debug,kollider_hedge_domain=debug
for setting up fine grained output per module level.
You can build the Docker images either by Nix or Docker:
- Nix:
./make-docker.sh
. The result image will be saved todocker-image-kollider-hedge.tar.gz
. You can load it with:
docker load < ./docker-image-kollider-hedge.tar.gz
- Docker:
docker build -t kollider-hedge .
Nix will produce more compact images (4 Kb agains 35 Mb) and doesn't require Docker daemon installed to build.
Next, you can run the image with docker compose. Put kollider secrets into the .env
file:
KOLLIDER_API_KEY="*******"
KOLLIDER_API_SECRET="*******"
KOLLIDER_API_PASSWORD="*********"
Run: docker-compose up
Best configuration to track API access errors:
RUST_LOG=kollider_hedge::api,kollider_hedge=trace,kollider_hedge_domain=debug
Full tracing (not recommended for most situations):
RUST_LOG=trace