File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
examples/sol-anchor-contract Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ # sol-anchor-contract
2+
3+ This is a program developed as a Rust Smart Contract(Solana Blockchain).
4+ It acts as an example for developers who are new to Solana ecosystem to learn on how the program interacts with the Pyth Oracles.
5+
6+ Instructions of the program:
7+
8+ 1 . init
9+ 2 . loanToValue
10+
11+ Please find below instructions on running the Smart Contract on local cluster:
12+
13+ 1 .
14+
15+ - Open a new terminal
16+ - Run below command which clones two account addresses and their associated data into local cluster from devnet cluster.
17+
18+ solana-test-validator --reset --clone EdVCmQ9FSPcVe5YySXDPCRmc8aDQLKJ9xvYBMZPie1Vw 38xoQ4oeJCBrcVvca2cGk7iV1dAfrmTR1kmhSCJQ8Jto --url devnet
19+
20+ 2 .
21+
22+ - Open a new terminal.
23+ - Run below command which listens to transaction logs.
24+
25+ solana logs
26+
27+ 3 .
28+
29+ - Open a new terminal.
30+ - Navigate to the root directory of your application.
31+ - Build and then deploy.
32+ - Run below command
33+
34+ anchor test --skip-local-validator
35+
36+ NB
37+
38+ When tetsing on local cluster you may encounter error "Pyth price oracle is offline.", please find below one of the approaches of addressing it.
39+ - On file "src\lib.rs", change the value "60" to a higher figure on these lines of code ".get_price_no_older_than(current_timestamp1, 60)"
40+ and ".get_price_no_older_than(current_timestamp2, 60)". This should just be for testing purposes on local cluster.
You can’t perform that action at this time.
0 commit comments