Questions tagged [blockhash]
The blockhash tag has no usage guidance.
24 questions
1
vote
2
answers
165
views
failed to get recent blockhash: Method not found at Connection.getRecentBlockhash on vanilla javascript mini app
so im trying to make a sort of a devnet sol lottery, and i keep getting that error. I'm using html and javascript with ajax and a cdn to carry this out, and im connecting the wallet seems fine but ...
0
votes
1
answer
90
views
All transaction return "Signature XXXXXX has expired: block height exceeded."
I try to swap USDT to other token through SWAP API but it got the same error.block height exceeded.
this is my swap function
async function handleSwap(wallet: any, coinName: string, amount: number) {
...
1
vote
0
answers
20
views
maping info with transaction hash
I need some help with a solana project. So I am building a DAO voting platform with blinks and the proposal part is already done but I am not able to store the proposal on chain. I have 2 sections in ...
0
votes
2
answers
48
views
How to deal with same transaction hash of multiple transaction?
How to deal with same transaction hash issue on solana, if i want to send multiple transaction with same instructions with data and sign them all with same blockhash. they will end up getting same ...
0
votes
1
answer
36
views
Is this function checking if a blockhash has expired using wrong calculation?
The following function to check if a blockhash is expired is from QuickNode. But is it wrong?
async function isBlockhashExpired(connection: Connection, lastValidBlockHeight: number) {
let ...
1
vote
1
answer
33
views
How to generate a random number based on clock and recent blockhash?
i want to generate a random number in native rust on solana by using clock and recent blockhash.
Right now I'm simply generating it by
let clock = Clock::get()?;
let random_number = (clock.slot % 100) ...
0
votes
1
answer
60
views
Is it possible to use the latest blockhash to get transaction data for the block its for?
Hello i hope you are all having nice days!
I wanted to ask if I could use the latest blockhash in order to get transactions relating to its block, or if I could get the current slot and use that with ...
0
votes
1
answer
409
views
Using recent blockhash with Python
How can I add the getLatestblockhash function in to this code.
I tried it but I got:
TypeError: argument 'blockhash': 'GetLatestBlockhashResp' object cannot be converted to 'Hash'
from spl.token....
0
votes
1
answer
166
views
What is the workaround for the "TransactionExpiredBlockheightExceededError" error when transferring "spl-tokens"?
You've created a wallet feature using the Web3js SDK.
I created functions related to Solana and SPL-token retrieval and transfer and used them well. However, recently I am getting an error when ...
1
vote
2
answers
148
views
How to test my solana program code by rust on beta.solpg.io?
I have a rust solana program code on beta.solpg.io.
After development, I am about to test my code but I don't know how to do it.
I copied deposit and withdraw program sample code on github, but I don'...
5
votes
1
answer
535
views
When does a transaction expire?
The docs contradict themselves on this in a number of places. Which of the following most accurately describes when a transaction expires?
a) after 150 blocks have been appended to the chain after the ...
1
vote
1
answer
865
views
How do I get the recent blockhashses during program execution?
I want to get the latest blockhash (or last 10 or so) during program execution. The goal is prove that the tx was created and executed in real time. Here are the steps that I am thinking:
get latest ...
5
votes
1
answer
68
views
Does how recent your blockhash matter in regards to how quickly a transaction is confirmed?
Does how recent a blockhash is matter? Do the validators do any sorting to make sure the majority of transactions get executed or avoid a larger percentage of transaction expiration?
3
votes
1
answer
712
views
Minimum context slot has not been reached when trying to send a transaction
I'm trying to submit a transaction from a frontend application (React, @solana/web3.js), but every now and then when I try to submit a transaction, it fails with this error message:
err: ...
3
votes
1
answer
116
views
Why can't I use a future blockhash for on-chain randomness?
To my knowledge, Blockhashes are determined by the hash of numerous things involving the instruction data of the transactions involved in the block, and the previous hashes.
it is practically ...
4
votes
2
answers
1k
views
Can I somehow subscribe to the latest block hash?
I am trying to get a bit better performance for a game and would like to have the block hash already there when I send the transaction so I don't have to wait for the roundtrip to get it just before I ...
3
votes
1
answer
118
views
spl-token 2.2.0 at solana 1.13.5 getting multisig error: Client(PresignerError(VerificationFailure))
I've been using spl-token multisig for quite a while, but recently it stopped working and I'm getting this error:
Client(PresignerError(VerificationFailure))
We checked everything 10 times, rotated ...
3
votes
1
answer
1k
views
Can I send the same transaction twice in the same block?
I am building a game and want to send multiple move transactions in quick succession.
But when I do that I get two transactions with the same hash when the recent block hash didn't change yet and I ...
2
votes
2
answers
2k
views
Blockhash expired. 5 retries remaining
trying to deploy a program to the devnet I keep encountering this issue when my program just tries and retry to deploy with no success, any idea why this may be?:
cargo-build-bpf child: /Users/juan/....
1
vote
0
answers
134
views
Latest block hash does not work on mainnet
I have a program launched onto mainnet, but I cannot connect to it. Every time I try, I get a Blockhash not found error. I have confirmed my connection works on devnet without an issue. I have tried ...
0
votes
1
answer
335
views
How to confirm a transaction given only the transaction signature and slot number?
I want to confirm a transaction gracefully and wait for it to be finalized. I understand the best way to do this is to use the Connection.confirmTransaction method with the ...
1
vote
1
answer
3k
views
signTransaction() wallet adapter
const {signTransaction} = useWallet()
const transaction = new Transaction()
const tx = .... //arbitrary anchor program method as transaction
transaction.add(tx)
const signature = signTransaction(...
10
votes
1
answer
798
views
Find the last valid block height for a given blockhash
https://docs.solana.com/developing/clients/jsonrpc-api#getlatestblockhash provides a way to get the latest blockhash and last valid block height for a given commitment.
https://docs.solana.com/...
6
votes
6
answers
2k
views
Getting Error: failed to send transaction: Transaction simulation failed: Attempt to load a program that does not exist
I'm currently trying to run an escrow program and when i turn on the solana-test-validator in a different terminal it gives me this error:
failed to send transaction: Transaction simulation failed: ...