lib.rs 611 B

12345678910111213141516171819202122232425262728293031
  1. use solana_program::{
  2. account_info::AccountInfo,
  3. entrypoint,
  4. entrypoint::ProgramResult,
  5. msg,
  6. pubkey::Pubkey,
  7. };
  8. // Tells Solana that the entrypoint to this program
  9. // is the "process_instruction" function.
  10. //
  11. entrypoint!(process_instruction);
  12. // Our entrypoint's parameters have to match the
  13. // anatomy of a transaction instruction (see README).
  14. //
  15. fn process_instruction(
  16. program_id: &Pubkey,
  17. accounts: &[AccountInfo],
  18. instruction_data: &[u8],
  19. ) -> ProgramResult {
  20. msg!("Hello, Solana!");
  21. msg!("Our program's Program ID: {}", &program_id);
  22. Ok(())
  23. }