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

solana logs failing with: Error: unable to connect to server yet solana-test-validator is running

I am trying to run the solana logs command to see the logs. But upon running this, it fails and doesn't connect to the localhost server. see below output: As you will see from the screenshot above, I already have the solana-test-validator…
Johhn
  • 979
  • 17
  • 24
-1
votes
1 answer

How to run "TS" code snippets in ts-node?

In Solana docs they use a lot of TS code snippets, for example in the below link (the first code snippet) should run and return a value: https://solanacookbook.com/guides/get-program-accounts.html#filters I tried to run the first snippet using:…
Web Three
  • 3
  • 1
-1
votes
2 answers

Please tell me about the transfer of tokens created in Solana

There are two users. UserA and UserB The token created on Solana is called "TokenX". UserA has some SOL. UserA got 100 TokenX by airdrop. UserB has no SOL. UserB has no TokenX. UserA and UserB have [Solana SPL Token Wallet]. UserA tried to give…
mario
  • 1
  • 3
-1
votes
1 answer

How to create a Website for Solana tokens transfer

I am trying to build a website using reactjs with the following goal : Transfer Solana and tokens that are on the solana Blockchain I took a look on the documentation that solana provides but it was kinda hard for me to understand anything because…
Zorghost
  • 29
  • 7
-1
votes
1 answer

Solana web3.js parse onProgramAccountChange notifications to JSON

How can I parse the connection.onProgramAccountChange notifications data to JSON? https://solana-labs.github.io/solana-web3.js/modules.html#AccountInfo The docs specify the data as type T, which for me has usually been a Buffer. Example code: let…
oriont
  • 684
  • 2
  • 10
  • 25
-1
votes
1 answer

"Value used here after move" after unpacking account data

In solana after I iterate over the account I want to get the data of stake_info account and modify it. let accounts_iter = &mut accounts.iter(); let stake_info = next_account_info(accounts_iter)?; let stake_info_account_data =…
-1
votes
1 answer

Rust enum and match : How does it distinguishes two different enums that takes in two different struct but same contents

I am trying to understand following enum from this repo #[repr(C)] #[derive(BorshSerialize, BorshDeserialize, Debug, Clone)] pub struct InitEscrowArgs { pub data: EscrowReceive, } #[repr(C)] #[derive(BorshSerialize, BorshDeserialize, Debug,…
Shintaro Takechi
  • 1,215
  • 1
  • 17
  • 39
-1
votes
1 answer

Failure to execute commands when uploading CandyMachinev2 to devnet

I've been trying to fix a certain issue for the past day, and I can confidently say that I'm stuck. I've been trying to follow the guide for uploading a CMV2 to Devnet, but to no avail, by using this as my resource:…
-1
votes
1 answer

Minting NFTs in Solana. with rent pay per byte is size based on ledger metadata or NFT token size like image that will be sold

I want to create some NFT's which will be sound files. Is the size in https://docs.solana.com/storage_rent_economics pay per byte scenario the size of the sound or size of the metadata related to the ledger ? So is the token data stored in the…
-1
votes
3 answers

Solana Wallet Address Generation Mechanism

I'm looking to developing on Solana but...I love to understand what I'm Working on. I've take a look at the documentation, and I can't unuderstand how solana-keygen work. I've try so hard to reproduce the same public address from the same mnemonic…
-1
votes
1 answer

Wrong input type for account "user" in the instruction accounts object for instruction "startStuffOff". Expected PublicKey or string

I'm getting this error when connecting my solana program with a react app: Wrong input type for account "user" in the instruction accounts object for instruction "startStuffOff". Expected PublicKey or string. App.js const createPostAccount = async…
-1
votes
2 answers

How to create a staking smart contract?

I'm a novice in a smartcontracts but want to create a simple stake contract in Solana. But can't understand when I need to update a reward counter per user? Because contracts interact with accounts for write, only when user paid for this. But in all…
gigimon
  • 1,443
  • 2
  • 13
  • 19
-1
votes
1 answer

error: linking with `ld` failed: exit status: 1

I'm trying to follow this guide as my entry into Solana blockchain development. I'm running into an error when I run the command $anchor build For context, I'm running wsl. I'm not concerned about the warning, but any help would be much…
TLS
  • 31
  • 4
-1
votes
3 answers

Solana Rust smart contract build error: build failed

I am a beginner Solana/Rust developer. As my first Solana project, I built the mint NFT contract. And then I want to deploy the contract. So to get the compiled output .so file, I did run like: cargo build, but getting this error: warning: cc:…
Rango527
  • 141
  • 1
  • 1
  • 7
-1
votes
2 answers

Best way to save a secretKey

I'm learning Solana API on ReactJS. After generating a keypair you can recreate the same keypair with the secretKey. How can I save this keypair? I'm using react and I want to recreate always the same keypair unless I generate another.
abyss13
  • 13
  • 3