Mirroring https://github.com/pyth-network/pyth-crosschain

benduran 4fd46b39ea chore(pyth-perf): crypto sockets connect 3 napja
.github 4fd61c6825 chore(lazer) Add live api test 3 hete
apps 4fd46b39ea chore(pyth-perf): crypto sockets connect 3 napja
contract_manager 31c364cf41 feat: performed a minor bump all packages, since all were changed in the big dual package update 2 hete
doc 64d4c90871 Update rust-code-guidelines.md 2 hónapja
governance 31c364cf41 feat: performed a minor bump all packages, since all were changed in the big dual package update 2 hete
lazer 7df069714f chore: bump pyth-lazer-client to 10.0.0 (#3202) 1 hete
licenses ee455f1196 [solidity sdk] Add zerolend AggregatorV3 adapter to SDK (#1437) 1 éve
packages b8cf3e55e7 chore: style tweaks and made appshell support the className override 3 napja
patches 9f054411b8 fix: fix broken wallet adapter in proposals app 8 hónapja
price_service 31c364cf41 feat: performed a minor bump all packages, since all were changed in the big dual package update 2 hete
pythnet 31c364cf41 feat: performed a minor bump all packages, since all were changed in the big dual package update 2 hete
target_chains a9013fd148 fix leak (#3181) 1 hete
.dockerignore d5b2fd7ee8 feat(hermes): configurable cache size (#2547) 7 hónapja
.envrc 7e293cf125 chore: upgrade nix flake dependencies 8 hónapja
.gitignore 2a42856431 feat(dev-hub) Pyth Core landing Page 1 hete
.gitmodules 5602f4b874 chore: remove erroneous git modules (#2347) 9 hónapja
.nvmrc 81655125f9 chore: upgrade javascript dependencies 7 hónapja
.pre-commit-config.yaml 2cd27d1d30 chore: fix pre-commit-config (#2834) 4 hónapja
.prettierignore cd2b055298 feat(lazer): create js solana sdk package (#2899) 3 hónapja
.tool-versions 81655125f9 chore: upgrade javascript dependencies 7 hónapja
Cargo.lock 7df069714f chore: bump pyth-lazer-client to 10.0.0 (#3202) 1 hete
Cargo.toml 6c7165ec25 feat: add hermes client (#2931) 3 hónapja
Dockerfile.node 81655125f9 chore: upgrade javascript dependencies 7 hónapja
LICENSE c7c8c2d2fc Update copyright messages 10 hónapja
README.md f09f81efb5 docs: updated readme to callout the new `create-pyth-package` script and the best practices docsite 1 hete
SECURITY.md 4a90dcb3c4 chore(lazer): add evm audit (#2527) 7 hónapja
clippy.toml 71d6a89aea chore: Rust toolchain/CI update and workspace setup (#2830) 4 hónapja
flake.lock 81655125f9 chore: upgrade javascript dependencies 7 hónapja
flake.nix 46c5db1088 fix(entropy-explorer): fix infinite spinner 2 hónapja
funding.json f5f5b8b3bc chore: add funding.json for op grant (#1608) 1 éve
package.json ea6eb11632 chore: renamed to @pythnetwork/create-pyth-package 1 hete
pnpm-lock.yaml 4fd46b39ea chore(pyth-perf): crypto sockets connect 3 napja
pnpm-workspace.yaml b366f26835 feat(component-library, insights-hub): added a <DocumentTitle /> component and incorporated it with the full-page price feeds view 1 hete
prettier.config.mjs b1dc4c27f5 chore: move prettier to individual packages & upgrade prettier 8 hónapja
rust-toolchain.toml 71d6a89aea chore: Rust toolchain/CI update and workspace setup (#2830) 4 hónapja
turbo.json dfcb87d16f chore: eslint yakshaving 3 hete

README.md

Pyth Crosschain

This repository acts as a monorepo for the various components that make up Pyth protocols.

Within this monorepo you will find the following subprojects:

Table of Contents

Target Chains

target_chains

This directory contains on-chain contracts and SDKs for all of the various blockchain runtimes that Pyth supports. Each subdirectory corresponds to a blockchain runtime. Inside each subdirectory, there are subfolders for contracts and SDKs.

Hermes

hermes

Hermes is an off-chain service which constantly observes Pythnet and the Wormhole network watching for price updates emitted from the Pyth contract. It exposes all observed attestations via a public API over HTTPS/WSS which can be consumed by client-side applications that wish to use Pyth pricing data.

The price_service/client directory provides an SDK for interacting with Hermes. However, most users will interact with the price service via a chain-specific SDK

For a guide on utilising this service in your project, see the chain-specific SDK and examples for your blockchain runtime in the target_chains directory.

Fortuna

fortuna

Fortuna is an off-chain service which can be used by Entropy providers.

Local Development

Setup

Please install the following tools in order to work in this repository:

  • NVM to manage your node version, then run nvm use 22 to ensure you are using node version 22.
    • Optionally, you can also use mise. If you install mise, you can run all of your commands like the following: mise x -- pnpm <SOME_COMMAND>, which will ensure you are running your commands while using the correct tool versions for this repository.
  • Foundry in order to use forge for Ethereum contract development
  • Solana CLI for working with Solana programs.
    • After installing, please run solana keygen new to generate a local private key.
  • Anchor for developing Solana programs.
  • Pre-commit is used to automatically format and lint the repository.
    • After installing, please run pre-commit install in the root of the repo to configure the checks to run on each git commit.
  • Rust

Pull requests

Use the Conventional Commits format for your commit messages and PR titles. In the PR description, please include a summary of the changes and any relevant context. Also, please make sure to update the package versions following the Semantic Versioning rules.

See also: Code guidelines

Releases

The repository has several CI workflows that automatically release new versions of the various components when a new Github release is published. Each component's workflow uses a specific tag format including the component name and version number (e.g., Fortuna uses the tag fortuna-vX.Y.Z). The general process for creating a new release is:

  1. Update the version number of the component in the repo, e.g., in package.json or Cargo.toml or wherever. Please follow Semantic Versioning for package versions.
  2. Submit a PR with the changes and merge them in to main.
  3. Create a new release on github. Configure the release to create a new tag when published. Set the tag name and version for the component you wish to release -- see the Releases page to identify the relevant tag.
  4. Publish the release. This step will automatically trigger a Github Action to build the package and release it. This step will e.g., publish packages to NPM, or build and push docker images.
    • Note that when publishing a public package, you should prune the auto-generated Github release notes to only include changes relevant to the release. Otherwise, the changelog will include commits from unrelated projects in the monorepo since the previous release.

Note that all javascript packages are released together using a tag of the form pyth-js-v<number>. (The number is arbitrary.) If you have a javascript package that shouldn't be published, simply add "private": "true" to the package.json file and it will be excluded from the publishing workflow. If you are creating a new public javascript package, you should add the following config option to package.json:

  "publishConfig": {
    "access": "public"
  },

Typescript Monorepo

All of the typescript / javascript packages in this repository are part of a turborepo monorepo.

Setting up

If you use nix and direnv, just cd to the project directory and direnv allow.

If you use nix but not direnv, just cd to the project directory and enter a nix development shell with nix develop.

If you don't use nix at all, then install the required system packages:

  • Node.js -- match the version to .nvmrc; you can use nvm to manage your Node.js version.
  • pnpm -- match the version to the version specified in package.json; you can experiment with corepack to manage your pnpm version for you.

Common tasks

The following tasks are the most common ways to interact with the monorepo. Thanks to turborepo, these tasks will coordinate building any needed dependencies, and task execution will be cached and will only re-run as necessary. For any of the following tasks, you can pass any valid turbo run option after --, for instance you could run pnpm test -- --concurrency 2.

  • pnpm turbo test: Run all unit tests, integration tests, linting, and format checks, as well as whatever other code checks any packages support.
  • pnpm turbo fix: Run auto fixes, including reformatting code and auto-fixing lint rules where possible.
  • pnpm turbo start:dev: Start all development servers in parallel.
  • pnpm turbo start:prod: Run production builds and start production mode servers in parallel.

Building a new web app, JS / TS library or CLI tool

To quickly get started, from the root of this repo, you can run the following:

  1. pnpm create-pyth-package
  2. Answer the prompts
  3. Once the script is done, you will have your new webb app, library or CLI tool bootstrapped with all the current best practices.

If you'd like to read more about the best practices, checkout this Notion page: https://www.notion.so/dourolabs/Creating-a-new-JavaScript-TypeScript-Package-2a33e0276d9380c2b249cad18bb48919

Audit / Feature Status

This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Or plainly spoken - this is a very complex piece of software which targets a bleeding-edge, experimental smart contract runtime. Mistakes happen, and no matter how hard you try and whether you pay someone to audit it, it may eat your tokens, set your printer on fire or startle your cat. Cryptocurrencies are a high-risk investment, no matter how fancy.