Skip to content

Commit

Permalink
feat: testnet deployment (#94)
Browse files Browse the repository at this point in the history
* upload codes

* disable migration

* fix script & deploy

* bump deps

* rc8

* release

* readme

* fix workflow

* env

* final
  • Loading branch information
byeongsu-hong authored Feb 14, 2024
1 parent d1979e9 commit 43576f2
Show file tree
Hide file tree
Showing 14 changed files with 734 additions and 566 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: release

on:
push:
tags:
- "v*.*.*"

jobs:
artifact:
permissions:
contents: write
pull-requests: write

name: artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
run: |
rustup toolchain install 1.72 \
--profile minimal \
--target wasm32-unknown-unknown \
--no-self-update
- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Install Deps
run: make install-prod

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build wasm
run: |
cargo generate-lockfile
make ci-build
mv wasm_codes.zip ${{ env.ARTIFACT_NAME }}
sha256sum ${{ env.ARTIFACT_NAME }} > ${{ env.ARTIFACT_NAME }}.CHECKSUM
md5sum ${{ env.ARTIFACT_NAME }} > ${{ env.ARTIFACT_NAME }}.CHECKSUM.MD5
env:
ARTIFACT_NAME: ${{ github.event.repository.name }}-${{ github.ref_name }}.zip

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.ARTIFACT_NAME }}
${{ env.ARTIFACT_NAME }}.CHECKSUM
${{ env.ARTIFACT_NAME }}.CHECKSUM.MD5
env:
ARTIFACT_NAME: ${{ github.event.repository.name }}-${{ github.ref_name }}.zip
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ panic = "abort"
rpath = false

[workspace.package]
version = "0.0.6-rc6"
version = "0.0.6-rc8"
authors = [
"byeongsu-hong <[email protected]>",
"Eric <[email protected]>",
Expand Down
85 changes: 85 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Deploy Scripts

## Prerequisites

- [pnpm](https://pnpm.io/)

## Configuration

Create a `config.yaml` file in the root directory of the project. Default option for Osmosis testnet is following.

Also, you can check the full list of options in the [config.ts](./src/config.ts) file.

```yaml
network:
id: "osmo-test-5"
hrp: "osmo"
url: "https://rpc.osmotest5.osmosis.zone/"
gas:
price: "0.025"
denom: "uosmo"
domain: 1037 # osmo-test-5 -> ascii / decimal -> sum

signer: { PRIVATE_KEY }

deploy:
ism:
type: multisig
owner: { SIGNER_ADDRESS }
validators:
5:
addrs:
- { SIGNER_ETH_ADDRESS }
threshold: 1
420:
addrs:
- { SIGNER_ETH_ADDRESS }
threshold: 1
421613:
addrs:
- { SIGNER_ETH_ADDRESS }
threshold: 1

hooks:
default:
type: mock

required:
type: aggregate
owner: { SIGNER_ADDRESS }
hooks:
- type: merkle

- type: pausable
owner: { SIGNER_ADDRESS }
paused: false
- type: fee
owner: { SIGNER_ADDRESS }
fee:
denom: uosmo
amount: 1
```
## Usage
### Uploading Contract Codes
```bash
pnpm upload
```

### Deploying Contracts

```bash
pnpm deploy
```

## Maintaining

### Adding a new contract

1. Add a new module with actual contract output name in the [contracts](./src/contracts/) directory.
2. Class name should be upper camel case conversion of the contract name.
3. Import new module [contracts/index.ts](./src/index.ts) file.
4. If a new contract is ISM or Hook, add a new option to config type.
5. Add a new field to the Contracts class in the [deploy.ts](./src/deploy.ts) file.
Loading

0 comments on commit 43576f2

Please sign in to comment.