Skip to content

Commit 54aeb64

Browse files
yorhodesaroralanuk
andauthored
feat/CLI tool for monitoring warp route balances (#3231)
### Description Replay #3204 on main Co-authored-by: -f <[email protected]>
1 parent fa058a0 commit 54aeb64

File tree

12 files changed

+213
-172
lines changed

12 files changed

+213
-172
lines changed

.changeset/six-planets-love.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@hyperlane-xyz/infra': minor
3+
'@hyperlane-xyz/sdk': minor
4+
---
5+
6+
Added warp route artifacts type adopting registry schema
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Configs and artifacts for the deployment of Hyperlane Warp Routes
2+
# Between injective and inevm
3+
description: Hyperlane Warp Route artifacts
4+
timestamp: '2024-01-31T16:00:00.000Z'
5+
deployer: Abacus Works (Hyperlane)
6+
data:
7+
config:
8+
injective:
9+
protocolType: cosmos
10+
type: native
11+
hypAddress: inj1mv9tjvkaw7x8w8y9vds8pkfq46g2vcfkjehc6k
12+
name: Injective Coin
13+
symbol: INJ
14+
decimals: 18
15+
ibcDenom: inj
16+
inevm:
17+
protocolType: ethereum
18+
type: native
19+
hypAddress: '0x26f32245fCF5Ad53159E875d5Cae62aEcf19c2d4'
20+
name: Injective coin
21+
symbol: INJ
22+
decimals: 18
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Configs and artifacts for the deployment of Hyperlane Warp Routes
2+
# Between nautilus and bsc, solana
3+
description: Hyperlane Warp Route artifacts
4+
timestamp: '2023-09-23T16:00:00.000Z'
5+
deployer: Abacus Works (Hyperlane)
6+
data:
7+
config:
8+
bsc:
9+
protocolType: ethereum
10+
type: collateral
11+
hypAddress: '0xC27980812E2E66491FD457D488509b7E04144b98'
12+
tokenAddress: '0x37a56cdcD83Dce2868f721De58cB3830C44C6303'
13+
name: Zebec
14+
symbol: ZBC
15+
decimals: 9
16+
nautilus:
17+
protocolType: ethereum
18+
type: native
19+
hypAddress: '0x4501bBE6e731A4bC5c60C03A77435b2f6d5e9Fe7'
20+
name: Zebec
21+
symbol: ZBC
22+
decimals: 18
23+
solana:
24+
protocolType: sealevel
25+
type: collateral
26+
tokenAddress: 'wzbcJyhGhQDLTV1S99apZiiBdE4jmYfbw99saMMdP59'
27+
hypAddress: 'EJqwFjvVJSAxH8Ur2PYuMfdvoJeutjmH6GkoEFQ4MdSa'
28+
name: Zebec
29+
symbol: ZBC
30+
decimals: 9
31+
isSpl2022: true
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Configs and artifacts for the deployment of Hyperlane Warp Routes
2+
# Between neutron and mantapacific
3+
description: Hyperlane Warp Route artifacts
4+
timestamp: '2023-09-23T16:00:00.000Z'
5+
deployer: Abacus Works (Hyperlane)
6+
data:
7+
config:
8+
neutron:
9+
protocolType: cosmos
10+
type: collateral
11+
hypAddress: neutron1ch7x3xgpnj62weyes8vfada35zff6z59kt2psqhnx9gjnt2ttqdqtva3pa
12+
tokenAddress: ibc/773B4D0A3CD667B2275D5A4A7A2F0909C0BA0F4059C0B9181E680DDF4965DCC7
13+
name: Celestia
14+
symbol: TIA
15+
decimals: 6
16+
mantapacific:
17+
protocolType: ethereum
18+
type: synthetic
19+
hypAddress: '0x6Fae4D9935E2fcb11fC79a64e917fb2BF14DaFaa'
20+
name: Celestia
21+
symbol: TIA
22+
decimals: 6

typescript/infra/helm/warp-routes/templates/_helpers.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ The warp-routes container
6161
command:
6262
- ./node_modules/.bin/ts-node
6363
- ./typescript/infra/scripts/warp-routes/monitor-warp-routes-balances.ts
64-
- -l
64+
- -v
6565
- "10000"
66-
- -c
67-
- {{ .Values.config }}
66+
- -f
67+
- {{ .Values.configFilePath }}
6868
{{- end }}

typescript/infra/scripts/warp-routes/deploy-warp-monitor.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1+
import yargs from 'yargs';
2+
13
import { HelmCommand } from '../../src/utils/helm';
24

35
import { runWarpRouteHelmCommand } from './helm';
46

57
async function main() {
8+
const { filePath } = await yargs(process.argv.slice(2))
9+
.alias('f', 'filePath')
10+
.describe(
11+
'filePath',
12+
'indicate the filepatch to the warp route yaml file relative to typescript/infra',
13+
)
14+
.demandOption('filePath')
15+
.string('filePath')
16+
.parse();
17+
618
await runWarpRouteHelmCommand(
719
HelmCommand.InstallOrUpgrade,
820
'mainnet3',
9-
'neutron',
21+
filePath,
1022
);
1123
}
1224

typescript/infra/scripts/warp-routes/helm.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,32 @@ import { assertCorrectKubeContext, getEnvironmentConfig } from '../utils';
66
export async function runWarpRouteHelmCommand(
77
helmCommand: HelmCommand,
88
runEnv: DeployEnvironment,
9-
config: string,
9+
configFilePath: string,
1010
) {
1111
const envConfig = getEnvironmentConfig(runEnv);
1212
await assertCorrectKubeContext(envConfig);
13-
const values = getWarpRoutesHelmValues(config);
14-
13+
const values = getWarpRoutesHelmValues(configFilePath);
14+
const releaseName = getHelmReleaseName(configFilePath);
1515
return execCmd(
16-
`helm ${helmCommand} ${getHelmReleaseName(
17-
config,
18-
)} ./helm/warp-routes --namespace ${runEnv} ${values.join(
16+
`helm ${helmCommand} ${releaseName} ./helm/warp-routes --namespace ${runEnv} ${values.join(
1917
' ',
20-
)} --set fullnameOverride="${getHelmReleaseName(config)}"`,
18+
)} --set fullnameOverride="${releaseName}"`,
2119
);
2220
}
2321

2422
function getHelmReleaseName(route: string): string {
25-
return `hyperlane-warp-route-${route}`;
23+
const match = route.match(/\/([^/]+)-deployments\.yaml$/);
24+
const name = match ? match[1] : route;
25+
return `hyperlane-warp-route-${name}`;
2626
}
2727

28-
function getWarpRoutesHelmValues(config: string) {
28+
function getWarpRoutesHelmValues(configFilePath: string) {
2929
const values = {
3030
image: {
3131
repository: 'gcr.io/abacus-labs-dev/hyperlane-monorepo',
32-
tag: 'ae8ce44-20231101-012032',
32+
tag: 'a84e439-20240131-224743',
3333
},
34-
config: config, // nautilus or neutron
34+
configFilePath: configFilePath,
3535
};
3636
return helmifyValues(values);
3737
}

0 commit comments

Comments
 (0)