@layerzerolabs/export-deployments
Installation
yarn add @layerzerolabs/export-deployments
pnpm add @layerzerolabs/export-deployments
npm install @layerzerolabs/export-deployments
Usage
CLI
This package comes with a CLI interface and registers an executable called @layerzerolabs/export-deployments
:
@layerzerolabs/export-deployments --help
npx @layerzerolabs/export-deployments
Programatic usage
import { generateSafe } from "@layerzerolabs/export-deployments";
import { generate } from "@layerzerolabs/export-deployments";
generateSafe({
deploymentsDir: "./my/deployments",
outDir: "./generated",
});
If filtering of networks is necessary, createIncludeDirent
utility can be used to construct a quick filtering function:
import {
createIncludeDirent,
generateSafe,
} from "@layerzerolabs/export-deployments";
const includedNetworks = ["arbitrum-mainnet"];
const excludedNetworks = ["telos-testnet"];
generateSafe({
deploymentsDir: "./my/deployments",
outDir: "./generated",
includeNetworkDir: createIncludeDirent(includedNetworks, excludedNetworks),
});
Similar goes for deployment files:
import {
createIncludeDirent,
generateSafe,
} from "@layerzerolabs/export-deployments";
const includedContracts = ["MyContract", "OtherContract.json"];
const excludedContracts = ["TopSecret"];
generateSafe({
deploymentsDir: "./my/deployments",
outDir: "./generated",
includeDeploymentFile: createIncludeDirent(
includedContracts,
excludedContracts,
),
});