Mint Edition from MasterEdition says account is missing - solana

I am working on a project to create nfts and print editions afterwards. The nft minting and metadata creating works just fine. I just don't know why the edition printing is not working.
I am trying to mint a edition from a master edition with the following metaplex function:
let accounts = vec![
ctx.accounts.new_metadata.to_account_info(),
ctx.accounts.new_edition.to_account_info(),
ctx.accounts.master_edition.to_account_info(),
ctx.accounts.new_mint.to_account_info(),
ctx.accounts.edition_mark_pda.to_account_info(),
ctx.accounts.new_mint_authority.to_account_info(),
ctx.accounts.payer.to_account_info(),
ctx.accounts.token_account_owner.to_account_info(),
ctx.accounts.token_account.to_account_info(),
ctx.accounts.new_metadata_update_authority.to_account_info(),
ctx.accounts.metadata.to_account_info(),
ctx.accounts.token_program.to_account_info(),
ctx.accounts.system_program.to_account_info(),
ctx.accounts.rent.to_account_info(),
];
invoke(
&mint_new_edition_from_master_edition_via_token(
ctx.accounts.token_metadata_program.key(),
ctx.accounts.new_metadata.key(),
ctx.accounts.new_edition.key(),
ctx.accounts.master_edition.key(),
ctx.accounts.new_mint.key(),
ctx.accounts.new_mint_authority.key(),
ctx.accounts.payer.key(),
ctx.accounts.token_account_owner.key(),
ctx.accounts.token_account.key(),
ctx.accounts.new_metadata_update_authority.key(),
ctx.accounts.metadata.key(),
ctx.accounts.metadata.key(),
1,
),
&accounts,
)?;
Unfortunatly I always receive this error:
'Program log: Instruction: MintEdition',
'Instruction references an unknown account F5mAJWXVpQ4rupmvMGTY7ZDqK7UUzSkS7dTfTRX6WMLf',
'Program 4euwMgqxB9GkxVBY7uXKRRuC68yhkNbsVUhDPYS1mbhD consumed 18852 of 200000 compute units',
'Program 4euwMgqxB9GkxVBY7uXKRRuC68yhkNbsVUhDPYS1mbhD failed: An account required by the instruction is missing'
My function call from the frontend looks like the following:
await program.methods
.mintEdition()
.accounts({
newMetadata: metadataAddress,
newEdition: newEditionAddress,
masterEdition: masterEditionAddress,
newMint: newMint.publicKey,
editionMarkPda: editionMarkPda,
newMintAuthority: provider.wallet.publicKey,
payer: provider.wallet.publicKey,
tokenAccountOwner: provider.wallet.publicKey,
tokenAccount: ata,
newMetadataUpdateAuthority: provider.wallet.publicKey,
metadata: metadataAddress,
tokenMetadataProgram: TOKEN_METADATA_PROGRAM_ID,
tokenProgram: TOKEN_PROGRAM_ID,
systemProgram: anchor.web3.SystemProgram.programId,
rent: anchor.web3.SYSVAR_RENT_PUBKEY,
})
.rpc();
This is how I get the editionMarkPda in the frontend:
await anchor.web3.PublicKey.findProgramAddress(
[
Buffer.from("metadata"),
TOKEN_METADATA_PROGRAM_ID.toBuffer(),
masterEditionMint.publicKey.toBuffer(),
Buffer.from("edition"),
Buffer.from("1"),
],
TOKEN_METADATA_PROGRAM_ID
)
Any ideas what is missing?

Related

How do I update an NFTs creator list?

I'mn trying to update a list of nfts to have a new secondary creator (the one with the 100% share). I don't think it's possible to update the first creator because I think the first creator is signed by the candy machine that created the nft? Anyway here's my code:
import { keypairIdentity, Metadata, Metaplex } from '#metaplex-foundation/js'
import { Connection, Keypair, PublicKey } from '#solana/web3.js'
import { program } from 'commander'
import { readFileSync, writeFileSync } from 'fs'
program
.command('update_creators')
.description('Updates the creator of all nfts')
.requiredOption(
'-i, --input-file <string>',
'Json file, list of NFT mint details'
)
.requiredOption(
'-o, --output-file <string>',
'Output file for NFT addresses that failed to update'
)
.requiredOption(
'-k, --keypair-file <path>',
`JSON file containing private key of token owner`,
'.cache/creator-keypair.json'
)
.option('-r, --rpc <string>', 'JSON rpc api url', defaultRpc)
.action(async ({ inputFile, outputFile, keypairFile, rpc }) => {
const connection = new Connection(rpc)
const metaplex = Metaplex.make(connection)
const keypairFileContents = readFileSync(keypairFile, 'utf-8')
const keypair = Keypair.fromSecretKey(
Buffer.from(JSON.parse(keypairFileContents))
)
metaplex.use(keypairIdentity(keypair))
const nftMintAddresses = JSON.parse(
readFileSync(inputFile, 'utf-8')
) as string[]
let nfts = (await metaplex
.nfts()
.findAllByMintList({
mints: nftMintAddresses.map(mint => new PublicKey(mint)),
})
.run()) as Metadata[]
const newCreator = new PublicKey(
'CUAwUE5N3TdHHHyPTHb3E5mpnpQFiRF6BcY8kEvJakfS'
)
const failedNfts: any[] = []
for (const nft of nfts) {
try {
console.dir(nft, { depth: null })
const newNft = await metaplex
.nfts()
.update({
nftOrSft: nft,
creators: [
nft.creators[0],
{
address: newCreator,
share: 100,
authority: keypair,
},
],
})
.run()
console.dir(newNft, { depth: null })
} catch (e) {
console.error(e)
failedNfts.push(nft)
process.exit()
}
}
writeFileSync(outputFile, JSON.stringify(failedNfts))
})
Note, the metaplex.use() keypair I'm using is the same wallet used to create the candy machine and has authority to update the nfts, but I keep getting the following error:
ParsedProgramError [MetaplexError]: TokenMetadataProgram > Incorrect account owner
>> Source: Program > TokenMetadataProgram [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s]
>> Problem: The program [TokenMetadataProgram] at address [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s] raised an error of code [57] that translates to "Incorrect account owner".
>> Solution: Check the error message provided by the program.
Caused By: IncorrectOwner: Incorrect account owner
at RpcClient.parseProgramError (C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\plugins\rpcModule\RpcClient.ts:302:9)
at RpcClient.sendTransaction (C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\plugins\rpcModule\RpcClient.ts:87:18)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RpcClient.sendAndConfirmTransaction (C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\plugins\rpcModule\RpcClient.ts:117:23)
at async TransactionBuilder.sendAndConfirm (C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\utils\TransactionBuilder.ts:189:22)
at async C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\utils\Task.ts:82:23
at async Disposable.run (C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\utils\Disposable.ts:34:14)
at async Command.<anonymous> (C:\xampp\htdocs\sol-tools\src\cli.ts:263:24) {
key: 'metaplex.errors.program.parsed_program_error',
title: 'TokenMetadataProgram > Incorrect account owner',
problem: 'The program [TokenMetadataProgram] at address [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s] raised an error of code [57] that translates to "Incorrect account owner".',
solution: 'Check the error message provided by the program.',
source: 'program',
sourceDetails: 'TokenMetadataProgram [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s]',
cause: IncorrectOwner: Incorrect account owner
at Object.errorResolver (C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\plugins\nftModule\plugin.ts:70:16)
at RpcClient.parseProgramError (C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\plugins\rpcModule\RpcClient.ts:299:35)
at RpcClient.sendTransaction (C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\plugins\rpcModule\RpcClient.ts:87:18)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RpcClient.sendAndConfirmTransaction (C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\plugins\rpcModule\RpcClient.ts:117:23)
at async TransactionBuilder.sendAndConfirm (C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\utils\TransactionBuilder.ts:189:22)
at async C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\utils\Task.ts:82:23
at async Disposable.run (C:\xampp\htdocs\sol-tools\node_modules\#metaplex-foundation\js\src\utils\Disposable.ts:34:14)
at async Command.<anonymous> (C:\xampp\htdocs\sol-tools\src\cli.ts:263:24) {
code: 57
},
logs: undefined,
program: {
name: 'TokenMetadataProgram',
address: PublicKey {
_bn: <BN: b7065b1e3d17c45389d527f6b04c3cd58b86c731aa0fdb549b6d1bc03f82946>
},
errorResolver: [Function: errorResolver],
gpaResolver: [Function: gpaResolver]
}
}
And here's one of the NFTs I'm trying to update:
https://solscan.io/token/3woKb11Ajs9VkzHhMNkiyX5za1bV3STBmSaDHoQgmBKp#metadata
Any help would be appreciated. Thanks!

Cross-program invocation with unauthorized signer or writable account on listing Config pda address in auctioneer sale in auctionhouse

I'm trying to use auctioneer sale function from the auctioneer sdk. But i get this Error
'Program neer8g6yJq2mQM6KbnViEDAD4gr3gRZyMMf4F2p3MEh invoke [1]', 'Program log: Instruction: Sell', "4xd58eAU6pZQCwSigE5bXMspTKus1fBFm1TpDU4m4AWc's signer privilege escalated", 'Program neer8g6yJq2mQM6KbnViEDAD4gr3gRZyMMf4F2p3MEh consumed 15605 of 200000 compute units', 'Program neer8g6yJq2mQM6KbnViEDAD4gr3gRZyMMf4F2p3MEh failed: Cross-program invocation with unauthorized signer or writable account'
The Address 4xd58eAU6pZQCwSigE5bXMspTKus1fBFm1TpDU4m4AWc is the address of the listing config address.
I'm Finding auctioneer with this
const listingConfig = await PublicKey.createProgramAddress(
[ Buffer.from("listing_config"),
publicKey.toBuffer(),
aH.toBuffer(),
associatedAddress.toBuffer(),
WRAPPED_SOL_MINT.toBuffer(),
mint.toBuffer(),
new BN(1)
],
AUCTIONEER
)
which is the same as defined in this
pub fn find_listing_config_address(
wallet: &Pubkey,
auction_house: &Pubkey,
token_account: &Pubkey,
treasury_mint: &Pubkey,
token_mint: &Pubkey,
token_size: u64,
) -> (Pubkey, u8) {
Pubkey::find_program_address(
&[
LISTING_CONFIG.as_bytes(),
wallet.as_ref(),
auction_house.as_ref(),
token_account.as_ref(),
treasury_mint.as_ref(),
token_mint.as_ref(),
&token_size.to_le_bytes(),
],
&id(),
)
}
could it be possible that the error is coming from somewhere else?
In the listing Config we have to pass token size to a buffer like
const listingConfig = await PublicKey.createProgramAddress(
[ Buffer.from("listing_config"),
publicKey.toBuffer(),
aH.toBuffer(),
associatedAddress.toBuffer(),
WRAPPED_SOL_MINT.toBuffer(),
mint.toBuffer(),
new BN (1).toBuffer('le',8)
],
AUCTIONEER
)

Deploying and Initializing anchor-escrow contract on devnet

this is more of a question than an actual issue
I want to use the contract
https://github.com/ironaddicteddog/anchor-escrow
to exchange tokens.
My plan is as follows, however I'm unsuccessful initializing the contract.
logs: [
'Program 11111111111111111111111111111111 invoke [1]',
'Create Account: account Address { address: 2yTRYBq58ZMgudQcEp18UnsCBPTUx9a12ZnzZ7N7v9hQ, base: None } already in use',
'Program 11111111111111111111111111111111 failed: custom program error: 0x0'
]
Note: 2yTRYBq58ZMgudQcEp18UnsCBPTUx9a12ZnzZ7N7v9hQ is the contract address in the lib.rs
Deploy program ✅ 2yTRYBq58ZMgudQcEp18UnsCBPTUx9a12ZnzZ7N7v9hQ
Create Token A DhS6x9pTrfCeY8iwkRdGstxUuphbeHqddT2vZSWRw3d2 and Token B HpdLmjjxD8YZav2S1aastqyLsKDUb1ToLDfq4hPsLBoc ✅
Create token accounts Token A account Cj6cMp4xfAaCFegMg9G7GQaZWqYbQqgmu7Vjd4BbGYHh, Token B account HpdLmjjxD8YZav2S1aastqyLsKDUb1ToLDfq4hPsLBoc✅
Initialize contract ❌.
Exchange tokens
I've written following script to initialize the contract.
import * as anchor from '#project-serum/anchor';
import { PublicKey, SystemProgram, Transaction, Connection, Commitment } from '#solana/web3.js';
import { TOKEN_PROGRAM_ID, Token } from "#solana/spl-token";
import {
escrowAccount,
initializerMainAccount,
initializerTokenAccountA,
initializerTokenAccountB,
mintAPublicKey,
mintBPublicKey } from './accounts'
import NodeWallet from '#project-serum/anchor/dist/cjs/nodewallet';
const takerAmount = 1000;
const initializerAmount = 500;
const commitment: Commitment = 'processed';
const connection = new Connection('https://api.devnet.solana.com', { commitment, wsEndpoint: 'wss://api.devnet.solana.com/' });
// const connection = new Connection('http://127.0.0.1:8899', { commitment, wsEndpoint: 'wss://127.0.0.1:8899/' });
const options = anchor.Provider.defaultOptions();
const wallet = new NodeWallet(initializerMainAccount);
const provider = new anchor.Provider(connection, wallet, options);
anchor.setProvider(provider);
// Read the generated IDL.
const idl = JSON.parse(
require("fs").readFileSync("./tests/keypair/anchor_escrow.json", "utf8")
);
// Address of the deployed program.
const programId = new anchor.web3.PublicKey("2yTRYBq58ZMgudQcEp18UnsCBPTUx9a12ZnzZ7N7v9hQ");
// Generate the program client from IDL.
const program = new anchor.Program(idl, programId);
const initEscrow = async () => {
const [_vault_account_pda, _vault_account_bump] = await PublicKey.findProgramAddress(
[Buffer.from(anchor.utils.bytes.utf8.encode("token-seed"))],
program.programId,
);
const vault_account_pda = _vault_account_pda;
const vault_account_bump = _vault_account_bump;
const [_vault_authority_pda, _vault_authority_bump] = await PublicKey.findProgramAddress(
[Buffer.from(anchor.utils.bytes.utf8.encode("escrow"))],
program.programId,
);
// DEBUG BEGIN
// console.info(`initializerMainAccount: ` + JSON.stringify(initializerMainAccount, null, 2));
// console.info(`Escrow account: ` + JSON.stringify(escrowAccount));
console.info(`Mint A: ` + mintAPublicKey.toBase58());
console.info(`Mint B: ` + mintBPublicKey.toBase58());
console.info(`TOKEN_PROGRAM_ID: ` + TOKEN_PROGRAM_ID);
console.info(`SYSVAR_RENT_PUBKEY: ` + anchor.web3.SYSVAR_RENT_PUBKEY);
// DEBUG CONSOLE END
await program.rpc.initialize(
vault_account_bump,
new anchor.BN(initializerAmount),
new anchor.BN(takerAmount),
{
accounts: {
initializer: initializerMainAccount.publicKey,
mint: mintAPublicKey,
vaultAccount: vault_account_pda,
initializerDepositTokenAccount: initializerTokenAccountA,
initializerReceiveTokenAccount: initializerTokenAccountB,
escrowAccount: escrowAccount.publicKey,
systemProgram: anchor.web3.SystemProgram.programId,
rent: anchor.web3.SYSVAR_RENT_PUBKEY,
tokenProgram: TOKEN_PROGRAM_ID,
},
instructions: [
await program.account.escrowAccount.createInstruction(escrowAccount),
],
signers: [escrowAccount, initializerMainAccount],
}
);
}
initEscrow();
Long version of the error output is
➜ anchor-escrow git:(master) ✗ ts-node tests/init2.ts
Mint A: DhS6x9pTrfCeY8iwkRdGstxUuphbeHqddT2vZSWRw3d2
Mint B: HpdLmjjxD8YZav2S1aastqyLsKDUb1ToLDfq4hPsLBoc
TOKEN_PROGRAM_ID: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
SYSVAR_RENT_PUBKEY: SysvarRent111111111111111111111111111111111
Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0
Program 11111111111111111111111111111111 invoke [1]
Create Account: account Address { address: 2yTRYBq58ZMgudQcEp18UnsCBPTUx9a12ZnzZ7N7v9hQ, base: None } already in use
Program 11111111111111111111111111111111 failed: custom program error: 0x0
/Users/tuncatunc/git/anchor-escrow/node_modules/#solana/web3.js/src/connection.ts:3961
throw new SendTransactionError(
^
SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0
at Connection.sendEncodedTransaction (/Users/tuncatunc/git/anchor-escrow/node_modules/#solana/web3.js/src/connection.ts:3961:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Connection.sendRawTransaction (/Users/tuncatunc/git/anchor-escrow/node_modules/#solana/web3.js/src/connection.ts:3918:20)
at async sendAndConfirmRawTransaction (/Users/tuncatunc/git/anchor-escrow/node_modules/#solana/web3.js/src/util/send-and-confirm-raw-transaction.ts:27:21)
at async Provider.send (/Users/tuncatunc/git/anchor-escrow/node_modules/#project-serum/anchor/src/provider.ts:118:18)
at async Object.rpc [as initialize] (/Users/tuncatunc/git/anchor-escrow/node_modules/#project-serum/anchor/src/program/namespace/rpc.ts:25:23) {
logs: [
'Program 11111111111111111111111111111111 invoke [1]',
'Create Account: account Address { address: 2yTRYBq58ZMgudQcEp18UnsCBPTUx9a12ZnzZ7N7v9hQ, base: None } already in use',
'Program 11111111111111111111111111111111 failed: custom program error: 0x0'
]
}
This is a long post
Thx a lot in advance for writing this contract to guide solana contract devs.
BR
I'll answer my own question here,
I figured out that the escrow program is already initialized.
The error log says that, it cannot use the same escrow account to re-initialize.

I'm trying to complete the upload step to deploy a candy machine and I get the below output

I'm trying to complete the upload step to deploy a candy machine and I am using Metaplex v2 and I am using devnet(not using minnet-beta) and "storage": "arweave" also set to devnet but still I get the below output error:
EDIT: Thank you for suggestion actually I have checked my balance it was 0 then added to SOL now it is working well!
Beginning the upload for 10 (img+json) pairs
started at: 1642285341323
initializing candy machine
Transaction simulation failed: Attempt to debit an account but found no record of a prior credit.
Translating error SendTransactionError: failed to send transaction: Transaction simulation failed: Attempt to debit an account but found no record of a prior credit.
at Connection.sendEncodedTransaction (/Users/aziz/Desktop/nft/test/metaplex/js/node_modules/#solana/web3.js/src/connection.ts:3689:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Connection.sendRawTransaction (/Users/aziz/Desktop/nft/test/metaplex/js/node_modules/#solana/web3.js/src/connection.ts:3649:20)
at async sendAndConfirmRawTransaction (/Users/aziz/Desktop/nft/test/metaplex/js/node_modules/#solana/web3.js/src/util/send-and-confirm-raw-transaction.ts:27:21)
at async Provider.send (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/node_modules/#project-serum/anchor/src/provider.ts:114:18)
at async Object.rpc [as initializeCandyMachine] (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/node_modules/#project-serum/anchor/src/program/namespace/rpc.ts:19:23)
at async createCandyMachineV2 (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/src/helpers/accounts.ts:149:11)
at async uploadV2 (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/src/commands/upload.ts:134:19)
at async Command.<anonymous> (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:184:7) {
logs: []
}
Error deploying config to Solana network. SendTransactionError: failed to send transaction: Transaction simulation failed: Attempt to debit an account but found no record of a prior credit.
at Connection.sendEncodedTransaction (/Users/aziz/Desktop/nft/test/metaplex/js/node_modules/#solana/web3.js/src/connection.ts:3689:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Connection.sendRawTransaction (/Users/aziz/Desktop/nft/test/metaplex/js/node_modules/#solana/web3.js/src/connection.ts:3649:20)
at async sendAndConfirmRawTransaction (/Users/aziz/Desktop/nft/test/metaplex/js/node_modules/#solana/web3.js/src/util/send-and-confirm-raw-transaction.ts:27:21)
at async Provider.send (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/node_modules/#project-serum/anchor/src/provider.ts:114:18)
at async Object.rpc [as initializeCandyMachine] (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/node_modules/#project-serum/anchor/src/program/namespace/rpc.ts:19:23)
at async createCandyMachineV2 (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/src/helpers/accounts.ts:149:11)
at async uploadV2 (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/src/commands/upload.ts:134:19)
at async Command.<anonymous> (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:184:7) {
logs: []
}
upload was not successful, please re-run. SendTransactionError: failed to send transaction: Transaction simulation failed: Attempt to debit an account but found no record of a prior credit.
at Connection.sendEncodedTransaction (/Users/aziz/Desktop/nft/test/metaplex/js/node_modules/#solana/web3.js/src/connection.ts:3689:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Connection.sendRawTransaction (/Users/aziz/Desktop/nft/test/metaplex/js/node_modules/#solana/web3.js/src/connection.ts:3649:20)
at async sendAndConfirmRawTransaction (/Users/aziz/Desktop/nft/test/metaplex/js/node_modules/#solana/web3.js/src/util/send-and-confirm-raw-transaction.ts:27:21)
at async Provider.send (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/node_modules/#project-serum/anchor/src/provider.ts:114:18)
at async Object.rpc [as initializeCandyMachine] (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/node_modules/#project-serum/anchor/src/program/namespace/rpc.ts:19:23)
at async createCandyMachineV2 (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/src/helpers/accounts.ts:149:11)
at async uploadV2 (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/src/commands/upload.ts:134:19)
at async Command.<anonymous> (/Users/aziz/Desktop/nft/test/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:184:7) {
logs: []
} ```
Please let me know if you have the other question.
Can you please help me with that and thanks to you in advance!
Check you have funds in the wallet keypair you are using.
solana balance
Then double check your config file you are using with the -cp option.
Showing the exact cmd you are running as well would be useful.
according to metaplex candy machine v2 document this is the minimum configuration:
{
"price": 1.0,
"number": 10,
"gatekeeper": null,
"solTreasuryAccount": "<YOUR WALLET ADDRESS>",
"splTokenAccount": null,
"splToken": null,
"goLiveDate": "25 Dec 2021 00:00:00 GMT",
"endSettings": null,
"whitelistMintSettings": null,
"hiddenSettings": null,
"storage": "arweave-sol",
"ipfsInfuraProjectId": null,
"ipfsInfuraSecret": null,
"awsS3Bucket": null,
"noRetainAuthority": false,
"noMutable": false
}
so, you should put your devnet account public key instead of solTreasuryAccount
for creating this wallet
solana-keygen new --outfile ~/.config/solana/devnet.json
from the above command, you have the public key of generated wallet. let's call it devnet-wallet-pubkey, so for airdrop some sol to it(repeat this command once again to have enough sol):
solana airdrop 2 devnet-wallet-pubkey
now you can put this wallet public key instead of that solTreasuryAccount.

IAM Cannot Access Launch Template

I am using the AWS Node SDK to try and use a launch template to launch an EC2 instance. In the web console for the same user I have access to the Launch Template ID, but in the Node API it tells me the Launch Template with ID does not exist:
version: aws-sdk#2.606.0
Screenshot in AWS Console
Screenshot in my config file
(I've blocked the last few characters for security but they are the same)
This is the Node
AWS = require('aws-sdk');
AWS.config.update({region: global.settings.aws.region});
let instanceParams = {
LaunchTemplate: {
LaunchTemplateId: global.settings.aws.ltId
},
InstanceType: 't2.micro',
MinCount: 1,
MaxCount: 1
};
let instancePromise = new AWS.EC2().runInstances(instanceParams).promise();
instancePromise.then(
function(data) {
console.log(data);
}).catch(
function(err) {
console.error(err, err.stack);
});
This is the error the API returns:
InvalidLaunchTemplateId.NotFound: The specified launch template, with template ID lt-03969d13638b5XXXX, does not exist.
at Request.extractError (/ApplicationPath/node_modules/aws-sdk/lib/services/ec2.js:50:35)
at Request.callListeners (/ApplicationPath/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/ApplicationPath/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/ApplicationPath/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/ApplicationPath/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/ApplicationPath/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /ApplicationPath/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/ApplicationPath/node_modules/aws-sdk/lib/request.js:38:9)
at Request. (/ApplicationPath/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/ApplicationPath/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
at Request.emit (/ApplicationPath/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/ApplicationPath/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/ApplicationPath/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/ApplicationPath/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /ApplicationPath/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/ApplicationPath/node_modules/aws-sdk/lib/request.js:38:9)
at Request. (/ApplicationPath/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/ApplicationPath/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
at callNextListener (/ApplicationPath/node_modules/aws-sdk/lib/sequential_executor.js:96:12)
at IncomingMessage.onEnd (/ApplicationPath/node_modules/aws-sdk/lib/event_listeners.js:307:13)
at IncomingMessage.emit (events.js:214:15)
at IncomingMessage.EventEmitter.emit (domain.js:476:20) {
message: 'The specified launch template, with template ID lt-03969d13638b5XXXX, does not exist.',
code: 'InvalidLaunchTemplateId.NotFound',
time: 2020-01-22T15:29:18.641Z,
requestId: '16082702-49c0-4451-a3b7-570b930b5238',
statusCode: 400,
retryable: false,
retryDelay: 47.92654090836894
}
The IAM access includes both:
AmazonEC2FullAccess
AmazonEC2FullAccess
(The JSON are super long but I am happy to post those in here if needed)
My thought is that there is some permissioning error for the IAM but I can't determine what that might be. Thank you for the help and please let me know if there is any other clarity I can provide.
When you can see that a given AWS resource exists in the AWS console, but it is not returned by the awscli or SDK calls, (or vice-versa) then one of the following is likely the cause:
you have queried the wrong region
you have queried the wrong AWS account (your effective credentials are for a 2nd, different account)
you have mis-typed the resource name/id
your browser has cached results that no longer exist (refresh your browser)

Resources