I am calling Program B from Program A and all I know is program-id of Program-B and instruction message (not the account info's that will be going to read/update in Program-B execution).

In this situation, How should I call the cross-program-invocation?

1 Answer 1


If you don't know the account infos, you cannot do a cross-program invocation.

Since you have the instruction creator, however, you can investigate the source code to see the accounts passed in and their order.

This is a longstanding issue on Solana with the invoke API. Since you're declaring the account pubkeys in the instruction, the runtime should be able to find and pull out the required accounts. It just hasn't been implemented unfortunately.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.