source: introduction to programming on solana
- Use the
cargo build-bpf
command to compile your program to a file with the so file extension. - Run
solana-keygen new
to create and save a solana keypair locally. - Check solana config: make sure the
RPC URL
is set tohttp://localhost:8899
- If it isn't already, do it with
solana config set --url http://localhost:8899
- If it isn't already, do it with
- Fire up your localnet with
solana-test-validator
- Then use
solana deploy PATH_TO_YOUR_PROGRAM_SO_FILE
- The
deploy
command should print the "program id" that will be used to reference the program in subsequent transactions.