Skip to content

Commit ff15c0c

Browse files
aditya520guibescos
andauthored
chore(pricefeed)-add-solana-anchor (#522)
* chore(pricefeed)-add-solana-anchor * pre-commit * requested changes * pre-commit * fix more stuff * update link --------- Co-authored-by: Guillermo Bescos <[email protected]>
1 parent d88d043 commit ff15c0c

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

pages/price-feeds/troubleshoot.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ The following guide helps users integrating pyth price feeds to solve common iss
44
Please select the component where you are facing the issue to get the troubleshooting steps.
55

66
- [EVM Price Feeds Contract](troubleshoot/evm)
7+
- [SVM Price Feeds Contract](troubleshoot/svm)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"evm": "EVM Price Feeds Contract"
2+
"evm": "EVM Price Feeds Contract",
3+
"svm": "SVM Price Feeds Contract"
34
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Troubleshoot Solana Price Feeds Contract
2+
3+
This reference page is designed to help you troubleshoot common issues you may encounter when using Pyth Price Feeds on SVM chains.
4+
Follow the steps provided below to diagnose and resolve the issue.
5+
6+
1. `error[E0277]: the trait bound PriceUpdateV2: anchor_lang::AccountDeserialize is not satisfied{:rust}`
7+
8+
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.
9+
Make sure the transitive version of `anchor-lang` brought by `pyth-solana-receiver-sdk`
10+
matches the version of `anchor-lang` of your program's `Cargo.toml`.
11+
12+
You can fix it by following these steps:
13+
14+
- 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`
15+
- 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`
16+
- Run `cargo update -p [email protected] --precise x.y.z{:bash}`
17+
replacing `a.b.c` and `x.y.z` by the versions in the previous steps. For example:\
18+
`cargo update -p [email protected] --precise 0.29.0{:bash}`

pages/price-feeds/use-real-time-data/solana.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ Pyth provides two SDKs for Solana applications to cover the on- and off-chain po
1414

1515
### Rust SDK
1616

17-
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.
17+
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.
1818
Add this crate to the dependencies section of your `Cargo.toml` file:
1919

2020
```toml copy
2121
[dependencies]
2222
pyth-solana-receiver-sdk ="x.y.z" # get the latest version from https://crates.io/crates/pyth-solana-receiver-sdk
2323
```
2424

25+
<Callout type="warning" emoji="">
26+
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}`.
27+
If you are on `v0.30.0{:js}` or any other version, please move to `v0.30.1{:js}`.
28+
</Callout>
29+
2530
### Typescript SDK
2631

2732
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.

0 commit comments

Comments
 (0)