Getting "Blockhash not found" error on Solana

Here’s the error:

throw new SendTransactionError(
^
SendTransactionError: failed to send transaction: Transaction simulation failed: Blockhash not found

Here’s the code I am using, based off of the QuickNode Solana token example:

import { percentAmount, generateSigner, signerIdentity, createSignerFromKeypair } from ‘@metaplex-foundation/umi’;
import { TokenStandard, createAndMint } from ‘@metaplex-foundation/mpl-token-metadata’;
import { createUmi } from ‘@metaplex-foundation/umi-bundle-defaults’;
import { mplCandyMachine } from “@metaplex-foundation/mpl-candy-machine”;
import “@solana/web3.js”;
import secret from ‘./guideSecret.json’;

const umi = createUmi(‘"[QUICKNODE URL HERE]’); //Replace with your QuickNode RPC Endpoint

const userWallet = umi.eddsa.createKeypairFromSecretKey(new Uint8Array(secret));
const userWalletSigner = createSignerFromKeypair(umi, userWallet);

const metadata = {
name: “Token”,
symbol: “TOKEN”,
uri: “[URI]”
};

const mint = generateSigner(umi);
umi.use(signerIdentity(userWalletSigner));
umi.use(mplCandyMachine());

createAndMint(umi, {
mint,
authority: umi.identity,
name: metadata.name,
symbol: metadata.symbol,
uri: metadata.uri,
sellerFeeBasisPoints: percentAmount(0),
decimals: 8,
amount: 1000000_00000000,
tokenOwner: userWallet.publicKey,
tokenStandard: TokenStandard.Fungible,
}).sendAndConfirm(umi).then(() => {
console.log(“Successfully minted 1 million tokens (”, mint.publicKey, “)”);
});

Since Priority fees have been added on Solana, you’ll want to make sure you’re adding them for any transactions you’re trying to send.

You can check out our guide here on it

How might I add a priority fee using the code I have provided?

You will have to go through the guide and understand priority fees to see how you can add it to your current implementation.