solana-foundation / developer-content Goto Github PK
View Code? Open in Web Editor NEWCollection of Developer content for exploring, learning, and building in the Solana ecosystem.
Home Page: https://solana.com/developers
Collection of Developer content for exploring, learning, and building in the Solana ecosystem.
Home Page: https://solana.com/developers
Add docs here.
now that the developer content api has been migrated to app router
, we should utilize generate a full static version of this api using generateStaticParams
There is no documentation for which things take what amount of compute units or how to perform optimizations
Add details to the docs to cover these, and maybe a guide that explains best practices for CU optimizations
Re: content/guides/dapps/journal.md [The CRUD app tutorial]
while defining the account for creating a journal entry, init_if_needed is one of the account constraints, which I don't think is needed and I'm not really sure the feature flag is included when using create-solana-dapp
Just include init instead of init_if_needed in the code snippet
Due to the (smart) restrictions provided by the vercel GitHub bot, the GH actions run on all PRs will not always pass. Specifically when the creator of the PR has not been previously approved to deploy the preview version of their PR changes.
This should be adjusted in the future so that all GH actions can been completely run on every PR and each can obtain all green across the board, making them more useful and more clear on which action failed (and therefore more clear on what changes are needed)
The wSOL token extension transfer hook tutorial has a couple issues I believe, I'm getting some errors including from the "final" version listed....
Tutorial: https://solana.com/developers/guides/token-extensions/transfer-hook#run-test-file
I tested this both with (1) the "final" solpg code link and (2) code in the walkthrough (there are slight differences in each)
Linked as "final program" in the tutorial: https://beta.solpg.io/github.com/solana-developers/anchor-transfer-hook/tree/main
Console Output:
Transaction Signature: 28b3AhseYv68pKguMo5MxQEdjqM5SbuhZ7oZ15N99yw4WuKZTZwrs6qEDYjkr7uk5ED1GnLpxRbqrmi4cG483o8Q
✔ Create Mint Account with Transfer Hook Extension (796ms)
test Transaction Signature: 5dWnbeDfnF1rGrKgx7CYtv9TudXWo8W9cVPAKVNmxNcuLZeTk7HJW5vqcZ4RYVA9FGvSRiRBdn1r1cAWrMgwBSte
✔ Create Token Accounts and Mint Tokens (830ms)
Transaction Signature: Hog1VA4S3oKtGBaaD2AJpZm15PYAq3AGYBTjygsphNBrutgdPUj4obeQpfMQPjDTEhNMreVZWMZEzzvaVsgShB7
✔ Create ExtraAccountMetaList Account (860ms)
1) Transfer Hook with Extra Account Meta
3 passing (4s)
1 failing
The walkthrough code for the tests has some minor errors in the ExtraAccountMetaList function (ie. bigIntAmount left out, naming different). Also, for example one uses a transferInstructionWithHelper function, while the other does not have that.
Also noticed some of the imports are different.
Not sure if the test error is related to all that... but just fyi.
I'm just hoping for any insight or if the code can be updated to make the test successful. I just encountereed it, so I am not sure of any solution yet myself.
Is this still accurate? https://github.com/solana-foundation/developer-content/blob/main/docs/core/rent.md?plain=1#L32
The Solana rent rate is set on a network wide basis, primarily based on the set
LAMPORTS _per_ byte _per_ year.
Per SIMD-0084, it seems rent is no longer being collected: solana-foundation/solana-improvement-documents#84
As a new developer on Solana i'm confused, would be good to have this cleared up in the documentation.
Dark mode is great, but light mode should be an option too.
Add a toggle switch, or use device settings, to switch between light and dark mode in the developer docs.
I have a side branch that I created off of the main repo where I've written an article for the Solana Scribes hackathon, but I can't push the branch to this repo because I don't have the permissions. Needing to open a PR before the deadline.
Finding Result
in random places in the table of contents. Picture shown for https://solana.com/docs/more/exchange#the-importance-of-implementing-priority-fees
Get rid of whatever this erroneous Result
is
There should be a GH workflow that can check the content documents to ensure all the relative links within the repo are valid. This should include:
#
)md
filesThe faucet guide is missing a link for RPC providers of where to go or who to contact about setting up a devnet faucet
This line specifically: https://github.com/solana-foundation/developer-content/blob/a17e9bcaa8cc135a07552c4e70d0ac29858bb8a6/content/guides/getstarted/solana-token-airdrop-and-faucets.md?plain=1#L60C1-L61C6
OSS Contributors are unable to successfully contribute to guides
having a contributing guide can help
example guide -
https://github.com/jessesquires/.github/blob/main/CONTRIBUTING.md
There should be a GH workflow to check for the correct formatting via prettier
We should add words to the faucet guide on how to see and close program buffers and programs to reclaim rent
Hi!
I'd like to make an addition to the guide section. I wish to add a tutorial guide for solana wallet adapter. But I can't see any community contribution guidelines on this repo.
I already have the content prepared here: https://www.solanawalletadapter.xyz/
How do I go about adding it here so that more devs are able to make use of it?
Thanks!
we should move the "hello world" guide into the docs and make it a first class citizen in the intro section
cc @jacobcreech
The token metadata extension has several nuances around the order of instructions when configuring it on a token mint, including the related metadata pointer instructions.
Update the metadata extension guide to elaborate on the correct order of operations for each of the following metadata extension instructions relative to the "initialize mint" instruction:
Also explicitly note that these instructions are applied to the mint account vs an ATA (like some other extensions)
using the playground, i can't seem to import nor use metaplex-foundation/mpl-token-metadata's modules using the latest version. I'm not sure which modules are accessible using the playground. A guide on setting up token information using the playground would be great.
Hi,
just a minor issue I found while reading the documentation on this page it seems like the picture with the visual representation of the transaction does not point to the correct picture that I remember from about 2 weeks ago. Which results in this being shown in the documentation:
Without the correct picture, I find this part hard to read as the next segment references things that should be in the picture that are currently not there.
your deflation rate is -15%
just wanted to point out a misspelling
its Inflation vs Deflation
just FYI - it would be cool to work on a project that has its economic terms figured out before I start dealing with structs and pointers
here is the doc with the incorrect term:
just like precision and lowercase writing styles. thanks.
The current content date
fields use the English words for months in the dates. This can lead to some confusion among Crowdin translators. If this date
field is set to an empty string, it will result in the content api failing to deploy.
Related: #225
All the RPC docs use curl to give examples of making RPC requests. curl by default will show the progress, loading, and bytes transferred which clutters the cli up.
Add the -s
flag to all the RPC curl commands to all RPC curl examples to make the CLI response feel cleaner
The RPC API for the method getRecentPrioritizationFees
is not including all the information required to use the method effectively.
The source code suggests that the recent prioritization fees are calculated by max(min(block), min(account1), ...., min(accountN))
, meaning that if you filter by no accounts the method will return the lowest fee paid in the block - normally 0. We should clarify this in the documentation.
the rust hello world guide should be improved after feedback during a DX test
They can work separately well. However, if I put them together, immutable-owner always show Error processing Instruction 2: invalid account data for instruction.
My code is based on guide.
import * as anchor from "@coral-xyz/anchor";
import {Program, web3} from "@coral-xyz/anchor";
import { ZkmeSol } from "../target/types/zkme_sol";
import {it} from "mocha";
import {Connection, Keypair, sendAndConfirmTransaction, SystemProgram, Transaction} from "@solana/web3.js";
import {
AuthorityType,
createInitializeAccountInstruction,
createInitializeImmutableOwnerInstruction,
createInitializeMintInstruction,
createInitializeNonTransferableMintInstruction,
createMint,
ExtensionType,
getAccountLen, getMintLen, setAuthority,
TOKEN_2022_PROGRAM_ID
} from "@solana/spl-token";
import {min} from "bn.js";
//anchor test
describe("zkme_sol", () => {
// Configure the client to use the local cluster.
anchor.setProvider(anchor.AnchorProvider.env());
const program = anchor.workspace.ZkmeSol as Program<ZkmeSol>;
const zkmeSeed = anchor.utils.bytes.utf8.encode("zkme_conf");
let adminPubKey;
before( async () => {
[adminPubKey] = await anchor.web3.PublicKey.findProgramAddress(
[zkmeSeed, anchor.AnchorProvider.env().wallet.publicKey.toBytes()],
program.programId
);
});
it( "Is createAdmin", async () => {
const payer = web3.Keypair.generate();
// Connection to devnet cluster
const connection = new Connection('http://127.0.0.1:8899', 'confirmed');
// Transaction signature returned from sent transaction
let transactionSignature: string;
const airdropSignature = await connection.requestAirdrop(
payer.publicKey,
web3.LAMPORTS_PER_SOL, // 1 SOL
);
await connection.confirmTransaction(airdropSignature);
const balanceA = await connection.getBalance(payer.publicKey)
console.log("airdropSignature success", balanceA);
// Authority that can mint new tokens
const mintAuthority = payer.publicKey;
// Decimals for Mint Account
const decimals = 2;
const mintLen = getMintLen([ExtensionType.NonTransferable]);
// Minimum lamports required for Mint Account
let lamports = await connection.getMinimumBalanceForRentExemption(mintLen);
const mintKeypair = Keypair.generate();
// Address for Mint Account
const mint = mintKeypair.publicKey;
const createAccountInstructionA = SystemProgram.createAccount({
fromPubkey: payer.publicKey, // Account that will transfer lamports to created account
newAccountPubkey: mint, // Address of the account to create
space: mintLen, // Amount of bytes to allocate to the created account
lamports, // Amount of lamports transferred to created account
programId: TOKEN_2022_PROGRAM_ID, // Program assigned as owner of created account
});
console.log("createAccountInstruction",createAccountInstructionA)
// Instruction to initialize the NonTransferable Extension
const initializeNonTransferableMintInstructionA =
createInitializeNonTransferableMintInstruction(
mint, // Mint Account address
TOKEN_2022_PROGRAM_ID, // Token Extension Program ID
);
console.log("initializeNonTransferableMintInstruction",initializeNonTransferableMintInstructionA)
// Instruction to initialize Mint Account data
const initializeMintInstructionA = createInitializeMintInstruction(
mint, // Mint Account Address
decimals, // Decimals of Mint
anchor.AnchorProvider.env().publicKey, // Designated Mint Authority
null, // Optional Freeze Authority
TOKEN_2022_PROGRAM_ID, // Token Extension Program ID
);
console.log("initializeMintInstruction",initializeMintInstructionA)
// Add instructions to new transaction
const transactionA = new Transaction().add(
createAccountInstructionA,
initializeNonTransferableMintInstructionA,
initializeMintInstructionA,
);
console.log("mint:",mint)
// Send transaction
transactionSignature = await sendAndConfirmTransaction(
connection,
transactionA,
[payer, mintKeypair], // Signers
);
console.log(
"transactionSignature",transactionSignature
)
// Random keypair to use as owner of Token Account
const tokenAccountKeypair = Keypair.generate();
// Address for Token Account
const tokenAccount = tokenAccountKeypair.publicKey;
// Size of Token Account with extension
const accountLen = getAccountLen([ExtensionType.ImmutableOwner]);
// Minimum lamports required for Token Account
lamports = await connection.getMinimumBalanceForRentExemption(accountLen);
// Instruction to invoke System Program to create new account
const createAccountInstruction = SystemProgram.createAccount({
fromPubkey: payer.publicKey, // Account that will transfer lamports to created account
newAccountPubkey: tokenAccount, // Address of the account to create
space: accountLen, // Amount of bytes to allocate to the created account
lamports, // Amount of lamports transferred to created account
programId: TOKEN_2022_PROGRAM_ID, // Program assigned as owner of created account
});
// Instruction to initialize the ImmutableOwner Extension
const initializeImmutableOwnerInstruction =
createInitializeImmutableOwnerInstruction(
tokenAccount, // Token Account address
TOKEN_2022_PROGRAM_ID, // Token Extension Program ID
);
// Instruction to initialize Token Account data
const initializeAccountInstruction = createInitializeAccountInstruction(
tokenAccount, // Token Account Address
mint, // Mint Account
payer.publicKey, // Token Account Owner
TOKEN_2022_PROGRAM_ID, // Token Extension Program ID
);
console.log("mint:",mint)
// Add instructions to new transaction
const transaction = new Transaction().add(
createAccountInstruction,
// initializeImmutableOwnerInstruction,
initializeAccountInstruction,
);
// Send transaction
transactionSignature = await sendAndConfirmTransaction(
connection,
transaction,
[payer, tokenAccountKeypair], // Signers
);
console.log(
"\nCreate Token Account:",
`https://solana.fm/tx/${transactionSignature}?cluster=devnet-solana`,
);
})
});
The main token extensions page can be improved. Feedback as follows:
a couple of suggestions on docs-related improvements for extensions - it’d be useful to split up the extensions that go on the mint and the ones that go on the ATA, and / or have a subsection under each extension that explains when it gets initialized and used
for example, requiredMemo on transfer is actually an ATA-level feature and, if i’m understanding correctly, only designates restrictions on inbound transfers to that ATA but not a global token-wide requirement. amazing! CPI Guard is also enabled on the ATA, and some part of confidential transfers is enabled on the ATA
same with token metadata, afaict it needs to be initialized after the metadata pointer as part of a separate transaction. same with group / member alongside their compatriots group pointer, member pointer
The Solana CLI is a valid client for the blockchain and yet not listed under the "clients" section of the docs.
Add a new page under the "clients" section for the Solana CLI
The docs here walk through an offline signing scenario with two signers, using a nonce account. There is an issue in the section where the author signs the transaction with the second keypair called sender.json
in the scenario. The --fee-payer
flag is missing, and I noticed that the co-signer.json
's address and signature are missing in the transaction, and that the sender.json
's address actually paid the fee.
Sender's address H8BHbivzT4DtJxL4J4X53CgnqzTUAEJfptSaEHsCvg51
Co-sender's address HDx43xY4piU3xMxNyRQkj89cqiF15hz5FVW9ergTtZ7S
Result from running
solana confirm -v anQ8VtQgeSMoKTnQCubTenq1J7WKxAa1dbFMDLsbDWgV6GGL135G1Ydv4QTNd6GptP3TxDQ2ZWi3Y5qnEtjM7yg
Commitment: confirmed
Transaction executed in slot 223952780:
Block Time: 2023-06-19T20:34:29+00:00
Version: legacy
Recent Blockhash: HNUi6La2QpGJdfcAR6yFFmdgYoCvFZREkve2haMBxXVz
Signature 0: anQ8VtQgeSMoKTnQCubTenq1J7WKxAa1dbFMDLsbDWgV6GGL135G1Ydv4QTNd6GptP3TxDQ2ZWi3Y5qnEtjM7yg
Signature 1: 59NDuW9ekarYGrs32Gadi7acejtMPrbTVeovmKyGGwHyk1oQyruWbJ6zonihwwPoYZ1ULHHRxXF8NrcZbcw5bwBR
Account 0: srw- H8BHbivzT4DtJxL4J4X53CgnqzTUAEJfptSaEHsCvg51 (fee payer)
Account 1: sr-- 5CZKcm6PakaRWGK8NogzXvj8CjA71uSofKLohoNi4Wom
Account 2: -rw- 8DedqKHx9ogFajbHtRnTM3pPr3MRyVKDtepEpUiaDXX
Account 3: -rw- D3RAQxwQBhMLum2WK7eCn2MpRWgeLtDW7fqXTcqtx9uC
Account 4: -r-x 11111111111111111111111111111111
Account 5: -r-- SysvarRecentB1ockHashes11111111111111111111
Instruction 0
Program: 11111111111111111111111111111111 (4)
Account 0: 8DedqKHx9ogFajbHtRnTM3pPr3MRyVKDtepEpUiaDXX (2)
Account 1: SysvarRecentB1ockHashes11111111111111111111 (5)
Account 2: 5CZKcm6PakaRWGK8NogzXvj8CjA71uSofKLohoNi4Wom (1)
AdvanceNonceAccount
Instruction 1
Program: 11111111111111111111111111111111 (4)
Account 0: H8BHbivzT4DtJxL4J4X53CgnqzTUAEJfptSaEHsCvg51 (0)
Account 1: D3RAQxwQBhMLum2WK7eCn2MpRWgeLtDW7fqXTcqtx9uC (3)
Transfer { lamports: 100000000 }
Status: Ok
Fee: _0.00001
Account 0 balance: _0.399995 -> _0.299985
Account 1 balance: _1.9984551
Account 2 balance: _0.0014999
Account 3 balance: _0.6 -> _0.7
Account 4 balance: _0.000000001
Account 5 balance: _0.04270656
Compute Units Consumed: 0
Log Messages:
Program 11111111111111111111111111111111 invoke [1]
Program 11111111111111111111111111111111 success
Program 11111111111111111111111111111111 invoke [1]
Program 11111111111111111111111111111111 success
Finalized
Everyone is looking for a complete guide to Solana development to get them started. Guides like https://dev.to/edge-and-node/the-complete-guide-to-full-stack-solana-development-with-react-anchor-rust-and-phantom-3291 were essential to jumpstarting the ecosystem in 2021, and we're looking for a refresh. Proper submission must be made as a PR to https://github.com/solana-foundation/developer-content.
Complete Guide to Solana Development Updated with the latest tooling and libraries with code repo.
replaceRecentBlockhash
is true
developer-content/docs/rpc/http/simulateTransaction.mdx
Lines 21 to 23 in 734fdc3
replacementBlockhash
is missing from heredeveloper-content/docs/rpc/http/simulateTransaction.mdx
Lines 107 to 143 in 734fdc3
See anza-xyz/agave#380.
For writing code within markdown, we're often writing it directly in it. This causes problems if we want to write tests on it later down the line.
Allow loading code from a separate file, much like vuepress's @/code
so we can write a bunch of nightly tests later to check the up-to-dateness of our code.
The page "Add Solana to Your Exchange" in the "more information" section is not working properly.
There are many links to docs.solana.com
within this repo which has been converted to only handling redirects. We can and should avoid these redirects by just putting in their final destination
Now that the docs migration is completed, all of these links should be updated to their new/correct locations
zsynk
invite the link with analog 123
https://solana.com/zh/docs/core/tokens
unknown error while processing the markdown content.
The Deploying Programs doc gives no clear link to the very applicable getting started guides to help get a person started
Add a green callout towards the top of the deploying programs doc that links to these guides:
"i18n/ru/content/guides/getstarted/local-rust-hello-world.md" of type "GuideRecord" has the following incompatible fields:
• date: ""
Have some way to avoid this error in the future. Maybe default date as a stopgap? Accepting these via crowdin should have some kind of verifying build.
In the redeploying of the program with the added PDA part, to show Solana program details the following command is used:
solana program show --program-id <Program Address>
This gives the following error:
error: Found argument '--program-id' which wasn't expected, or isn't valid in this context
Did you mean --programs?
USAGE:
solana program show --buffers --programs
The following command be used in place:
solana program show <Program Address>
A comprehensive guide tailored for implementing crowdfunding smart contracts using Rust and the Anchor framework on the Solana blockchain. This guide covers all aspects of the development lifecycle, including setting up the development environment, understanding the contract structure, implementing core functionalities, testing, deployment, and best practices.
https://solana.com/docs/core/transactions/confirmation#how-does-transaction-expiration-work states expiration happens after 151 slots. This is incorrect
Reword to use blockheight
The rpc docs give examples of how to use each method using a CURL request to a localhost endpoint, which assumes a user is already running a local test validator. Which the grand majority will not.
Update all the rpc CURL examples to use the public devnet endpoint instead of localhost. This will allow anyone to run the command right away and get a real response. This might involve updating some of the request params to use accounts and data that is live on devnet
In 'docs/core/transactions/versions.md' clicked "view an example of a v0 transaction on Solana Explorer" which under the More Resources shows Not Found
Added a new example of a v0 transaction
link
When accessing https://solana.com/staking#what-is-staking using mobile (iPhone 14), the text is cutoff and a few words are misspelled/smashed together.
The page doesn't allow you to scroll left or right to read the content.
I looked for the main site repo but it doesn't appear to be open source.
In the Solana docs there is a lot of good docs on the "happy" path of getting something to work but not a lot of help for developers that get stuck on something that is off the unhappy path.
It'd be helpful to create developer content that identifies how to properly debug and solve issues when building novel solutions, instead of just trying to run working examples.
Examples of these tools might include the usage of the Solana explorer inspector, propper logging tools, resources to get help, error and logs macros, etc
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.