Can I turn off this read_state using ic-reactor? My canister can be used directly locally, but it will fail when read_state is used.
This read_state
probably is firing when you are attempting to make a call to an update function in your backend canister from your client. Are you attempting to make a call to an update function?
I do not think that there is a way to remove this.
CC: @b3hr4d (for ic-reactor)
Hello, I am using Ic-reactor library to initialize canister, it will call read_state method and get error 403, what could be the cause of this problem? I was using Connect2ic/react which doesn’t seem to have a read_state step, but canister works fine.
Hey, Can you share the code? How did you initialize and calling function?
The local agents are connected first
Then we create the Actor
Finally wrap my App with Provider
And now I have
bd3sg-teaaa-aaaaa-qaaba-cai Where does this canisterId come from
In the above error, I did not call the read state method actively.
Do not need to use createAgentManager and AgentProvider at the same time, just pass the arguments into the AgenProvider
and it will take care of agent behind the scene.
This is DidJs canister that will exist on dfx that power candid-ui
and we will use it to convert downloaded did file into execuytable javascript file
This proccess can be ignored if you pass idlFactory from your canister declarations
!
You might be missing something on the project setup, is this vite
?
Take a look at the examples or this next-template or this vite-template
This error is no from @ic-reactor/react
anymore, those are about how your project handle API calls.
Okay, I understand. Thank you for your reply~
Pass the idlFactory
if possible, and use CandidAdapterProvider
when you dont have access to the declarations files.
import { idlFactory, canisterId, vault_factory } from "../../declarations/vault_factory"
import { createActorContext } from "@ic-reactor/react"
export const {
ActorProvider: VaultFactoryProvider,
useActorState: useICPLedgerState,
useMethod: useVaultFactoryMethod,
useQueryCall: useICDVQueryCall,
useUpdateCall: useICDVUpdateCall,
} = createActorContext<typeof vault_factory>({
idlFactory,
canisterId: canisterId || "aiqu4-ruaaa-aaaaa-qaqaa-cai",
withDevtools: true,
})
And if you get stocked, share you repo and I will help you with the setup.
Wow, great. I’m very happy to have your guidance. Would tomorrow be all right? I have some other things to adjust today.
No problem Happy to help you getting started with
ic-reactor
library.
The experience of using ic-reactor is very good, my mood has become more pleasant and everything feels more controllable. And thank you very much for helping me!
Hi, buddy. Long time no see. I’m having a bit of trouble now, he’s repeatedly triggering userPrincipal when I’m not logged in. Are you free now,share my repo give you?
Yes, I have time now!
Great, I invite your github to join