# Setting up local BTC environment errors

**URL:** <https://forum.dfinity.org/t/setting-up-local-btc-environment-errors/17885>\
**Category:** Programs & Applications\
**Created:** [January 9, 2023, 8:17pm UTC](https://forum.dfinity.org/t/setting-up-local-btc-environment-errors/17885 "2023-01-09T20:17:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![der0pa](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/der0pa/32/4847_2.png) [@der0pa](https://forum.dfinity.org/u/der0pa)\
**Post date:** [January 9, 2023, 8:17pm UTC](https://forum.dfinity.org/t/setting-up-local-btc-environment-errors/17885/1 "2023-01-09T20:17:05Z")

</div>

working thru

> **[Developing Bitcoin Dapps Locally | Internet Computer Home](https://internetcomputer.org/docs/current/developer-docs/integrations/bitcoin/local-development)**
>
> In the Deploy Your First Bitcoin Dapp tutorial,

m1 mac  
bitcoin-core running locally  
port 8333 is default port … has been running several months without issues  
set dfx.json to port above

fails on:

basic\_bitcoin % dfx deploy basic\_bitcoin --argument ‘(variant { Regtest })’

console log is here

> **[Compiling logos v0.12.0 Compiling candid v0.7.14error: failed to run cu -...](https://pastebin.com/sP2pWyK1)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

then added command  
cargo add secp256k1-sys

been hanging on nostr with our BTCmaxi brothers and what to show this off 🙂

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [January 10, 2023, 7:56am UTC](https://forum.dfinity.org/t/setting-up-local-btc-environment-errors/17885/2 "2023-01-10T07:56:51Z")

</div>

`error occurred: Failed to find tool. Is `clang` installed?`

Sounds like a problem with your machine’s setup to me. Can you make sure that clang is available?

---

<div class="post-metadata">

**Author:** ![der0pa](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/der0pa/32/4847_2.png) [@der0pa](https://forum.dfinity.org/u/der0pa)\
**Post date:** [January 10, 2023, 1:40pm UTC](https://forum.dfinity.org/t/setting-up-local-btc-environment-errors/17885/3 "2023-01-10T13:40:54Z")

</div>

douglassmith@static-76-161-87-250 basic\_bitcoin % clang --version  
Apple clang version 14.0.0 (clang-1400.0.29.202)  
Target: arm64-apple-darwin22.2.0  
Thread model: posix  
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

added path to .zshrc

same error

this is where things derail

TARGET\_CC = None  
CC = Some(“/opt/homebrew/opt/llvm/bin/clang”)

---

<div class="post-metadata">

**Author:** ![der0pa](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/der0pa/32/4847_2.png) [@der0pa](https://forum.dfinity.org/u/der0pa)\
**Post date:** [January 10, 2023, 3:40pm UTC](https://forum.dfinity.org/t/setting-up-local-btc-environment-errors/17885/4 "2023-01-10T15:40:09Z")

</div>

reinstalled llvm and added suggested paths to .zshrc

it compiles now but …

~/Fossils/examples/rust/basic\_bitcoin  
Installing canisters…  
Installing code for canister basic\_bitcoin, with canister ID rrkah-fqaaa-aaaaa-aaaaq-cai  
Error: Failed while trying to deploy canisters.  
Caused by: Failed while trying to deploy canisters.  
Failed while trying to install all canisters.  
Failed to install wasm module to canister ‘basic\_bitcoin’.  
Failed to install wasm in canister ‘rrkah-fqaaa-aaaaa-aaaaq-cai’.  
Failed to install wasm.  
The replica returned an HTTP Error: Http Error: status 413 Payload Too Large, content type “”, content: Request 0x544cdb792de775359f407e4ef3cbc67faa3a1887624abc3db3988d695627e971 is too large. Message byte size 2841690 is larger than the max allowed 2097152.  
douglassmith@static-76-161-87-250 basic\_bitcoin %

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [January 10, 2023, 4:16pm UTC](https://forum.dfinity.org/t/setting-up-local-btc-environment-errors/17885/5 "2023-01-10T16:16:30Z")

</div>

It’s pretty common to have rust canisters be too big. There’s a few things you can try. Probably easiest is `cargo install ic-wasm`, which will try to remove unused code from the wasm before uploading. Next is to gzip the wasm before uploading it. This requires a custom build script and you should be able to find more info about it in [this](https://forum.dfinity.org/t/http-error-status-413-payload-too-large/1705/15) or [this](https://forum.dfinity.org/t/bug-since-upgrading-to-dfx-v0-12-running-into-failed-to-install-wasm-the-replica-returned-an-http-error-http-error-status-413-payload-too-large/16459) thread.

---

<div class="post-metadata">

**Author:** ![der0pa](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/der0pa/32/4847_2.png) [@der0pa](https://forum.dfinity.org/u/der0pa)\
**Post date:** [January 10, 2023, 5:06pm UTC](https://forum.dfinity.org/t/setting-up-local-btc-environment-errors/17885/6 "2023-01-10T17:06:51Z")

</div>

thanks got things working by compressing wasm and rolling back dfx 12.1. → dfx 12.0

i was not able to install ic-wasm

some issues may be from using a M1 mac
