Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
25 changes: 23 additions & 2 deletions src/config/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,32 @@ import { cwd } from 'process';
const CONFIG_FILE_NAME = 'venn.config.json';
const LOCAL_CONFIG_PATH = join(cwd(), CONFIG_FILE_NAME);

export type SystemContracts = {
Firewall: string;
ApprovedCallsSigner: string;
PolicyDeployer: string;
ApprovedCallsFactory: string;
SafeCallTarget: string;
ProtocolRegistry: string;
};

type NetworksConfiguration = {
[network: string]: {
contracts: Array<string>;
contracts: {
[contractName: string]: string;
};
overrides?: Partial<SystemContracts>;
provider?: string;
};
};

type SubnetsConfiguration = {
[network: string]: {
subnets: number[];
};
};

type CLIConfig = {
export type CLIConfig = {
logLevel?: number;

fw?: {
Expand All @@ -25,6 +44,7 @@ type CLIConfig = {
};

networks?: NetworksConfiguration;
subnets?: SubnetsConfiguration;
privateKey?: string;
protocolMetadata?: string;
};
Expand Down Expand Up @@ -75,6 +95,7 @@ export default async () => {
},

networks: localConfig?.networks || undefined,
subnets: localConfig?.subnets || {},
privateKey: process.env.VENN_PRIVATE_KEY,
protocolMetadata: process.env.PROTOCOL_METADATA,
};
Expand Down
12 changes: 10 additions & 2 deletions src/venn/enable/enable.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class EnableVennCommand extends CommandRunner {

@Option({
flags: '-n, --network <network>',
description: 'the network where the contracts are deployed (default: holesky)',
description: 'the network where the contracts are deployed',
defaultValue: 'holesky',
})
parseNetwork(network: string): string {
Expand All @@ -46,10 +46,18 @@ export class EnableVennCommand extends CommandRunner {

@Option({
flags: '--dry-run',
description: 'enable dry run mode (default: false)',
description: 'enable dry run mode',
defaultValue: false,
})
parseDryRun(): boolean {
return true;
}

@Option({
flags: '-s, --subnets <subnet...>',
description: 'the subnets to subscribe to (default: [ROOT_SUBNET])',
})
parseSubnets(subnet: string, subnetsAccumulator: string[] = []): number[] {
return [...subnetsAccumulator, subnet].map(Number).sort();
}
}
Loading