Beginner questions for you. I have a program that can successfully create and later modify a PDA account with some basic data. The Account struct is very basic:
pub struct CustomPdaAccount {
pub value: u32,
}
I also have a completely separate on-chain program that simply takes in a regular account's data (one with its own keypair, not a PDA, but has the same account structure) and multiplies the current value
by some random number. Nothing fancy at all.
That said, how would/should I proceed to make these two programs work together? Is this the territory of CPIs or something else? It would be neat to have my first on-chain program create and initializes a PDA account, and then my second on-chain program could be called to modify the data. However, my understanding is that PDA accounts can only be modified by the program that originally initialized/created the account.
Obviously, I could simply add the multiplication instruction logic inside the first program, rebuild, deploy, and then I'm left with a single program that does it all. Just curious if there is a Solana feature I should explore further.