5
votes
is that all data on Solana store on memory?
No. Accounts state is stored in memory mapped files, so it's disk-backed. Additionally, snapshots of the full and intermediate state are take intermittently and written to an archive which is served ...
5
votes
Accepted
GET all collections of NFT, API, Magic eden
so you can make a function that requests the 500 and then adds them all to a list. you then add 500 to the offset of the request and keep repeating until the request returns empty. here's an example ...
4
votes
Accepted
Creating a data account per user of your program?
What you're looking for is Program Derived Account (PDA)
Create a PDA for each User using their address as a seed.
This will ensure that you're passing the correct data to the program each time a user ...
4
votes
Accepted
How do you convert the byte array returned as "Data" for a given instruction into a human-readable form?
Background
This is a bit of a broad question, as there are several cases to consider, but the basic fact to understand is: the data field in an instruction is the arbitrary, serialized input given to ...
4
votes
Relating logs to their instructions
Instructions in a transaction are processed in order. So the order you add the instruction to the transaction is the order the of the program logs. You can also use msg!("Some Message") to ...
4
votes
Solana Deserialization
If that Payload struct is the only input that your program can receive, then this should work:
#[derive(BorshDeserialize, BorshSerialize, Debug)]
struct Payload {
purchase_qty: u64,
...
3
votes
Detecting coin price changes on Raydium within 1-500 milliseconds
I'd recommend you subscribe to on-chain program events websocket via a rpc so you can stream it almost real time.
3
votes
How to pass Vec arg and strings args to instruction?
Anchor will automatically serialise the arguments for you.
program.methods
.instruction("str argument", ["foo", "bar", "foobar"])
...
3
votes
Accepted
Solana Devnet Transactions disappear
That's correct, the transaction history for devnet and testnet is only backed by local ledger storage, whereas mainnet uploads all blocks to Google Bigtable.
It isn't explicitly mentioned, but https://...
3
votes
Accepted
Is it possible to serialise/deserialise a String in an on chain data account?
It is possible to have an updatable string stored on an account. There are two ways:
You set a max size for the string during account creation and use strings within the size limit. E.g for string ...
3
votes
Accepted
Where are the hashing utils in nodejs?
If you're referring to serialization, generally the standard for Solana & Rust is Borsh, which you can use in javascript with borsh-js.
If you're referring to hashing, I would just use the crypto ...
3
votes
Accepted
Calculating Solana Fees
Solana Instructions have a non-fixed fee but usually 5000 Lamports (currently) A Transaction can have multiple instructions.
But Data Allocation cost is calculated
Solana defines a constant cost as 1 ...
2
votes
Finding instruction identifiers
The instruction identifier of Anchor based Solana programs is a SHA256 hash of the namespace and name of the function used for the instruction with a colon in between. For example:
global:...
2
votes
Finding instruction identifiers
Most programs support multiple discrete instructions - you decide when writing your program what these instructions are and what data must accompany them
Rust enums are often used to represent ...
2
votes
How to know the number of active validators in Solana
There are a few ways to accomplish this.
First, you can use the solana command-line tool (https://docs.solana.com/cli/install-solana-cli-tools) like so:
solana validators
This will show a list of ...
2
votes
How to actually store 10k Pubkeys in a Solana Account
Given the transaction size limit, there's no way you're going to be storing 10k pubkeys at once anyway. I'd suggest using multiple transactions to load a subset into different regions of the account ...
1
vote
store more tx_data
You can use the --limit-ledger-size flag for this.
The help message gives more info:
--limit-ledger-size <SHRED_COUNT>
Keep this amount of shreds in root slots. [default: ...
1
vote
Efficiently fetching a DApp's data
A solution here could be using webhooks from a provider like Helius, and streaming events from a given program to an off-chain DB. This once again isn't perfect, but gives good guarantees of ...
1
vote
Accepted
How do I allow two different signers to modify data in a PDA?
0x1 error means that you have insufficient funds.
Can you try airdropping yourself some SOL to the signer and updater accounts
1
vote
Detecting coin price changes on Raydium within 1-500 milliseconds
You can try Bitquery's Solana stream.
Here is an example of getting the price of currency
https://ide.bitquery.io/Live-price-of-a-token-on-Solana-blockchain
Here, we get the price of a token in real ...
1
vote
Accepted
How do I display MarginFi Leding/Borrowing pools in my ui?
You can check this out https://github.com/mrgnlabs/pulsar-example/blob/main/index.ts
Its shows some basic examples
1
vote
Accepted
rent handling in storage
Collecting rent will be removed. As of now to my knowledge there are no accounts anymore that are not rent exempt. When an account is rent exempt there is no rent collection anymore. This will enable ...
1
vote
Older solana blocks have no timestamp?
Block times were only added to the long-term block storage at the end of September 2020 in this pull request: https://github.com/solana-labs/solana/pull/11955
You'll notice that the first timestamps ...
1
vote
Accepted
Public Data API for Token Security
From investigation, I have not been able to find a service that isn't paywalled and will allow you to directly check token security.
There are a few other options which aren't quite like what you're ...
1
vote
Solana Deserialization
If you want to manually deserialize some struct (without Anchor), I suggest bytemuck, structs are Plain Old Data (POD):
pub fn get_payload_from_bytes(v: &[u8]) -> &Payload{
bytemuck::...
1
vote
Traces in Solana
I'm not very familiar with EVM traces but it seems very similar to emitting events in Solana.
We use events to log messages (anything you would do with msg!()). But they are not human readable as ...
1
vote
There is a way to limit the number of RPC requests per second of the web3.js library?
Yes there is a way to do this by using the batchSize parameter in the provider.send function to reduce the number of requests made in a single batch, this will assist the number of request by second ...
1
vote
Relating logs to their instructions
When a program emits logs inside of a transaction, each log is effectively just added to a single, flat array of strings. So in order to actually determine the instruction that caused a program to ...
1
vote
Send Instruction with multiple parameters to non-anchor program help (instruciton_data)
I think you want something like BufferLayout.blob(32, 'seeds') instead.
The error is occurring because an Option<T>::None is being unwrap()ed on line 112. There are no line numbers on the ...
1
vote
GET all collections of NFT, API, Magic eden
Did you looked at this API: https://docs.hyperspace.xyz/hype/developer-guide/overview
I didn't use it yet, but it looks like a good option.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
data × 38transactions × 8
anchor × 5
solana-program × 4
api × 4
account × 3
validator × 3
rpc × 3
web3.js × 3
dapp × 2
instructions × 2
decode × 2
account-data × 2
data-storage × 2
instruction × 2
magiceden × 1
python × 1
pda × 1
program × 1
on-chain × 1
spl × 1
deserialization × 1
javascript × 1
websocket × 1
compute-budget × 1