Skip to content

Feeder allows to connect an external price feed to the TDex Daemon to determine the current market price

License

Notifications You must be signed in to change notification settings

tdex-network/tdex-feeder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3ae029c · Apr 23, 2021

History

10 Commits
Nov 27, 2020
Apr 23, 2021
Feb 26, 2021
Feb 26, 2021
Feb 26, 2021
Apr 23, 2021
Feb 26, 2021
Nov 27, 2020
Dec 10, 2020
Nov 9, 2020
Apr 23, 2021
Dec 10, 2020
Dec 10, 2020
Feb 26, 2021
Dec 10, 2020
Dec 10, 2020

Repository files navigation

tdex-feeder

Feeder allows to connect several price feeds to TDex Daemon(s) in order to automatically update the markets prices.

Overview

tdex-feeder connects to exchanges and retrieves market prices in order to consume the gRPC interface exposed from tdex-deamon UpdateMarketPrice.

tdex-schema

⬇️ Run Standalone

Install

  1. Download the latest release for MacOS or Linux

  2. Move the feeder into a folder in your PATH (eg. /usr/local/bin) and rename the feeder as feederd

  3. Give executable permissions. (eg. chmod a+x /usr/local/bin/feederd)

  4. Create config.json file.

Run

# Run with default config and default flags.
$ feederd

# Run with debug mode and different config path.
$ FEEDER_CONFIG_PATH=./config.json feederd 

🖥 Local Development

Below is a list of commands you will probably find useful.

Build and Run with docker

Build and use feederd with docker.

Build feederd docker image

At the root of the repository

docker build --pull --rm -f 'Dockerfile' -t feederd:latest . 

Run the daemon

Create a config.json file and run the following command in the same folder:

docker run -it --name feederd -v $HOME/config.json:/config.json --network="host" feederd

the $HOME/config.json is the path to the feederd configuration file.

--net=host in case you're running tdex-deamon locally

Build it yourself

Builds feeder as static binary and runs the project with default configuration.

Linux

make build-linux

Mac

make build-mac

Run Linux

make run-linux

Config file

Rename the file ./config.example.json into ./config.json and adapt if for your specific purpose. The default example connects to kraken socket and to a local instance of tdex-deamon.

daemon_endpoint: String with the address and port of gRPC host. Required.
kraken_ws_endpoint: String with the address and port of kraken socket. Required.
markets: Json List with necessary markets informations. Required.
  base_asset: String of the Hash of the base asset for gRPC request. Required.
  quote_asset: String of the Hash of the quote asset for gRPC request. Required.
  kraken_ticker: String with the ticker we want kraken to provide informations on. Required.
  interval: the minimum time in milliseconds between two updateMarketPrice requests. Required.