diff --git a/site/docs/cli/deploy.md b/site/docs/cli/deploy.md index 833fd76..36f6f10 100644 --- a/site/docs/cli/deploy.md +++ b/site/docs/cli/deploy.md @@ -28,6 +28,10 @@ After finishing the deployment, update content hash of an ENS domain to point to blumen deploy --ens v1rtl.eth ``` +### `resolver-address` + +Use a custom ENS Resolver address. Resolvers for mainnet and goerli are set by default. + ### `chain` Default: `mainnet` diff --git a/site/docs/cli/ens.md b/site/docs/cli/ens.md index 0bfbe8e..f149111 100644 --- a/site/docs/cli/ens.md +++ b/site/docs/cli/ens.md @@ -34,3 +34,7 @@ blumen ens bafybeibp54tslsez36quqptgzwyda3vo66za3rraujksmsb3d5q247uht4 v1rtl.eth ### `rpc-url` Use a custom Ethereum RPC for transactions. By default, [Ankr RPCs](https://ankr.com/rpc) are used. + +### `resolver-address` + +Use a custom ENS Resolver address. Resolvers for mainnet and goerli are set by default. \ No newline at end of file diff --git a/src/actions/deploy.ts b/src/actions/deploy.ts index 6ce21c4..d718c57 100644 --- a/src/actions/deploy.ts +++ b/src/actions/deploy.ts @@ -16,6 +16,7 @@ type DeployActionArgs = { strict: boolean chain?: ChainName ens?: string + resolverAddress?: Address safe?: Address name?: string dist?: string @@ -25,7 +26,9 @@ type DeployActionArgs = { export const deployAction = async ( dir: string, - { strict, ens, chain = 'mainnet', safe, name: customName, dist, verbose, providers: providersList }: DeployActionArgs, + { + strict, ens, chain = 'mainnet', safe, name: customName, dist, verbose, providers: providersList, resolverAddress, + }: DeployActionArgs, ) => { if (!dir) { if (await exists('dist')) dir = 'dist' @@ -116,6 +119,6 @@ export const deployAction = async ( if (typeof ens === 'string') { console.log('\n') - await ensAction(cid, ens, { chain, safe }) + await ensAction(cid, ens, { chain, safe, resolverAddress }) } } diff --git a/src/actions/ens.ts b/src/actions/ens.ts index 7556684..ccbf8b9 100644 --- a/src/actions/ens.ts +++ b/src/actions/ens.ts @@ -26,8 +26,8 @@ export const ensAction = async ( cid: string, domain: string, { - chain: chainName, safe: safeAddress, rpcUrl, - }: { chain: ChainName } & Partial<{ safe: Address | EIP3770Address, rpcUrl: string }>, + chain: chainName, safe: safeAddress, rpcUrl, resolverAddress, + }: { chain: ChainName } & Partial<{ safe: Address | EIP3770Address, rpcUrl: string, resolverAddress: Address }>, ) => { const chain = chainName === 'mainnet' ? mainnet : goerli @@ -77,7 +77,7 @@ export const ensAction = async ( const request = await publicClient.prepareTransactionRequest({ account: from, - to: PUBLIC_RESOLVER_ADDRESS[chain.id as 1 | 5], + to: resolverAddress || PUBLIC_RESOLVER_ADDRESS[chain.id as 1 | 5], chain, data: encodeFunctionData({ functionName: 'setContenthash', diff --git a/src/cli.ts b/src/cli.ts index b9cbe55..f9ad78c 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -14,6 +14,7 @@ cli .command('deploy [dir]', 'Deploy a web app on IPFS') .option('--strict', 'Throw if one of the providers fails', { default: true }) .option('--ens ', 'Update Content-Hash of an ENS domain') + .option('--resolver-address
', 'Custom ENS Resolver address') .option('--chain ', 'Chain to use for ENS', { default: 'mainnet' }) .option('--name ', 'Name of the distribution (without file extension)') .option('--dist ', 'Directory to store the distribution file') @@ -37,6 +38,7 @@ cli .option('--chain ', 'Chain to use', { default: 'mainnet' }) .option('--safe ', 'Deploy using a Safe multisig wallet') .option('--rpc-url ', 'Custom Ethereum RPC') + .option('--resolver-address
', 'Custom ENS Resolver address') .action(ensAction) cli.help()