Getting Started
Now that you have configured your feeder, it's time to start it up.
The service can be served in 2 different ways:
- as a standalone binary
- as a Docker service
Depending on your preferences and needs you may want to proceed in one or the other way.
If you already know how to start a feeder and are interested to securely connect it to a remote daemon (with macaroons/TLS enabled) take a look here.
#
Run the binaryIf you want to run your feeder as a standolne binary, you can download the latest version for your platform (linux or macOS) from the release page.
If you want to build it from source, you can follow the steps described in the README of the public repository. This requires Golang to be installed.
Now that you have the binary, it's time to execute it:
# This requires having a config.json file in the same directory of the binary$ ./feederd-linux-amd64
#Â This explicitly defines where to file the config file - it can have a different name!export FEEDER_CONFIG_PATH=~/.feeder-config/config.example.json$ ./feederd-linux-amd64
#
Run the containerIf you want to serve your feeder as a dockerized service, just download the latest image locally and run the container:
#Â Pull the image from the github container registry$ docker pull ghcr.io/tdex-network/feederd:latest
#Â Run the service$ docker run -rm --name feederd -v $HOME/.feeder-config/config.json:/config.json --network <network_with_tdexd_running> -d ghcr.io/tdex-network/feederd:latest
Make sure to use the proper rpc_address in the config file to connect to your daemon. For example, if you're serving the daemon as a docker container named tdexd
you will set it to tdexd:9000
taking advantage of the Docker internal DNS resolution.
tip
It's always a good practice to create a custom network where to run your inter-connected containers in order to isolate them.
#
Securely connect feeder to daemonIf you want to connect your feeder to a daemon with macaroon/TLS enabled on the Operator interface you have to:
- Be sure you followed the instructions to configure your daemon properly
- Copy the
price.macaroon
andcert.pem
generated by the daemon at startup (they can be found in daemon's datadir) to the machine hosting the feeder - Add the macaroons_path and the tls_cert_path of the file mentioned above and change the rpc_address for the target daemon in the feeder's config file
#
Example for standolone feeder$ export $FEEDER_CONFIG_PATH=~/.feeder-config/config.json$ ./feederd
Feeder's config file:
{ "price_feeder": "kraken", "interval": 300000, "targets": [ { "macaroons_path": "/home/user/.feeder-config/price.macaroon", "tls_cert_path": "/home/user/.feeder-config/cert.pem", "rpc_address": "provider.mydomain.com:9000" } ]}
#
Example for dockerized feeder# Note that the files must be mounted as volumes of the container!$ docker run -rm -d \ --name feederd \ -v $HOME/.feeder-config/config.json:/config.json \ -v $HOME/feeder-config/price.macaroon:/price.macaroon \ -v $HOME/feeder-config/cert.pem:/cert.pem \ ghcr.io/tdex-network/feederd:latest
Feeder's config file:
{ "price_feeder": "kraken", "interval": 300000, "targets": [ { "macaroons_path": "/price.macaroon", "tls_cert_path": "/cert.pem", "rpc_address": "provider.mydomain.com:9000" } ]}