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

Manually tested infra secrets + CLI http registry #5120

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"undici": "^5.11",
"@trivago/prettier-plugin-sort-imports/@babel/parser": "^7.22.7",
"@typechain/ethers-v5": "11.1.2",
"typechain@npm:^8.0.0": "patch:typechain@npm%3A8.3.2#~/.yarn/patches/typechain-npm-8.3.2-b02e27439e.patch"
"typechain@npm:^8.0.0": "patch:typechain@npm%3A8.3.2#~/.yarn/patches/typechain-npm-8.3.2-b02e27439e.patch",
"@hyperlane-xyz/registry": "portal:/Users/yorhodes/hyperlane/registry"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will need to fix this
actually yarn link worked pretty well for me here

}
}
2 changes: 1 addition & 1 deletion typescript/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@aws-sdk/client-kms": "^3.577.0",
"@aws-sdk/client-s3": "^3.577.0",
"@hyperlane-xyz/registry": "6.6.0",
"@hyperlane-xyz/registry": "6.12.0-http.2",
"@hyperlane-xyz/sdk": "7.3.0",
"@hyperlane-xyz/utils": "7.3.0",
"@inquirer/core": "9.0.10",
Expand Down
5 changes: 4 additions & 1 deletion typescript/cli/src/context/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Signer, ethers } from 'ethers';
import {
DEFAULT_GITHUB_REGISTRY,
GithubRegistry,
HttpClientRegistry,
IRegistry,
MergedRegistry,
} from '@hyperlane-xyz/registry';
Expand Down Expand Up @@ -199,7 +200,7 @@ function getRegistry(
.filter((uri) => !!uri)
.map((uri, index) => {
const childLogger = logger.child({ uri, index });
if (isHttpsUrl(uri)) {
if (isHttpsUrl(uri) && uri.includes('github')) {
return new GithubRegistry({
uri,
logger: childLogger,
Expand All @@ -208,6 +209,8 @@ function getRegistry(
? PROXY_DEPLOYED_URL
: undefined,
});
} else if (uri.includes('http')) {
return new HttpClientRegistry(uri);
} else {
return new FileSystemRegistry({
uri,
Expand Down
2 changes: 1 addition & 1 deletion typescript/cli/src/utils/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function mergeJson<T extends Record<string, any>>(
}

export function readYaml<T>(filepath: string): T {
return yamlParse(readFileAtPath(filepath)) as T;
return yamlParse(readFileAtPath(filepath), { maxAliasCount: -1 }) as T;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will pull this into an atomic PR

}

export function tryReadYamlAtPath<T>(filepath: string): T | null {
Expand Down
2 changes: 1 addition & 1 deletion typescript/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@ethersproject/providers": "*",
"@google-cloud/secret-manager": "^5.5.0",
"@hyperlane-xyz/helloworld": "7.3.0",
"@hyperlane-xyz/registry": "6.6.0",
"@hyperlane-xyz/registry": "6.12.0-http.2",
"@hyperlane-xyz/sdk": "7.3.0",
"@hyperlane-xyz/utils": "7.3.0",
"@inquirer/prompts": "3.3.2",
Expand Down
25 changes: 25 additions & 0 deletions typescript/infra/scripts/http-registry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { HttpServer } from '@hyperlane-xyz/registry';

import { getRegistry as getMainnet3Registry } from '../config/environments/mainnet3/chains.js';
import { getRegistry as getTestnet4Registry } from '../config/environments/testnet4/chains.js';

import { getArgs } from './agent-utils.js';

async function main() {
const { environment } = await getArgs().argv;

const registry =
environment === 'mainnet3'
? await getMainnet3Registry()
: await getTestnet4Registry();

const server = new HttpServer(registry);
await server.start();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oooooh I see, I like this a lot

}

main()
.then()
.catch((e) => {
console.error(e);
process.exit(1);
});
158 changes: 151 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7320,7 +7320,7 @@ __metadata:
"@eslint/js": "npm:^9.15.0"
"@ethersproject/abi": "npm:*"
"@ethersproject/providers": "npm:*"
"@hyperlane-xyz/registry": "npm:6.6.0"
"@hyperlane-xyz/registry": "npm:6.12.0-http.2"
"@hyperlane-xyz/sdk": "npm:7.3.0"
"@hyperlane-xyz/utils": "npm:7.3.0"
"@inquirer/core": "npm:9.0.10"
Expand Down Expand Up @@ -7475,7 +7475,7 @@ __metadata:
"@ethersproject/providers": "npm:*"
"@google-cloud/secret-manager": "npm:^5.5.0"
"@hyperlane-xyz/helloworld": "npm:7.3.0"
"@hyperlane-xyz/registry": "npm:6.6.0"
"@hyperlane-xyz/registry": "npm:6.12.0-http.2"
"@hyperlane-xyz/sdk": "npm:7.3.0"
"@hyperlane-xyz/utils": "npm:7.3.0"
"@inquirer/prompts": "npm:3.3.2"
Expand Down Expand Up @@ -7537,15 +7537,15 @@ __metadata:
languageName: unknown
linkType: soft

"@hyperlane-xyz/registry@npm:6.6.0":
version: 6.6.0
resolution: "@hyperlane-xyz/registry@npm:6.6.0"
"@hyperlane-xyz/registry@portal:/Users/yorhodes/hyperlane/registry::locator=%40hyperlane-xyz%2Fmonorepo%40workspace%3A.":
version: 0.0.0-use.local
resolution: "@hyperlane-xyz/registry@portal:/Users/yorhodes/hyperlane/registry::locator=%40hyperlane-xyz%2Fmonorepo%40workspace%3A."
dependencies:
express: "npm:^4.21.2"
yaml: "npm:2.4.5"
zod: "npm:^3.21.2"
checksum: 10/4e8c955054a3872439f8a52ba208db848da1e46cdf920d4c0cf42080a147c4185d6fed2b00dec0320dfebeb7287578c8a95d3f2f81c2ba713a83a426a1793525
languageName: node
linkType: hard
linkType: soft

"@hyperlane-xyz/sdk@npm:7.3.0, @hyperlane-xyz/sdk@workspace:typescript/sdk":
version: 0.0.0-use.local
Expand Down Expand Up @@ -18598,6 +18598,26 @@ __metadata:
languageName: node
linkType: hard

"body-parser@npm:1.20.3":
version: 1.20.3
resolution: "body-parser@npm:1.20.3"
dependencies:
bytes: "npm:3.1.2"
content-type: "npm:~1.0.5"
debug: "npm:2.6.9"
depd: "npm:2.0.0"
destroy: "npm:1.2.0"
http-errors: "npm:2.0.0"
iconv-lite: "npm:0.4.24"
on-finished: "npm:2.4.1"
qs: "npm:6.13.0"
raw-body: "npm:2.5.2"
type-is: "npm:~1.6.18"
unpipe: "npm:1.0.0"
checksum: 10/8723e3d7a672eb50854327453bed85ac48d045f4958e81e7d470c56bf111f835b97e5b73ae9f6393d0011cc9e252771f46fd281bbabc57d33d3986edf1e6aeca
languageName: node
linkType: hard

"borsh@npm:^0.7.0":
version: 0.7.0
resolution: "borsh@npm:0.7.0"
Expand Down Expand Up @@ -20040,6 +20060,13 @@ __metadata:
languageName: node
linkType: hard

"cookie@npm:0.7.1":
version: 0.7.1
resolution: "cookie@npm:0.7.1"
checksum: 10/aec6a6aa0781761bf55d60447d6be08861d381136a0fe94aa084fddd4f0300faa2b064df490c6798adfa1ebaef9e0af9b08a189c823e0811b8b313b3d9a03380
languageName: node
linkType: hard

"cookie@npm:^0.4.1":
version: 0.4.2
resolution: "cookie@npm:0.4.2"
Expand Down Expand Up @@ -21250,6 +21277,13 @@ __metadata:
languageName: node
linkType: hard

"encodeurl@npm:~2.0.0":
version: 2.0.0
resolution: "encodeurl@npm:2.0.0"
checksum: 10/abf5cd51b78082cf8af7be6785813c33b6df2068ce5191a40ca8b1afe6a86f9230af9a9ce694a5ce4665955e5c1120871826df9c128a642e09c58d592e2807fe
languageName: node
linkType: hard

"encoding-down@npm:^6.3.0":
version: 6.3.0
resolution: "encoding-down@npm:6.3.0"
Expand Down Expand Up @@ -22990,6 +23024,45 @@ __metadata:
languageName: node
linkType: hard

"express@npm:^4.21.2":
version: 4.21.2
resolution: "express@npm:4.21.2"
dependencies:
accepts: "npm:~1.3.8"
array-flatten: "npm:1.1.1"
body-parser: "npm:1.20.3"
content-disposition: "npm:0.5.4"
content-type: "npm:~1.0.4"
cookie: "npm:0.7.1"
cookie-signature: "npm:1.0.6"
debug: "npm:2.6.9"
depd: "npm:2.0.0"
encodeurl: "npm:~2.0.0"
escape-html: "npm:~1.0.3"
etag: "npm:~1.8.1"
finalhandler: "npm:1.3.1"
fresh: "npm:0.5.2"
http-errors: "npm:2.0.0"
merge-descriptors: "npm:1.0.3"
methods: "npm:~1.1.2"
on-finished: "npm:2.4.1"
parseurl: "npm:~1.3.3"
path-to-regexp: "npm:0.1.12"
proxy-addr: "npm:~2.0.7"
qs: "npm:6.13.0"
range-parser: "npm:~1.2.1"
safe-buffer: "npm:5.2.1"
send: "npm:0.19.0"
serve-static: "npm:1.16.2"
setprototypeof: "npm:1.2.0"
statuses: "npm:2.0.1"
type-is: "npm:~1.6.18"
utils-merge: "npm:1.0.1"
vary: "npm:~1.1.2"
checksum: 10/34571c442fc8c9f2c4b442d2faa10ea1175cf8559237fc6a278f5ce6254a8ffdbeb9a15d99f77c1a9f2926ab183e3b7ba560e3261f1ad4149799e3412ab66bd1
languageName: node
linkType: hard

"ext@npm:^1.1.2":
version: 1.6.0
resolution: "ext@npm:1.6.0"
Expand Down Expand Up @@ -23305,6 +23378,21 @@ __metadata:
languageName: node
linkType: hard

"finalhandler@npm:1.3.1":
version: 1.3.1
resolution: "finalhandler@npm:1.3.1"
dependencies:
debug: "npm:2.6.9"
encodeurl: "npm:~2.0.0"
escape-html: "npm:~1.0.3"
on-finished: "npm:2.4.1"
parseurl: "npm:~1.3.3"
statuses: "npm:2.0.1"
unpipe: "npm:~1.0.0"
checksum: 10/4babe72969b7373b5842bc9f75c3a641a4d0f8eb53af6b89fa714d4460ce03fb92b28de751d12ba415e96e7e02870c436d67412120555e2b382640535697305b
languageName: node
linkType: hard

"find-cache-dir@npm:^2.0.0":
version: 2.1.0
resolution: "find-cache-dir@npm:2.1.0"
Expand Down Expand Up @@ -28330,6 +28418,13 @@ __metadata:
languageName: node
linkType: hard

"merge-descriptors@npm:1.0.3":
version: 1.0.3
resolution: "merge-descriptors@npm:1.0.3"
checksum: 10/52117adbe0313d5defa771c9993fe081e2d2df9b840597e966aadafde04ae8d0e3da46bac7ca4efc37d4d2b839436582659cd49c6a43eacb3fe3050896a105d1
languageName: node
linkType: hard

"merge-options@npm:^3.0.4":
version: 3.0.4
resolution: "merge-options@npm:3.0.4"
Expand Down Expand Up @@ -30339,6 +30434,13 @@ __metadata:
languageName: node
linkType: hard

"path-to-regexp@npm:0.1.12":
version: 0.1.12
resolution: "path-to-regexp@npm:0.1.12"
checksum: 10/2e30f6a0144679c1f95c98e166b96e6acd1e72be9417830fefc8de7ac1992147eb9a4c7acaa59119fb1b3c34eec393b2129ef27e24b2054a3906fc4fb0d1398e
languageName: node
linkType: hard

"path-to-regexp@npm:0.1.7":
version: 0.1.7
resolution: "path-to-regexp@npm:0.1.7"
Expand Down Expand Up @@ -31329,6 +31431,15 @@ __metadata:
languageName: node
linkType: hard

"qs@npm:6.13.0":
version: 6.13.0
resolution: "qs@npm:6.13.0"
dependencies:
side-channel: "npm:^1.0.6"
checksum: 10/f548b376e685553d12e461409f0d6e5c59ec7c7d76f308e2a888fd9db3e0c5e89902bedd0754db3a9038eda5f27da2331a6f019c8517dc5e0a16b3c9a6e9cef8
languageName: node
linkType: hard

"qs@npm:^6.10.0":
version: 6.12.3
resolution: "qs@npm:6.12.3"
Expand Down Expand Up @@ -33122,6 +33233,27 @@ __metadata:
languageName: node
linkType: hard

"send@npm:0.19.0":
version: 0.19.0
resolution: "send@npm:0.19.0"
dependencies:
debug: "npm:2.6.9"
depd: "npm:2.0.0"
destroy: "npm:1.2.0"
encodeurl: "npm:~1.0.2"
escape-html: "npm:~1.0.3"
etag: "npm:~1.8.1"
fresh: "npm:0.5.2"
http-errors: "npm:2.0.0"
mime: "npm:1.6.0"
ms: "npm:2.1.3"
on-finished: "npm:2.4.1"
range-parser: "npm:~1.2.1"
statuses: "npm:2.0.1"
checksum: 10/1f6064dea0ae4cbe4878437aedc9270c33f2a6650a77b56a16b62d057527f2766d96ee282997dd53ec0339082f2aad935bc7d989b46b48c82fc610800dc3a1d0
languageName: node
linkType: hard

"serialize-javascript@npm:6.0.0":
version: 6.0.0
resolution: "serialize-javascript@npm:6.0.0"
Expand All @@ -33143,6 +33275,18 @@ __metadata:
languageName: node
linkType: hard

"serve-static@npm:1.16.2":
version: 1.16.2
resolution: "serve-static@npm:1.16.2"
dependencies:
encodeurl: "npm:~2.0.0"
escape-html: "npm:~1.0.3"
parseurl: "npm:~1.3.3"
send: "npm:0.19.0"
checksum: 10/7fa9d9c68090f6289976b34fc13c50ac8cd7f16ae6bce08d16459300f7fc61fbc2d7ebfa02884c073ec9d6ab9e7e704c89561882bbe338e99fcacb2912fde737
languageName: node
linkType: hard

"servify@npm:^0.1.12":
version: 0.1.12
resolution: "servify@npm:0.1.12"
Expand Down
Loading