Questions tagged [invoke]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
18 views

How can I make `msg!` print to stdout when run off-chain?

I have code that's used both in my program and off-chain. In the code, I use msg!. If that msg! line is run off-chain, I get this error: Invoke context not set! What do I need to do to make msg! ...
user9125's user avatar
1 vote
1 answer
46 views

CPI fails with "Cross-program invocation with unauthorized signer or writable account"

Hi I'm having this problem, I'm trying to execute the BuySingleListing from Tensor but by passing the instruction data to my program. The tx works when I just sign it in the frontend, here's the Tx ...
Jhintux's user avatar
  • 11
3 votes
1 answer
164 views

Is it possible to invoke a program using solana cli?

I'm using anchor framework to write and deploy programs in solana blockchain. I run solana-test-validator and then use anchor deploy to deploy my simple hello-world program. It gives me the programs ...
Amir reza Riahi's user avatar
1 vote
2 answers
141 views

Can invoke_signed Be Used in Solana Native Programs to Handle SPL Tokens for Staking?

While reviewing the Solana codebase, I came across the invoke_signed function, which is commonly used for cross-program invocations. I'm particularly interested in understanding if it's possible to ...
Syed Ghazanfer Anwar's user avatar
1 vote
2 answers
192 views

Devnet CPI "unknown program" and "An account required by the instruction is missing"

Testing CPI calls on devnet (e.g. programs both deployed to devnet, anchor.toml set to devnet) yields this error: 'Unknown program Ev6JrN5HqrKwXhoB9jucLdn51yzzDvWmBHkubXWavRio', 'Program <...
Whiteseal's user avatar
  • 2,617
1 vote
1 answer
90 views

How to handle error of invoked_signed calls?

This is my sample code, I am trying to handle the error thrown from cross-invocation calls. let result = invoke_signed( &instruction, &[re_account.clone()], &[&[b&...
crypto sahdev's user avatar
1 vote
1 answer
113 views

How to call cross program function when I have information of program-id and instruction only not the account-info?

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 ...
crypto sahdev's user avatar
1 vote
1 answer
118 views

Who signs transactions created with invoke call?

Solana has the invoke function that can be used to send a transaction from one Solana program to another. Looking at the documentation for this method here, we see: pub fn invoke( instruction: &...
Finlay Weber's user avatar
3 votes
2 answers
73 views

SOLVED - Executing a transfer transaction - does Rust need additional data (AccountInfo) compared to JS (Pubkey only) for the receiving wallet?

I am trying to create a program that allows the signer user (from) to transfer SOL to a different wallet (to). For the signer I have the signer object: pub from_user: Signer<'info>, For the ...
baronezz's user avatar
0 votes
2 answers
171 views

How do I use PDA account to pay for new PDA account

I am struggling to successfully create a PDA account (pdaUSER) paid for by another PDA account. I am doing it like this, and it does not work: invoke_signed( &system_instruction::...
Blair Munro's user avatar
1 vote
2 answers
47 views

What happens when Invoke is successful but Instruction fails

if I have an instruction that invokes another instruction that succeeds but the instruction that invoked it later fails, are there balance changes. transfer_sol_instruction() -> ProgramResult { ...
chinepun.sol's user avatar
5 votes
4 answers
545 views

In a program, what is the difference between invoke and invoke_signed and when to use them?

Can someone explain what the difference is between the two and when to use each? when to use invoke vs invoke_signed inside a program (smart contract)?
DonnySolana's user avatar