Skip to content

Commit

Permalink
feat(cli): add --skip-upgrade-record flag
Browse files Browse the repository at this point in the history
  • Loading branch information
saeta-eth authored and mjlescano committed Nov 5, 2024
1 parent ac859e8 commit 7b972e1
Show file tree
Hide file tree
Showing 16 changed files with 906 additions and 710 deletions.
4 changes: 3 additions & 1 deletion packages/cli/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ interface Params {
overrideResolver?: CannonRegistry;
wipe?: boolean;
persist?: boolean;
skipUpgradeRecord?: false;
plugins?: boolean;
privateSourceCode?: boolean;
rpcUrl?: string;
Expand All @@ -71,6 +72,7 @@ export async function build({
overrideResolver,
wipe = false,
persist = true,
skipUpgradeRecord = false,
plugins = true,
privateSourceCode = false,
rpcUrl,
Expand Down Expand Up @@ -446,7 +448,7 @@ export async function build({
const metaUrl = await runtime.putBlob(metadata);

// write upgrade-from info on-chain
if (stepsExecuted && persist) {
if (stepsExecuted && persist && !skipUpgradeRecord) {
for (let i = 0; i < 3; i++) {
try {
log(gray('Writing upgrade info...'));
Expand Down
9 changes: 7 additions & 2 deletions packages/cli/src/commands/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const commandsConfig: CommandsConfig = {
},
{
flags: '--dry-run',
description: 'Simulate building on a local fork rather than deploying on the real network',
description: 'Simulate building on a local fork rather than deploying on the real network.',
},
{
flags: '--keep-alive',
Expand All @@ -125,7 +125,12 @@ export const commandsConfig: CommandsConfig = {
},
{
flags: '--upgrade-from [cannon-package:0.0.1]',
description: 'Specify a package to use as a new base for the deployment.',
description: 'Specify a package to use as a new base for the deployment',
},
{
flags: '--skip-upgrade-record',
description:
'Skip step taken at the end of the build to save the execution record on-chain, which would be used for future reference on upgrades',
},
{
flags: '--registry-priority <registry>',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ applyCommandsConfig(program.command('build'), commandsConfig.build)
}

if (options.keepAlive && node) {
log(`The local node will continue running at ${node.host}`);
log(`The local node will continue running at ${node!.host}`);

const { run } = await import('./commands/run');

Expand Down
Loading

0 comments on commit 7b972e1

Please sign in to comment.