Skip to content

propeller-heads/pyth-publisher-propeller

 
 

Repository files navigation

Pyth Publisher

Propeller Heads publisher to Pyth Agent websocket API.

The publisher: # TODO: update this

  • Looks up the price accounts corresponding to the configured symbols from the on-chain program.
  • Based on the configured provider, subscribes to the feeds on Pythnet, or polls the prices from Coingecko.
  • Publishes price updates for those symbols in response to notify_price_sched messages from Pyth Agent.

Prerequisites

This requires a running instance of the pyth-agent binary to be running. To set this up, follow the instructions in Pyth Agent repository. Thepublisher.pythd.endpoint configuration value should be set to the pyth-agent websocket endpoint (e.g. ws://127.0.0.1:8910).

Configure

An example configuration file can be found in config/config.toml. The format of the configuration file is documented here.

Dev environment

  • Run aws codeartifact login --tool pip --repository protosim --domain propeller so we can access the propeller packages.
  • Create the dev environment conda env create -f requirements/environment_dev.yaml
  • Activate it with conda activate pyth
  • Install dependencies with pip install -r requirements/requirements.txt

Run

To run the publisher, execute the following command:

python pyth_publisher

The config used is at config/config.yaml.

Docker image

You can build the image:

export CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token --domain propeller --domain-owner 827659017777 --query authorizationToken --output text --duration 1800)
export PIP_INDEX_URL="https://aws:${CODEARTIFACT_AUTH_TOKEN}@propeller-827659017777.d.codeartifact.eu-central-1.amazonaws.com/pypi/protosim/simple/"

docker build --build-arg PIP_INDEX_URL=$PIP_INDEX_URL . -t 827659017777.dkr.ecr.eu-central-1.amazonaws.com/pyth:0.1.0-SNAPSHOT.$(git rev-parse --short HEAD)                      

If you need this image to run in the cluster and your OS is NOT a Linux, you need to run:

docker build --build-arg PIP_INDEX_URL=$PIP_INDEX_URL . -t 827659017777.dkr.ecr.eu-central-1.amazonaws.com/pyth:0.1.0-SNAPSHOT.$(git rev-parse --short HEAD) --platform linux/amd64                   

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.7%
  • Dockerfile 2.3%