Error Bitcoin API on Local

Why does it return the error “the bitcoin API is not enabled on this subnet” on Local dev?
I ran “dfx start --enable-bitcoin --background” and start server “Bitcoin Core”
This is the dfx.json config canister with candid and wasm file built from examples/motoko/basic_bitcoin at master · dfinity/examples · GitHub
In that example, it returns successes. But I want to apply to my project.
Thanks, you.

Hey @Mavis , does it work if you try dfx start --clean --enable-bitcoin --background? The additional --clean deletes whatever local state you have for dfx.

It is not working
If I run in example “basic_bitcoin”, it will work. But I want to apply to my project

Please share your full dfx.json as well as the output of the command dfx start --clean --enable-bitcoin. If your project is available publicly somewhere I can also take a look there if you point me to it.

I tried upgrade dfx of my project and this is working :blush:. But I have an question, I deployed example “basic_bitcoin” outside my project on Mainnet with same Controller canister. So, Can I call canister “basic_bitcoin” Mainnet from my project on Production? It still work?
Because I tried call on Local and it return error “not route” when i call from my project :thinking:

If I understand you correctly, you deployed the Bitcoin example on mainnet somewhere, and you also deployed your project, and you’re trying to call the Bitcoin example canister in your project, is that right? That should work, yes, both in production and locally. Can you share the error that you get and how you’re calling the canister?

This is my code.
Env.BTC_ID is canister id

Are you trying to call a canister in production from your own local setup? If yes, that is not possible. A canister on mainnet can only be called by another canister on mainnet. And, similarly, local canisters can only be called by canisters installed locally.

Maybe if you share the full error message I can have more insight into what you’re experiencing.