Skip to main content

example/
lib.rs

1#![allow(unexpected_cfgs)]
2#![allow(unused)]
3
4use tape_api::prelude::*;
5use steel::*;
6
7declare_id!("Gzuu6orA9tz2ifE7zyupNiuhogYkRBmbuQpWJme5dGhJ"); 
8
9pub fn process_instruction(
10    program_id: &Pubkey,
11    accounts: &[AccountInfo],
12    _data: &[u8],
13) -> ProgramResult {
14    let [
15        signer_info, 
16        tape_info,
17        writer_info, 
18        tape_program_info,
19    ] = accounts else {
20        return Err(ProgramError::NotEnoughAccountKeys);
21    };
22
23    solana_program::msg!("<Your program functionality here>");
24
25    let your_data = vec![42; 1024]; // (you can be creative here)
26    let ix = &build_write_ix(
27        *signer_info.key,
28        *tape_info.key,
29        *writer_info.key,
30        None,
31        &your_data
32    );
33
34    solana_program::program::invoke(ix, accounts);
35
36    Ok(())
37}
38
39entrypoint!(process_instruction);