cosmic-interchain-cli
Version:
A command-line utility for Cosmic Wire's interchain messaging protocol
51 lines • 1.86 kB
JavaScript
import { $ } from 'zx';
import { readYamlOrJson } from '../../utils/files.js';
import { ANVIL_KEY, REGISTRY_PATH, getDeployedWarpAddress } from './helpers.js';
$.verbose = true;
/**
* Deploys the Warp route to the specified chain using the provided config.
*/
export async function hyperlaneWarpDeploy(warpCorePath) {
return $ `yarn workspace @hyperlane-xyz/cli run hyperlane warp deploy \
--registry ${REGISTRY_PATH} \
--overrides " " \
--config ${warpCorePath} \
--key ${ANVIL_KEY} \
--verbosity debug \
--yes`;
}
/**
* Applies updates to the Warp route config.
*/
export async function hyperlaneWarpApply(warpDeployPath, warpCorePath) {
return $ `yarn workspace @hyperlane-xyz/cli run hyperlane warp apply \
--registry ${REGISTRY_PATH} \
--overrides " " \
--config ${warpDeployPath} \
--warp ${warpCorePath} \
--key ${ANVIL_KEY} \
--verbosity debug \
--yes`;
}
export async function hyperlaneWarpRead(chain, warpAddress, warpDeployPath) {
return $ `yarn workspace @hyperlane-xyz/cli run hyperlane warp read \
--registry ${REGISTRY_PATH} \
--overrides " " \
--address ${warpAddress} \
--chain ${chain} \
--key ${ANVIL_KEY} \
--verbosity debug \
--config ${warpDeployPath}`;
}
/**
* Reads the Warp route deployment config to specified output path.
* @param warpCorePath path to warp core
* @param warpDeployPath path to output the resulting read
* @returns The Warp route deployment config.
*/
export async function readWarpConfig(chain, warpCorePath, warpDeployPath) {
const warpAddress = getDeployedWarpAddress(chain, warpCorePath);
await hyperlaneWarpRead(chain, warpAddress, warpDeployPath);
return readYamlOrJson(warpDeployPath);
}
//# sourceMappingURL=warp.js.map