pyth-crosschain/target_chains/cosmwasm/deploy-scripts
Amin Moghaddam a7d133d063
[cosmwasm] CosmWasm integration with contract manager (#1025)
* Integrate with contract manager for wormhole script

* Remove deprecated scripts and more integration with contract manager

* Remove cosmwasm tools store

These configs are now held in the contract manager

* Update docs on cosmwasm

* Split cosmwasm package into 2 for fixing dependency issues

* Fix cosmwasm README.md

Co-authored-by: Ali Behjati <bahjatia@gmail.com>
2023-08-25 16:38:42 +02:00
..
src [cosmwasm] CosmWasm integration with contract manager (#1025) 2023-08-25 16:38:42 +02:00
README.md [cosmwasm] CosmWasm integration with contract manager (#1025) 2023-08-25 16:38:42 +02:00
package.json [cosmwasm] CosmWasm integration with contract manager (#1025) 2023-08-25 16:38:42 +02:00
tsconfig.json [cosmwasm] CosmWasm integration with contract manager (#1025) 2023-08-25 16:38:42 +02:00

README.md

How to add a new chain or contract

  1. Add the chain information to contract manager CosmWasmChains.yaml. You can lookup for rpc endpoints in this repo. The gasPrice is the average_gas_price of the chain + the chain token denom (Available in chain-registry chain.json file).

  2. If the wormhole contract is not deployed on the target chain run the following command:

    npm run instantiate-wormhole -- --private-key <YOUR_PRIVATE_KEY_HEX> --deploy <stable or edge> --chain <chain id>
    

    You can re-build the wormhole contract using the scripts given in wormhole-stub. Run build.sh and you will get the compiled contract code in wormhole-stub/artifacts

  3. Deploy the pyth contract:

    npm run instantiate-pyth --contract-version <X.Y.Z> --private-key <YOUR_PRIVATE_KEY_HEX> --deploy <stable or edge>
    
  4. You can test the new contract via contract manager scripts like this:

    cd ../../../contract_manager
    npx ts-node scripts/update_pricefeed.ts --private-key <YOUR_PRIVATE_KEY_HEX> --contract <CONTRACT_ID> --feed-id <FEED_ID>
    
  5. Commit the new entries added to contract manager yaml files

  6. Update documentation repos and add the new contract address