GithubHelp home page GithubHelp logo

john2798 / example-publisher Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pyth-network/example-publisher

0.0 0.0 0.0 151 KB

Home Page: https://pyth.network

License: Apache License 2.0

Shell 0.12% Python 93.42% Dockerfile 6.45%

example-publisher's Introduction

Example Pyth Publisher

An example publisher demonstrating how to use the Pyth Agent websocket API to publish prices to Pyth. Pyth publishers publish their own first party data to the Pyth network. This example is created solely for demonstration/testing purposes and is not used in production by any publisher.

The publisher:

  • 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. This example publisher's publisher.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.

Run

Poetry is used to manage the dependencies and run the tests. If you don't have it installed, you can install following the instructions here.

# Install the dependencies
poetry install

# Run the tests
poetry run pytest

# Run the publisher
poetry run example-publisher --config config/config.toml

example-publisher's People

Contributors

ali-bahjati avatar tompntn avatar keyvankhademi avatar aditya520 avatar erancx avatar jayantk avatar john2798 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.