diff --git a/pages/price-feeds/troubleshoot.mdx b/pages/price-feeds/troubleshoot.mdx index 90a77e7c..635b0319 100644 --- a/pages/price-feeds/troubleshoot.mdx +++ b/pages/price-feeds/troubleshoot.mdx @@ -4,3 +4,4 @@ The following guide helps users integrating pyth price feeds to solve common iss Please select the component where you are facing the issue to get the troubleshooting steps. - [EVM Price Feeds Contract](troubleshoot/evm) +- [SVM Price Feeds Contract](troubleshoot/svm) diff --git a/pages/price-feeds/troubleshoot/_meta.json b/pages/price-feeds/troubleshoot/_meta.json index e549315a..c7e8d833 100644 --- a/pages/price-feeds/troubleshoot/_meta.json +++ b/pages/price-feeds/troubleshoot/_meta.json @@ -1,3 +1,4 @@ { - "evm": "EVM Price Feeds Contract" + "evm": "EVM Price Feeds Contract", + "svm": "SVM Price Feeds Contract" } diff --git a/pages/price-feeds/troubleshoot/svm.mdx b/pages/price-feeds/troubleshoot/svm.mdx new file mode 100644 index 00000000..05ead346 --- /dev/null +++ b/pages/price-feeds/troubleshoot/svm.mdx @@ -0,0 +1,18 @@ +# Troubleshoot Solana Price Feeds Contract + +This reference page is designed to help you troubleshoot common issues you may encounter when using Pyth Price Feeds on SVM chains. +Follow the steps provided below to diagnose and resolve the issue. + +1. `error[E0277]: the trait bound PriceUpdateV2: anchor_lang::AccountDeserialize is not satisfied{:rust}` + + This error happens when a program using the [`pyth-solana-receiver-sdk`](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) fails to compile. It is caused by an `anchor-lang` version mismatch. + Make sure the transitive version of `anchor-lang` brought by `pyth-solana-receiver-sdk` + matches the version of `anchor-lang` of your program's `Cargo.toml`. + + You can fix it by following these steps: + + - Check the version of `anchor-lang` in your [`Cargo.toml`](https://github.com/guibescos/anchor-pyth/blob/broken-build/programs/anchor-pyth/Cargo.toml) (in the example `0.29.0{:js}`) call it `x.y.z` + - Check the version of `anchor-lang` in the `pyth-solana-receiver-sdk` tree in [`Cargo.lock`](https://github.com/guibescos/anchor-pyth/blob/broken-build/Cargo.lock#L1400) (in the example `0.30.1{:js}`) call it `a.b.c` + - Run `cargo update -p anchor-lang@a.b.c --precise x.y.z{:bash}` + replacing `a.b.c` and `x.y.z` by the versions in the previous steps. For example:\ + `cargo update -p anchor-lang@0.30.1 --precise 0.29.0{:bash}` diff --git a/pages/price-feeds/use-real-time-data/solana.mdx b/pages/price-feeds/use-real-time-data/solana.mdx index 53a2ebed..c6e9cdc0 100644 --- a/pages/price-feeds/use-real-time-data/solana.mdx +++ b/pages/price-feeds/use-real-time-data/solana.mdx @@ -14,7 +14,7 @@ Pyth provides two SDKs for Solana applications to cover the on- and off-chain po ### Rust SDK -The [pyth-solana-receiver-sdk crate](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) can be used to consume Pyth prices inside Solana programs written in Rust. +The [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) crate can be used to consume Pyth prices inside Solana programs written in Rust. Add this crate to the dependencies section of your `Cargo.toml` file: ```toml copy @@ -22,6 +22,11 @@ Add this crate to the dependencies section of your `Cargo.toml` file: pyth-solana-receiver-sdk ="x.y.z" # get the latest version from https://crates.io/crates/pyth-solana-receiver-sdk ``` + +At the time of writing, [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) is compatible with Anchor `v0.28.0{:js}`, `v0.29.0{:js}`, and `v0.30.1{:js}`. +If you are on `v0.30.0{:js}` or any other version, please move to `v0.30.1{:js}`. + + ### Typescript SDK Pyth provides two Typescript packages, [@pythnetwork/price-service-client](https://github.com/pyth-network/pyth-crosschain/tree/main/price_service/client/js) and [@pythnetwork/pyth-solana-receiver](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/sdk/js/pyth_solana_receiver), for fetching Pyth prices and submitting them to the blockchain respectively.