| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A highly requested tutorial! We are covering from start to finish how to write Solana SPL Token Program to launch your own token on the Solana blockchain.
Note
THE FILES ATTACHED TO THIS REPO ARE FOR EDUCATIONAL PURPOSES ONLY. NOT FINANCIAL ADVICE USE IT AT YOUR OWN RISK, I'M NOT RESPONSIBLE FOR ANY USE, ISSUES.
Note
If you have Windows, please download VMware Workstation Player, install then create a virtual machine. Follow the tutorial video for full guidance.
VMware Workstation Player for Windows: https://www.techspot.com/downloads/downloadnowfile/1969/?evp=4c50cf08866937ea246522b86f4d4286&file=2171
Ubuntu Desktop 22.04 ISO: https://releases.ubuntu.com/jammy/ubuntu-22.04.4-desktop-amd64.iso
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y curl pkg-config build-essential libudev-dev libssl-devcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shPress Enter When Prompted.
sh -c "$(curl -sSfL https://release.solana.com/v1.18.14/install)"nano ~/.bashrcAdd this line to end of file:
export PATH="/root/.local/share/solana/install/active_release/bin:$PATH"save by : CTRL + X , Press Y, ENTER
Reboot PC.
Open back the terminal then confirm that Solana Cli is active by typing "solana" and press ENTER.
curl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.shsudo -E bash nodesource_setup.shsudo apt-get install -y nodejsVerify Installation:
node -vcorepack enable
yarn init -2Ignore Error: Internal Error: Process git failed to spawn
cargo install --git https://github.com/coral-xyz/anchor avm --locked --forceavm install latest
avm use latestVerify Installation:
anchor --versionsolana-keygen newanchor init spl[provider]
cluster = "devnet"SAVE FILE!
anchor buildanchor deployexport type Spl = {
"address": "ENTERPROGRAMID",SAVE FILE!
{
"address": "ENTERPROGRAMID",SAVE FILE!
declare_id!("ENTERPROGRAMID");SAVE FILE!
Watch @ https://youtu.be/66o6qma2Jdc?t=3m40s
Copy the metadata.json Arweave path.
const metadata = {
name: "Net2Dev Rewards SPL",
symbol: "N2DR",
uri: "https://arweave.net/Xjqaj_rYYQGrsiTk9JRqpguA813w6NGPikcRyA1vAHM", //replace with Arweave metadata json path
decimals: 9,
};
const mintAmount = 10; // Amount of tokens to initially mint.SAVE FILE!
anchor testnpm i @solana/spl-tokenWatch @ https://youtu.be/66o6qma2Jdc?t=55m30s
const owner = 'REPLACEWITHSTRINGPRIVATEKEY' // private key string previously obtained
const spltoken = new PublicKey("SPLPROGRAMID"); // Program Id of your SPL Token, obtained during "anchor deploy"
const tokens = 2; // set the amount of tokens to transfer.SAVE FILE!
const destWallet = new PublicKey("NEWWALLETADDRESS");SAVE FILE!
node spl-transfer.jsExpected Result:
create ata txhash: 4uU9xegH7YZ3tTC934PBSzsVQf3pwoA5BWwXnpFpuK7aCTDu9yqK32r2Vjsbqz4vxhMReeL6NkmQ1hZPg3XSAXh8
Tokens transferred Successfully, Receipt: rttSvKXANuiTZkUmx1gj5B1jSH6bNz4NU64YmvqXouLYoWzqejot1NXxGrML7L87FWa2tX8WBDViKw8C5nmEZrC| Back | FazBrowse Home | New Git URL |