Skip to content

Commit

Permalink
feat: infra checkpoint deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
NOOMA-42 committed Dec 4, 2024
1 parent 5b90706 commit 840fad4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions typescript/infra/scripts/agent-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export enum Modules {
HELLO_WORLD = 'helloworld',
WARP = 'warp',
HAAS = 'haas',
CHECKPOINT = 'checkpoint',
}

export const REGISTRY_MODULES = [
Expand All @@ -82,6 +83,7 @@ export const REGISTRY_MODULES = [
Modules.INTERCHAIN_QUERY_SYSTEM,
Modules.TEST_RECIPIENT,
Modules.HOOK,
Modules.CHECKPOINT,
];

export function getArgs() {
Expand Down
13 changes: 13 additions & 0 deletions typescript/infra/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { buildArtifact as coreBuildArtifact } from '@hyperlane-xyz/core/buildArt
import { HelloWorldDeployer } from '@hyperlane-xyz/helloworld';
import {
ChainMap,
CheckpointDeployer,
ContractVerifier,
ExplorerLicenseType,
HypERC20Deployer,
Expand Down Expand Up @@ -240,6 +241,18 @@ async function main() {
config = {
ethereum: coreConfig.ethereum.defaultHook,
};
} else if (module === Modules.CHECKPOINT) {
const { core } = await getHyperlaneCore(environment, multiProvider);
config = {
...multiProvider.mapKnownChains((chain) => ({
mailbox: core.contractsMap[chain].mailbox.address,
})),
};
deployer = new CheckpointDeployer(
multiProvider,
contractVerifier,
concurrentDeploy,
);
} else {
console.log(`Skipping ${module}, deployer unimplemented`);
return;
Expand Down
10 changes: 9 additions & 1 deletion typescript/infra/src/config/agent/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ export interface HelmValidatorValues extends HelmStatefulSetValues {
export type CheckpointSyncerConfig =
| LocalCheckpointSyncerConfig
| S3CheckpointSyncerConfig
| GcsCheckpointSyncerConfig;
| GcsCheckpointSyncerConfig
| OnChainCheckpointSyncerConfig;

// These values are eventually passed to Rust, which expects the values to be camelCase
export const enum CheckpointSyncerType {
LocalStorage = 'localStorage',
S3 = 's3',
Gcs = 'gcs',
OnChain = 'onchain',
}

export interface LocalCheckpointSyncerConfig {
Expand All @@ -90,6 +92,12 @@ export type GcsCheckpointSyncerConfig = {
user_secrets?: string;
};

export type OnChainCheckpointSyncerConfig = {
type: CheckpointSyncerType.OnChain;
chainName: ChainName;
contractAddress: string;
};

export class ValidatorConfigHelper extends AgentConfigHelper<ValidatorConfig> {
readonly #validatorsConfig: ValidatorBaseChainConfigMap;

Expand Down

0 comments on commit 840fad4

Please sign in to comment.