Feeder allows to connect several price feeds to TDex Daemon(s) in order to automatically update the markets prices.
tdex-feeder connects to exchanges and retrieves market prices in order to consume the gRPC
interface exposed from tdex-deamon UpdateMarketPrice
.
-
Move the feeder into a folder in your PATH (eg.
/usr/local/bin
) and rename the feeder asfeederd
-
Give executable permissions. (eg.
chmod a+x /usr/local/bin/feederd
) -
Create config.json file.
# Run with default config and default flags.
$ feederd
# Run with debug mode and different config path.
$ FEEDER_CONFIG_PATH=./config.json feederd
Below is a list of commands you will probably find useful.
Build and use feederd
with docker.
At the root of the repository
docker build --pull --rm -f 'Dockerfile' -t feederd:latest .
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
Builds feeder as static binary and runs the project with default configuration.
make build-linux
make build-mac
make run-linux
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.