Home/Docs/Recipe Book/Instructions

Recipe Book program instructions.

Instructions

initialize_recipe_book

Creates a new RecipeBook for a target program.

Accounts

AccountWritableSignerDescription
authorityโœ…โœ…The authority for this RecipeBook
recipe_bookโœ…โŒPDA to be created
system_programโŒโŒSystem program

Args

ArgTypeDescription
target_program_idpubkeyThe program to track

Behavior

  • Creates a new RecipeBook PDA
  • Sets authority to the signer
  • Fails with RecipeBookAlreadyExists if one already exists for this program

register_deploy

Records a new deploy entry in the RecipeBook.

Accounts

AccountWritableSignerDescription
deployerโœ…โœ…The wallet that deployed
recipe_bookโœ…โŒThe RecipeBook PDA
authorityโŒโŒMust match RecipeBook.authority
entryโœ…โŒPDA to be created
system_programโŒโŒSystem program

Args

ArgTypeDescription
repostringGit remote URL or short name
commitstringGit commit SHA
build_hash[u8; 32]SHA-256 of compiled binary
bufferpubkeyBuffer program account

Behavior

  • Creates a new Entry PDA
  • Increments RecipeBook.entry_count
  • Fails with Unauthorized if deployer โ‰  authority
  • Fails with StringTooLong if strings exceed max length

Error codes

CodeNameDescription
6000RecipeBookAlreadyExistsA RecipeBook already exists for this target program
6001UnauthorizedSigner is not the authority of this RecipeBook
6002StringTooLongString exceeds maximum allowed length
Sourced from local MDX in docs/content/docs