Troubleshooting Setting up Bitcoin and Lightning Node on Apple Silicon (arm64) MacBooks

As I began my journey with the world of Bitcoin, the first challenge at hand was knowing how to get the work environment set up. The first problem is getting the info I need all in one place especially since am running an arm64 architecture. I found bits and pieces of how to go about it and decided to help the readers simplify their setting-up journey by sharing issues I faced and from other peers and how I solved them.
Prerequisites and Environment Setup
This tutorial assumes you have brew and git installed. Here a few points to note in setting up your environment.
Before anything, we should follow guidelines, and tutorials properly, here is a resource that does justice to installing bitcoin on MacOS Install Bitcoin on MacOS.
Run the following command to clone the repo:
Install Bitcoin with zmq
You should compile
bitcoinwith zmq as it helps in debugging connections between bitcoin and lightning. To do this make surezeromqis installed usingbrew install zeromqAnd then configure bitcoin using this command
./configure --with-zmq --enable-zmqAliases Update:
Always make sure to update your aliases and run
source ~/.bash_profileTo update your current terminal tab.
Common Issues and Solutions
Command not found for
lndorlncli:If the
lndinstallation was completed andgois installed, and stilllndorlnclicommand not found, runwhich goshould return something like
/opt/homebrew/bin/gothen confirm the go executable path exist by running
ls ~/goshould return
bin pkgWe need to confirm
lndandlncliis part of the go pathls ~/go/binshould return
lncli lndNow we just copy the executables to default installation location
sudo cp ~/go/bin/lnd /usr/local/bin/ sudo cp ~/go/bin/lncli /usr/local/bin/Error Message: `LND setup: unable to create partial chain control: status code: 401, response: ""
This usually rises from when your
rpcauthon yourbitcoin.confdoes not match yourrpcuserandrpcpasswordin your lnd.confMake sure to use the username and password provided when you run this command
python3 ./share/rpcauth/rpcauth.py<your-desired-username> <your-password>and place the returned
rpcauthin thebitcoin.conf.Error Message: Unable to connect to <lightingnode-pubkey>@127.0.0.1:9734: EOF
You could get this if you trying to connect to a wrong
identity-pubkeyof another lightning node.Error: Bitcoind
testnetis consuming so much space when syncing.This is due to not having a limit to which the blockchain should sync, this imit it done by setting a value to the prune parameter in the
bitcoin.confError Message: error message: Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee.
This happens when connecting two nodes and creating a channel.
A walkaround for this would be adding
fallbackfee=0.000001to thebitcoin.confand restartingbitcoindandlndSo that transactions are quickly added to blocks mined in
regtestError Message : [lncli] could not load global options: unable to read macaroon path (check the network setting!): open /Users/decagon/Library/Application Support/Lnd/data/chain/bitcoin/mainnet/admin.macaroon: no such file or directory
This simply says that your
lndis not talking to yourbitcoindproperly, meaning they are not on the same mode[regtest, testnet, mainnet]Check your
lnd.confmode andbitcoindwith the same mode is running.Balance not reflecting on
regtestortestnetFor
regtest, you may get{ "mine": { "trusted": 0.00000000, "untrusted_pending": 0.00000000, "immature": 100.00000000 }, "lastprocessedblock": { "hash": "5adf04f4ddbfe4d28e2f4877734a4171f726486e726aee3b2fbc0e6f558fe64f", "height": 107 } }when you run
bitstein-cli getbalancesYou need to generate some blocks say like
100😀.For
testnet, make sure your node is synced to the current block, don't forget to prune your node to avoid filling your space with older blocks.Error:
lndconsole stuck at "Waiting for chain backend to finish sync, start_height"Just generate a block in using
bitcoin-cli generate 1while
Conclusion
By addressing common installation issues outlined in this article, you can enjoy a seamless experience in setting up and maintaining their cryptocurrency nodes. Always refer to the official documentation and community resources for the latest updates and solutions to emerging challenges. In a future article, we’ll walk through creating a command line wallet that using bitcoinjs-lib.
If you have any questions, suggestions, or errata to submit, my DMs are open on Discord. I hope this helps you on and going as it did for me!
