Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper scripts for deployments on osmosis and instructions #852

Merged
merged 11 commits into from
Sep 10, 2024
15 changes: 15 additions & 0 deletions DEV_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,18 @@ tbd
In order to balance tracking of our progress and speed of development we use the following rules for unplanned works that gets identified during a sprint:
* fix takes less than 1h and you address it immediately: no ticket required
* fix takes more than 1h or you don't address it immediately: create a ticket

## Releases

### Smart contracts
The following steps are required to release smart contracts:
1. Create a new release:
* Make sure you have the latest state: `git checkout main && git pull`
* Create a tag: `git tag -a "<TAG>" -m"<DESCRIPTION>"` (TAG should be of the form v[0-9]+.[0-9]+.[0-9]+)
* Push tag: `git push origin <TAG>`
2. Upload code through multisig (requires `osmosisd`):
* Create signed message: `bash scripts/generate_signed_upload_tx.sh <WASM_FILE> <DEPLOYER>`, where <DEPLOYER> is the name of your key registered with `osmosisd`.
* Collect signed messages from coworkers, when you have enough: `bash scripts/upload_through_multisig.sh "<SIGNED_TX_1> <SIGNED_TX_2>"`
3. Create proposal to instantiate or migrate contracts on [DAODAO](https://daodao.zone/dao/osmo12ry93err6s2ekg02ekslucwx8n3pxm3y7zxz3l6w8zuhex984k5ss4ltl6/proposals).
4. After the proposal did receive enough votes, it can be executed.
5. Please make sure that all instances of a contract are migrated. For a list of contracts, see https://docs.google.com/spreadsheets/d/1FFEfx8wjnqglSIPQe-B1cDvWv424D_-391XgwX600LI/edit#gid=0.
14 changes: 14 additions & 0 deletions scripts/generate_signed_upload_tx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

WASM_FILE=$1
DEPLOYER=$2

magiodev marked this conversation as resolved.
Show resolved Hide resolved
FEES=1000000uosmo
NODE=https://osmosis-rpc.publicnode.com:443
lubkoll marked this conversation as resolved.
Show resolved Hide resolved
MULTISIG=osmo1vxq5h3encfyguulqeh26l8dlw9lavl3e2zw7n8
CHAIN=osmosis-1

set -e

osmosisd tx wasm store ${WASM_FILE} --from contract-upload --gas 25000000 --fees ${FEES} --chain-id ${CHAIN} --node ${NODE} --generate-only > tx.json
lubkoll marked this conversation as resolved.
Show resolved Hide resolved
osmosisd tx sign tx.json --multisig=${MULTISIG} --sign-mode amino-json --chain-id ${CHAIN} --node ${NODE} --from ${DEPLOYER} --output-document ${DEPLOYER}-signed-tx.json
17 changes: 17 additions & 0 deletions scripts/upload_through_multisig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -e

if [ "$#" -ne 1 ]; then
echo "Too many arguments. Please provide a string containing the names of the json files of the signed transactions."
echo "Usage: bash upload_through_multisig.sh \"<SIGNED_TX_1> <SIGNED_TX_2>\""
exit 1
fi

SIGNED_TXS=$1
NODE=https://osmosis-rpc.publicnode.com:443
CHAIN=osmosis-1

osmosisd tx multisign tx.json contract-upload ${SIGNED_TXS} --chain-id ${CHAIN} --node ${NODE} --from contract-upload --output-document tx_ms.json
osmosisd tx broadcast tx_ms.json --chain-id ${CHAIN} --node ${NODE}
rm tx_ms.json
Loading