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
0
votes
1 answer

What does "Invoke context not set error" occur when I am testing?

When I run cargo test-bpf --manifest-path=./Cargo.toml on this code #[tokio::test] async fn test_init_mapping() { let program_id = Pubkey::new_unique(); let mut init_map_test = ProgramTest::new( "simple", // Run the BPF version with…
wxecqz123
  • 325
  • 1
  • 5
  • 12
0
votes
1 answer

How to run a command with an environment variable? ( solana validator)

When I run the command : solana-test-validator I got the following result. Result I don't know what the last line( note: run with RUST_BACKTRACE=1 environment variable to display a backtrace) mean. Please help.
0
votes
1 answer

Add simple line "Pubkey::new_unique()" breaks my Solana Program

does anyone know why introducing a simple line like "Pubkey::new_unique()" inside https://github.com/solana-labs/example-helloworld/blob/master/src/program-rust/src/lib.rs#L22 will make the program fail?
anondevpepe
  • 287
  • 1
  • 4
  • 8
0
votes
1 answer

Solana stake pool installation issue

While using cargo install spl-stake-pool-cli I am getting issues with the last step. Please check the attached screenshot.
-1
votes
0 answers

Adjust Wallet Configuration - Help me understand where is my problem here?

Here is the code, it should pop up a connect option to the site through 'Solflare' and I don't understand where is my problem here or maybe I just did it wrong: https://pastecode.io/s/x3xvan1j I used the same code that I did for the phantom wallet…
funkz
  • 1
-1
votes
0 answers

How to generate Solana key pair?

I am a fresher to Solana. So I tried to install solana environment to my pc. My pc is using Windows 10 OS. But I have an issue whild building solana environment. After setup solana CLI, and I tried to generate keypair with these…
cocoa
  • 1
  • 1
-1
votes
0 answers

Unresolved import 'crate', could not find '__client_accounts_*' in the crate root

I am following an online tutorial on working with PDAs using the anchor framework for Rust and I cannot get the following Solana program to work. use anchor_lang::prelude::*; declare_id!("*"); #[program] pub mod crunchy_vs_smooth { use…
-1
votes
1 answer

How to run test for ETH to USD conversion with chainlink?

I have the following code for Bank.sol // SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import…
-1
votes
1 answer

How to create a Solana program to constantly check wallet funds and transfer them to another wallet?

I'm new in web3 but experimented programmer. I want to try to make my first smart contract in Solana. I have a Phantom Solana wallet, and I want to create a smart contract that checks if my wallet have received any transaction of any token, and send…
-1
votes
1 answer

How to get collection name from a candy machine address in Solana?

Given a candy machine address how do you find the name of the collection? https://explorer.solana.com/address/6TNFBdZR3kBYDxpqFkTVxVykk4ugUxL5xm7YnzWQ32WZ?cluster=devnet Here's an example of the metadata on one of the tokens. { "name": "Tara…
Berry Blue
  • 15,330
  • 18
  • 62
  • 113
-1
votes
1 answer

How get discriminator from anchor account?

I have the contract use anchor_lang::prelude::*; declare_id!("kek"); #[constant] pub const MEDIA_TAG: &[u8] = b"MEDIA_STATE"; #[account] #[derive(Default)] pub struct MediaState { pub authority: Pubkey, pub name: String, } #[program] pub…
keker
  • 29
  • 3
-1
votes
1 answer

solana spl-token transfer fee "Error: Program(IncorrectProgramId)"

I want to create my own Solana token that takes %2 fee to all transactions and total supply should be 100k token. That's why i used spl-token cli for this spl-token create-token --transfer-fee 50 1000, however after executing this command i get an…
OXI
  • 1
  • 1
-1
votes
1 answer

cannot read properties of undefined (reading rpc )

i am trying to run a test for the flip of the bool value but getting this error while testing it this is my code it('Creates a Flipper', async () => { const switchAccount = anchor.web3.Keypair.generate(); …
vinit
  • 1
-1
votes
1 answer

How can I make Solana stake transaction with python?

How can I develop Solana staking with python? How can I make Solana stake transaction with python? Has anyone done it yet? Is there any resource for help?
-1
votes
1 answer

Metaplex-master on github only has Readme file

I am trying to set up a Solana candy machine. I am using the Hasplips Metaplex-master but it only has one readme file. Its supposed to have a js folder, some .JSON files and more. Can any send me a link to the correct Metaplex-master for the candy…