|
|
1 éve | |
|---|---|---|
| .. | ||
| cli | 112db1d69e [Solana] Elevate wormhole core bridge dependency to workspace, stop using my branch (#1228) | 1 éve |
| migrations | 16caff1b04 [solana] Start to implement the solana receiver contract (#557) | 2 éve |
| program_simulator | d3ed683b91 [Solana] tests (#1226) | 1 éve |
| programs | 112db1d69e [Solana] Elevate wormhole core bridge dependency to workspace, stop using my branch (#1228) | 1 éve |
| .gitignore | 16caff1b04 [solana] Start to implement the solana receiver contract (#557) | 2 éve |
| .prettierignore | 16caff1b04 [solana] Start to implement the solana receiver contract (#557) | 2 éve |
| Anchor.toml | 6f3dd5cd10 [solana-reciever] update docs (#1192) | 1 éve |
| Cargo.lock | 112db1d69e [Solana] Elevate wormhole core bridge dependency to workspace, stop using my branch (#1228) | 1 éve |
| Cargo.toml | 112db1d69e [Solana] Elevate wormhole core bridge dependency to workspace, stop using my branch (#1228) | 1 éve |
| README.md | 43bc28d000 [Solana] readme update (#1217) | 1 éve |
| rust-toolchain.toml | 8202181a1b Solana receiver decode vaa accumulator (#1145) | 2 éve |
This folder contains:
programs/pyth-solana-receivercli/Receiving a price update from Pythnet involves two steps:
This contract offers two ways to post a price update from Pythnet onto Solana:
post_updates allows you to do it in 2 transactions and checks all the Wormhole guardian signatures (the quorum is currently 13 signatures). It relies on the Wormhole contract to verify the signatures.post_updates_atomic allows you to do it in 1 transaction but only partially checks the Wormhole guardian signatures (5 signatures seems like the best it can currently do). Therefore it is less secure. It relies on a guardian set account from the Wormhole contract to check the signatures against the guardian keys.post_updates is also a more efficient way to post updates if you're looking to post data for many different price feeds at a single point in time.
This is because it persists a verified encoded VAA, so guardian signatures will only get checked once. Then that single posted VAA can be used to prove the price update for all price feeds for that given point in time.
The program is currently deployed on Devnet with addresses:
HDwcJBJXjL9FpJ7UBsYBtaDjsBUhuLCUYoz3zr8SWWaQ for the Wormhole receiverrec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ for the Pyth receiverThe cli folder contains some useful client code to interact with both the Wormhole receiver and the Pyth receiver.
To run the full flow of posting a price update (on devnet) please follow the following steps:
Get a Hermes update from Hermes stable:
curl "https://hermes.pyth.network/api/latest_vaas?ids[]=0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace"
Post it to devnet:
cargo run --package pyth-solana-receiver-cli -- --url https://api.devnet.solana.com --keypair ${PATH_TO_KEYPAIR} --wormhole HDwcJBJXjL9FpJ7UBsYBtaDjsBUhuLCUYoz3zr8SWWaQ post-price-update-atomic -p ${HERMES_UPDATE_IN_BASE_64}
or
cargo run --package pyth-solana-receiver-cli -- --url https://api.devnet.solana.com --keypair ${PATH_TO_KEYPAIR} --wormhole HDwcJBJXjL9FpJ7UBsYBtaDjsBUhuLCUYoz3zr8SWWaQ post-price-update -p ${HERMES_UPDATE_IN_BASE_64}