|
|
2 tygodni temu | |
|---|---|---|
| .. | ||
| src | 3e4c337d64 fix(pyth-sui-cli): fixed build | 3 tygodni temu |
| .gitignore | ab0cf6f7d8 chore: updated gitignore to excluse the built dist/ folder | 3 tygodni temu |
| .prettierignore | 6efbe89542 chore: updated prettier ignores to prevent bikeshedding | 2 tygodni temu |
| README.md | f5850b2052 feat(target_chains/sui): Use Turbo for Commands (#2469) | 8 miesięcy temu |
| package.json | 1eeca8ea7d chore: responded to offline PR feedback | 2 tygodni temu |
| tsconfig.build.json | 87679545bb chore: removed npm-specific things and removed more packageManager fields | 2 tygodni temu |
| tsconfig.json | fe92275443 chore: migrated all package.json and tsconfig files to a single, modern standard | 3 tygodni temu |
| turbo.json | f5850b2052 feat(target_chains/sui): Use Turbo for Commands (#2469) | 8 miesięcy temu |
Install move cli according to this doc
Configure the Move.toml file accordingly. The wormhole address should be specified based on the target chain in the Move.toml and the pyth address should be 0x0.
In order to run the commands, a SUI private key is needed. Often, the private key takes the form of "suiprivkey...". The example expects the key in the form of hex. You can use sui keytool convert to get the hex version fo the key, to be used below.
Run the following commands from the root of crosschain to ensure dependencies are correctly installed and built. You can install dependencies in root using pnpm install.
We can deploy the pyth oracle and initialize it with the following command:
pnpm turbo --filter @pythnetwork/pyth-sui-cli run cli -- deploy --private-key <private-key> --chain [sui_mainnet|sui_testnet]
You can then add your sui contract configs to the contract manager store.
You can also manually create all the price feeds available at the moment to make it easier for devs to test the oracle.
pnpm turbo --filter @pythnetwork/pyth-sui-cli run cli -- create-all --private-key <private-key> --contract <contract-id>
You can use the create and update-feeds commands to create and update price feeds respectively.
pnpm turbo --filter @pythnetwork/pyth-sui-cli run cli -- create --feed-id <feed-id> --private-key <private-key> --contract <contract-id>
pnpm turbo --filter @pythnetwork/pyth-sui-cli run cli -- update-feeds --feed-id <feed-id> --private-key <private-key> --contract <contract-id>
The following steps are needed to upgrade our sui contracts:
current_version and previous_version functions in version_control modulemigrate moduleRun the following command to generate the new hash, make sure the contract addresses are identical to the deployed ones:
pnpm turbo --filter @pythnetwork/pyth-sui-cli run cli -- generate-digest
To upgrade the contract after the governance vaa was executed run:
pnpm turbo --filter @pythnetwork/pyth-sui-cli run cli -- upgrade --private-key <private-key> --contract <contract-id> --vaa <upgrade-vaa>
The upgrade procedure consists of 2 transactions. The first one is to upgrade the contract (sui level) and the second one is to run the migrate function and upgrade the version (package level).
Since clients try to fetch the latest version of the package automatically, it's important to run the second transaction as soon as possible after the first one.
Transaction has non recoverable errors from at least 1/3 of validators. What should I do?
Make sure you have enough funding in the wallet and try again. Usually a more descriptive error message is available in the returned value of the transaction.