From 390704bd5fdfd3bca53c9f40c766907f6c5b0bc6 Mon Sep 17 00:00:00 2001 From: Ankur Jain Date: Mon, 3 Jun 2024 16:47:50 -0700 Subject: [PATCH] Change commitment level to confirmed. disable retry on rate limit - enabled Default was to max which took a long time which constantly checking the rpc causing rate limits. --- packages/cli/src/commands/create/CreateCliApp.ts | 9 ++++++++- packages/cli/src/commands/create/CreateCliPublisher.ts | 9 ++++++++- packages/cli/src/commands/create/CreateCliRelease.ts | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/commands/create/CreateCliApp.ts b/packages/cli/src/commands/create/CreateCliApp.ts index 5eca7b9..da19ac1 100644 --- a/packages/cli/src/commands/create/CreateCliApp.ts +++ b/packages/cli/src/commands/create/CreateCliApp.ts @@ -57,6 +57,7 @@ const createAppNft = async ( publisher, mintAddress, ], { + commitment: "confirmed", minContextSlot: blockhash.context.slot }); return { appAddress: mintAddress.publicKey.toBase58(), transactionSignature: txSig }; @@ -91,7 +92,13 @@ export const createAppCommand = async ({ storageParams, priorityFeeLamports = Constants.DEFAULT_PRIORITY_FEE, }: CreateAppCommandInput) => { - const connection = new Connection(url); + const connection = new Connection( + url, + { + commitment: "confirmed", + disableRetryOnRateLimit: true, + } + ); const { app: appDetails, publisher: publisherDetails } = await loadPublishDetailsWithChecks(); diff --git a/packages/cli/src/commands/create/CreateCliPublisher.ts b/packages/cli/src/commands/create/CreateCliPublisher.ts index e8f1d9b..8b294f7 100644 --- a/packages/cli/src/commands/create/CreateCliPublisher.ts +++ b/packages/cli/src/commands/create/CreateCliPublisher.ts @@ -48,6 +48,7 @@ const createPublisherNft = async ( publisher, mintAddress, ], { + commitment: "confirmed", minContextSlot: blockhash.context.slot }); return { publisherAddress: mintAddress.publicKey.toBase58(), transactionSignature: txSig}; @@ -78,7 +79,13 @@ export const createPublisherCommand = async ({ storageParams: string; priorityFeeLamports: number; }) => { - const connection = new Connection(url); + const connection = new Connection( + url, + { + commitment: "confirmed", + disableRetryOnRateLimit: true, + } + ); const { publisher: publisherDetails } = await loadPublishDetailsWithChecks(); diff --git a/packages/cli/src/commands/create/CreateCliRelease.ts b/packages/cli/src/commands/create/CreateCliRelease.ts index 86799cc..cef16e0 100644 --- a/packages/cli/src/commands/create/CreateCliRelease.ts +++ b/packages/cli/src/commands/create/CreateCliRelease.ts @@ -77,6 +77,7 @@ const createReleaseNft = async ({ publisher, releaseMintAddress, ], { + commitment: "confirmed", minContextSlot: blockhash.context.slot, }); return { releaseAddress: releaseMintAddress.publicKey.toBase58(), transactionSignature: txSig }; @@ -103,7 +104,13 @@ export const createReleaseCommand = async ({ storageParams, priorityFeeLamports = Constants.DEFAULT_PRIORITY_FEE, }: CreateReleaseCommandInput) => { - const connection = new Connection(url); + const connection = new Connection( + url, + { + commitment: "confirmed", + disableRetryOnRateLimit: true, + } + ); const config = await loadPublishDetailsWithChecks(buildToolsPath);