Here's my solana program,
use my-rust-crate::do_cpi;
pub fn do_something(ctx:Context<DoSomething>) => Result<()>{
do_cpi(ctx);
}
so this my rust crate is where the CPI happens, its not a solana program, its a rust program. In order to do the CPI i need a signer.
so how should i proceed with this.
this is the solana program function i'm try to CPI
pub fn register_client(ctx: Context<RegisterClient>, client_name: String) -> Result<()> {
let name = client_name.as_bytes();
if validate_name(name) == false {
return err!(AgentError::InvalidName);
}
let client = &mut ctx.accounts.client.load_init()?;
client.owner = ctx.accounts.owner.to_account_info().key();
Ok(())
}