5
votes
Accepted
How to store data directly on the Solana blockchain?
While the accepted answer indicates No, it depends on your use case:
You actually can store data on chain vis-a-vis the transaction you submit. When you submit a transaction the entire content of the ...
3
votes
How can one paginate large number of accounts fetch on solana?
You can achieve it by using configuration object key named 'dataSlice'.
const conn = new Connection('https://xxx'); // mainnet-beta connection
const accountInfos = await conn.getAccountInfo(publicKey, ...
3
votes
how many Accounts i can create & how much max data that each Account can store in Anchor PDA program?
The maximum size of any account is 10 megabytes. Each account address on your Solana program will take 32 bytes for the address. You can make as many as your solana program can handle. You can study ...
2
votes
Print in Solana Playground
Try msg!("asdf"); or msg!("some var: {:?}", some_var) to print a variable to the logs.
2
votes
How can one paginate large number of accounts fetch on solana?
here is a great explanation of paginating accounts by loris leiva that also happens to use candymachine as an example:
https://lorisleiva.com/paginating-and-ordering-accounts-in-solana
Content from ...
2
votes
How to store data directly on the Solana blockchain?
Shortly No
Transactions are stored in the block. Transactions are called public ledger and a ledger means a record of a business's financial transactions.
From here
If the program needs to store ...
2
votes
: AccountOwnedByWrongProgram. Error Number: 3007
When the owner is 11111111111111111111111111111111, that usually means the account is not initialized.
1
vote
Accepted
Extend Account struct in anchor
This feature will come in Anchor 0.30.0.
At the moment i don't know a way to improve this beside using native and use the account iterator or just passing in all the accounts in all instructions which ...
1
vote
Accepted
How to calculate space for an account dynamically using remaining_accounts
Should I just send the length of remaining_accounts as instruction data?
This is the only way to do it, and then use that instruction data in the context macros with
#[instruction(...)]
The Context&...
1
vote
Defining composite fields using Anchor Accounts structs from other crates
I have encountered this issue before, although with a different error as I was going cross-module, not cross-crate. I even raised it on the Anchor repo but it remains, as of now, unloved.
The ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
anchor-accounts × 10anchor × 7
solana-program × 3
anchor-test × 2
transactions × 1
pda × 1
account × 1
spl × 1
space × 1
spl-token × 1
fetch × 1
storage × 1
oracles × 1
solana-program-test × 1
anchor-spl × 1
allocate × 1
anchor-lang × 1
anchor-program × 1
crates × 1
data-storage × 1
instruction × 1