Skip to content

Commit

Permalink
fix: trouble shooting (#118)
Browse files Browse the repository at this point in the history
* feat: add signer alias to multisig ism config

* fix: correct example config

* fix: save agent config

* fix: remove existing deployment

* fix: error message

* fix: use hex addr

* fix: with initial isms

* fix: again

* fix: revert & use address only

* fix: new agent config definition

* fix: new docker agent image

* fix: add cw-hpl-exp

* fix: query or 0

* revert bump image version

* done
  • Loading branch information
byeongsu-hong committed Mar 8, 2024
1 parent 543708c commit ae3dc92
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 161 deletions.
41 changes: 26 additions & 15 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,36 @@ signer: '<private-key> or <mnemonic>'

deploy:
ism:
- 11155111
type: routing
owner: <signer>
isms:
- type: multisig
owner: <signer>
validators:
11155111:
addrs:
- <signer>
threshold: 1

hooks:
default:
type: mock

required:
type: aggregate
# if you keep it as "<signer>", the script will identify this as deployer address
owner: <signer>
hooks:
- type: merkle

- type: igp
owner: <signer>
configs:
11155111:
exchange_rate: 3000
gas_price: 5000
default_gas_usage: 30000

required:
type: aggregate
owner: <signer>
hooks:
- type: pausable
owner: <signer>
paused: false
Expand All @@ -76,14 +93,6 @@ deploy:
# if you didn't set the denom, it will be set as gas denom of network config
denom: uosmo
amount: 1

- type: igp
owner: <signer>
configs:
11155111:
exchange_rate: 3000
gas_price: 5000
default_gas_usage: 30000
```

## 2. Upload Contract Codes
Expand Down Expand Up @@ -146,8 +155,10 @@ Replace every `{sepolia_private_key}` and `{osmosis_private_key}` from files bel
And run with below command.

```bash
cd ./example

# Merge osmo-test-5.config.json and agent-config.docker.json
OSMOSIS_TESTNET_AGENT_CONFIG=$(cat ../context/osmo-test-5.config.json) && \
OSMOSIS_TESTNET_AGENT_CONFIG=$(cat ../context/osmo-test-5.config.json | jq -r '.chains.osmotest5') && \
OSMOSIS_TESTNET_AGENT_CONFIG_NAME=$(echo $OSMOSIS_TESTNET_AGENT_CONFIG | jq -r '.name') && \
cat ./hyperlane/agent-config.docker.json \
| jq ".chains.$OSMOSIS_TESTNET_AGENT_CONFIG_NAME=$(echo $OSMOSIS_TESTNET_AGENT_CONFIG)" > merge.tmp && \
Expand Down Expand Up @@ -206,7 +217,7 @@ yarn cw-hpl-exp warp deploy --pk 'YOUR_PRIVATE_KEY'
{ "hypErc20Osmo": "0x..." }

# deploy warp route on osmo-test-5
yarn cw-hpl warp deploy create ./warp/uosmo.json -n osmo-test-5
yarn cw-hpl warp create ./example/warp/uosmo.json -n osmo-test-5

# register osmo-test-5 warp route to sepolia warp route
yarn cw-hpl-exp warp link $hypErc20Osmo 1037 $OSMOSIS_WARP_ROUTE_ADDRESS --pk 'YOUR_PRIVATE_KEY'
Expand Down
47 changes: 21 additions & 26 deletions config.example.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,41 @@
networks:
- id: "localwasmd"
hrp: "uwasm"
- id: 'localwasmd'
hrp: 'uwasm'
endpoint:
rpc: "http://localhost:26657"
rest: "http://localhost:1317"
grpc: "http://localhost:9090"
rpc: 'http://localhost:26657'
rest: 'http://localhost:1317'
grpc: 'http://localhost:9090'
gas:
price: "0.025"
denom: "uwasm"
price: '0.025'
denom: 'uwasm'
domain: 1063 # localwasmd -> ascii / decimal -> sum

- id: "localosmosis"
hrp: "osmo"
- id: 'localosmosis'
hrp: 'osmo'
endpoint:
rpc: "http://localhost:26657"
rest: "http://localhost:1317"
grpc: "http://localhost:9090"
rpc: 'http://localhost:26657'
rest: 'http://localhost:1317'
grpc: 'http://localhost:9090'
gas:
price: "0.025"
denom: "uosmo"
price: '0.025'
denom: 'uosmo'
domain: 1304 # localosmosis -> ascii / decimal -> sum

- id: "localneutron"
hrp: "neutron"
- id: 'localneutron'
hrp: 'neutron'
endpoint:
rpc: "http://localhost:26657"
rest: "http://localhost:1317"
grpc: "http://localhost:9090"
rpc: 'http://localhost:26657'
rest: 'http://localhost:1317'
grpc: 'http://localhost:9090'
gas:
price: "0.025"
denom: "untrn"
price: '0.025'
denom: 'untrn'
domain: 1302

signer: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef

deploy:
ism:
# # hpl_ism_multisig with default validator setup (signer = validator, threshold = 1)
# - 5
# - 420
# - 421613

# # hpl_ism_multisig
# type: multisig
# owner: <signer>
Expand Down
Empty file added context/.gitkeep
Empty file.
90 changes: 0 additions & 90 deletions context/osmo-test-5.json

This file was deleted.

3 changes: 3 additions & 0 deletions example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: '2'
services:
relayer:
container_name: hpl-relayer
# image: gcr.io/abacus-labs-dev/hyperlane-agent:9736164-20240307-131918
image: gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519
user: root
# restart: always
Expand All @@ -21,6 +22,7 @@ services:

validator-sepolia:
container_name: hpl-validator-sepolia
# image: gcr.io/abacus-labs-dev/hyperlane-agent:9736164-20240307-131918
image: gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519
user: root
# restart: always
Expand All @@ -40,6 +42,7 @@ services:

validator-osmotest5:
container_name: hpl-validator-osmotest5
# image: gcr.io/abacus-labs-dev/hyperlane-agent:9736164-20240307-131918
image: gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519
user: root
# restart: always
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build": "yarn clean && esbuild ./script --bundle --outfile=./dist/index.js --platform=node",
"start": "yarn build && node ./dist/index.js",
"cw-hpl": "yarn start",
"cw-hpl-exp": "tsx ./example",
"dev": "tsx ./script"
},
"keywords": [],
Expand Down
8 changes: 2 additions & 6 deletions script/commands/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { Command } from 'commander';

import { deployHook, deployIsm } from '../deploy';
import { saveAgentConfig } from '../shared/agent';
import { Client, config, getNetwork } from '../shared/config';
import {
Context,
ContextDeployments,
saveAgentConfig,
saveContext,
} from '../shared/context';
import { Context, ContextDeployments, saveContext } from '../shared/context';
import { deployContract, executeMultiMsg } from '../shared/contract';
import { CONTAINER, Dependencies } from '../shared/ioc';

Expand Down
25 changes: 8 additions & 17 deletions script/deploy/ism.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { Client, IsmType } from '../shared/config';
import { Context, ContextIsm } from '../shared/context';
import {
deployContract,
executeContract,
executeMultiMsg,
} from '../shared/contract';
import { deployContract, executeMultiMsg } from '../shared/contract';

const deployRoutingIsm = async (
ctx: Context,
Expand All @@ -21,17 +17,10 @@ const deployRoutingIsm = async (

const routing = await deployContract(ctx, client, 'hpl_ism_routing', {
owner: ism.owner === '<signer>' ? client.signer : ism.owner,
});

await executeContract(client, routing, {
router: {
set_routes: {
set: routes.map(({ domain, route }) => ({
domain,
route: route.address,
})),
},
},
isms: routes.map(({ domain, route }) => ({
domain,
address: route.address,
})),
});

return {
Expand Down Expand Up @@ -61,7 +50,9 @@ export async function deployIsm(
set_validators: {
domain: Number(domain),
threshold,
validators: addrs,
validators: addrs.map((v) =>
v === '<signer>' ? client.signer_addr : v,
),
},
},
}),
Expand Down
7 changes: 5 additions & 2 deletions script/shared/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ export async function fromContext(
index: {
from:
// sub 1 block to make sure we don't miss any block
parseInt(mailboxContractInfo.contract_info.created.block_height) -
1,
mailboxContractInfo
? parseInt(
mailboxContractInfo.contract_info.created.block_height,
) - 1
: undefined,
chunk: 10_000,
},
blocks: {
Expand Down
6 changes: 1 addition & 5 deletions script/shared/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@ export function loadContext(
const result = fs.readFileSync(fileName, 'utf-8');
return JSON.parse(result.toString()) as Context;
} catch (err) {
console.error(
'Failed to load context. Returning an empty context object.',
'err:',
err,
);
console.error('Failed to load context. Returning an empty context object.');
}

return {
Expand Down

0 comments on commit ae3dc92

Please sign in to comment.