Questions tagged [solana]

Use for questions about programming on the Solana Blockchain Platform or using its Anchor Framework. Use with the appropriate language tag.

From the website:

Solana is a decentralized blockchain built to enable scalable, user-friendly apps for the world.

Developer documentation can be found here, including information about Solana's Anchor Framework.

1213 questions
7
votes
8 answers

Error: Custom: Invalid blockhash when solana program deploy

Trying to deploy a program to solana devnet. I was using solana program deploy ./path/xxxx.so -u devnet And I got multiple lines of msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J msg…
Sveargith
  • 409
  • 1
  • 4
  • 8
7
votes
3 answers

What is "Signature Verification Failed" in Solana?

I'm trying to call a Solana Program, and when I run sendAndConfirmTransaction, it gives me Signature Verification Failed, and I'm not sure why. const {sendAndConfirmTransaction, clusterApiUrl, Connection} = require("@solana/web3.js"); let signer =…
Evan Conrad
  • 3,993
  • 4
  • 28
  • 46
7
votes
3 answers

Difference bewteen `solana deploy` and `solana program deploy`

I'm currently learning Solana development with rust. I followed the hello-world tutorial and was wondering what are the differences between running solana deploy and solana program deploy. I tested both using Solana Devnet cluster. Result of running…
Carles Mitjans
  • 4,786
  • 3
  • 19
  • 38
7
votes
3 answers

How to properly transfer Solana SOL using web3js via Phantom

Am working with Solana Blockchain. Am trying to transfer Solana SOL via Phantom. To this effect I used the code below which was found on Stack Overflow: source link I already have Phantom installed in Chrome. When I run the code, it displays…
Nancy Moore
  • 2,322
  • 2
  • 21
  • 38
7
votes
3 answers

Solana - How to get the balance from my Phantom wallet?

I'm working on a web app that can connect to Phantom Wallet. I've established the connection and have successfully retrieved the wallet's public key. The problem is, I can't seem to find any solution to get the account balance. For reference, I…
7
votes
1 answer

What is the seeds in creating account or finding the account in solana, and could the seeds be anything or be specific?

My questions here are: what the seed is? Why need seed? Is the seed input randomly or specific? For examples: The first parameter is seeds for function findProgramAddress const [_pda, _nonce] = await PublicKey.findProgramAddress( …
Noldorin Zhang
  • 181
  • 1
  • 2
  • 7
7
votes
2 answers

Why do I get a build error for the resolver feature when I have up to date rustc and cargo version?

When I run the build command cargo build-bpf --manifest-path=Cargo.toml --bpf-out-dir=dist/program error: failed to download solana-frozen-abi v1.7.9 Caused by: unable to get packages from source Caused by: failed to parse manifest at…
wxecqz123
  • 325
  • 1
  • 5
  • 12
6
votes
2 answers

how to verify the signature of a message in phantom solana?

I am trying to authenticate phantom wallet by signing it with a message I used below code to sign the message and it returns me a signature how can I verify that signature in the backend. const encodedMessage = new TextEncoder().encode("Message…
SUMANTH ALE
  • 69
  • 1
  • 3
6
votes
1 answer

How to transfer (using Program instructions) custom SPL token from my own account to another user's wallet?

This is my situation: I have created a wallet solana-keygen new I have created my own custom SPL Token spl-token create-token Then I created an Account for this SPL Token spl-token create-account The SPL token is now in my wallet A In the…
6
votes
2 answers

Solana token transfer using Anchor

I'm having problems doing what I thought would be a straightforward token transfer. First some code: #[derive(Accounts)] #[instruction(amount: u64)] pub struct TransferTokens<'info> { #[account(mut)] pub sender: Signer<'info>, …
Erik Strömberg
  • 322
  • 4
  • 12
6
votes
1 answer

Get program id/address from Solana transaction data (solana/web3.js)

I want to determine whether a transaction has interacted with a specific program id "cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ" (being the Candy Machine program address). I'm using @solana/web3.js to get the below (bottom of post) Candy Machine…
6
votes
1 answer

Transaction simulation failed: Attempt to debit an account but found no record of a prior credit

I type the command : npx ts-node candy-machine-v2-cli.ts upload -e devnet \ -k DEVw4sdjjwo3he1JgJbycZuWmZuC28YFMEY9uYpnP7cP.json -c cm2test \ -cp /users/macbook/git/cmv2/setup/cmsetup.json \ /users/macbook/git/cmv2/setup/uploadfolder this gives…
aissyla
  • 63
  • 1
  • 4
6
votes
1 answer

In a Solana program create a wallet to hold SOL that the program can use to accept SOL and pay it out

I have a program on the Solana blockchain which works fine, however I now want to integrate a function for the program to receive SOL hold it in an account and then send it out to users as needed. From the docs it seems I need to use a PDA with a…
Joby Ingram-Dodd
  • 730
  • 5
  • 23
6
votes
1 answer

Installing Anchor on a MacOS -> Anchor versions are not matching up

New to using Anchor for Solana. I just installed Anchor along with Solana and Rust, Solana and Rust were successfully installed, but I have been having issues with Anchor. Whenever I check the Anchor version or do anything like Anchor init, I get an…
Mabel Oza
  • 557
  • 8
  • 22
6
votes
3 answers

How do I load my Solana wallet using my private key file?

I'm attempting to use the private key I generated using the Solana command-line to create a wallet in JavaScript / Node. I want to use the web3.Keypair.fromSeed() method. Here are the steps I've take so far. created a solana wallet : solana-keygen…
raddevus
  • 8,142
  • 7
  • 66
  • 87
1 2
3
80 81