- Install sui-cli - https://docs.sui.io/references/cli/client
- Setup localnet - https://docs.sui.io/guides/developer/getting-started/local-network
NETWORK=localnet SKIP_FAUCET=true PRIVATE_KEY=... yarn deploy
This will create object_ids.[NETWORK].json
file to be used by other scripts.
⚠⚠⚠ Remember to transfer the AdminCap and UpgradeCap to MultiSig Account! ⚠⚠⚠
sui client transfer --object-id <OBJECT_ID> --to <RECIPIENT_ADDRESS>
NETWORK=localnet yarn test
NETWORK=localnet yarn sample-run
- Connect the ledger
- Run the Sui application on it or rerun it when the ledger has gone into sleep mode
- WARN ON THE account ID (Default set to 0, as the first account) inside ledger-utils.ts
- Run
yarn ledger-utils
- Check multi sig address for the selected sig public keys; See
MULTI_SIG_PK_HEXES
in get-multi-sig-address.ts - Fill the config values in make-price-adapter-config.ts
- Run
yarn update-config
and save the returned Base64-encoded result asTRANSACTION_DATA
- Send the
TRANSACTION_DATA
to EVERY signer defined in point 1 (for the multi-sig account) - For the every particular signer, connect the ledger, then run
yarn ledger-utils $TRANSACTION_DATA
- Collect all responses, put it into combine-signatures.ts
- Run
yarn combine-signatures
and savemultiSigSignature
the returned value asMULTISIGSIG
- Run
sui client execute-signed-tx --tx-bytes $TRANSACTION_DATA --signatures $MULTISIGSIG
- Copy the version of the contract to be upgraded - name it with suffix
_vN
(for example,price_adapter_v2
) - Define the
DEPLOY_DIR
path inside your .env file - Perform the contract changes as described here.
- Follow the steps above
- Instead of points 2. and 3., run
yarn upgrade-package
. - The command will generate a
TRANSACTION_DATA
to sign, which also contains the bytecode of the upgraded source.
- Instead of points 2. and 3., run
- After invoking the
execute-signed-tx
, save the identifier of newly created package to theobject_ids.mainnet.json
file inside the newly copied directory (as in 1.)
It prevents writing to the object by the old logic, from the OLD relayer. Following the steps below, the OLD version relayer will stop working, because it requires the version objects compatibility. You will be able to read the written values in ANY version of the package.
- So firstly run a NEW relayer (which will be failing as their package version is different from object's version)
- Then migrate the object version in the new package to allow the new relayer to work,
by folowing the steps as described here, but
- Pass the version number to the
main(N)
function in migrate-object-version.ts - Instead of points 2. and 3., run
yarn migrate-object-version
. - The command will generate a
TRANSACTION_DATA
to sign
- Pass the version number to the