Deploy on SVM
Last updated
# Check supply
spl-token supply <address>
# Create an account to hold balance
spl-token create-account <address>
# Check balance
spl-token balance <address>
# Mint some
spl-token mint <address> <amount>
# Check supply again
spl-token supply <address>cargo init hello_world --lib
cd hello_worldcargo add solana-program[lib]
name = "hello_world"
crate-type = ["cdylib", "lib"]use solana_program::{
account_info::AccountInfo,
entrypoint,
entrypoint::ProgramResult,
pubkey::Pubkey,
msg,
};
// declare and export the program's entrypoint
entrypoint!(process_instruction);
// program entrypoint's implementation
pub fn process_instruction(
program_id: &Pubkey,
accounts: &[AccountInfo],
instruction_data: &[u8]
) -> ProgramResult {
// log a message to the blockchain
msg!("Hello, world!");
// gracefully exit the program
Ok(())
}
cargo build-bpfsolana program deploy ./target/deploy/hello_world.so