Get started publishing data
Data providers can get started publishing data to the Pyth Network by performing the following steps.
Every data provider is identified on the network by a public key, and their prices are signed by the corresponding private key. You will need a Solana public/private key pair for this purpose. If you do not already have a keypair, you can create one using the instructions below:
# Install the Solana Tool Suite, needed for creating the key used to sign your transactions.
# See https://docs.solana.com/cli/install-solana-cli-tools for the latest version
sh -c "$(curl -sSfL https://release.solana.com/v1.14.13/install)"
# Generate a public/private keypair.
solana-keygen new --no-bip39-passphrase --outfile publish_key_pair.json
This command will create a public/private keypair in
publish_key_pair.json. Please extract the public key from this file and share it with the Pyth Data Association so they can enable you to publish prices.
# Print the public key of the keypair.
solana-keygen pubkey publish_key_pair.json
This command will output the public key in base58 encoding and will look something like:
Most data providers choose to generate two separate keypairs, one for testing and one for production. If you do so, please share both public keys with the Pyth Data Association.
Every data provider to the network will require both a Pythnet RPC node and a Pythnet validator. The Pyth Data Association will assist you with this step.
Data providers can publish data to the network using the pyth-agent software package. This package abstracts away all of the communication with the underlying blockchain and exposes a simple JSON RPC interface for submitting price data. Please see the README of that package for instructions on using it. This software requires you to configure both the keypair and validators from the previous steps in order to run. Please also see the JSON RPC API documentation. Finally, the example publisher is a fully-worked example of how to integrate with the pyth-agent API.