<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Hilary's Blog]]></title><description><![CDATA[Hilary's Blog]]></description><link>https://blog.laryhills.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 03:38:51 GMT</lastBuildDate><atom:link href="https://blog.laryhills.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Troubleshooting Frontend Integration Issues with Starknet Devnet Without Losing Your Sanity]]></title><description><![CDATA[As Ethereum scales through Layer 2 solutions, Starknet has emerged as a powerful ZK-Rollup platform for developers building secure, low-cost, and scalable decentralized applications. But like any emerging ecosystem, Starknet comes with its quirks—esp...]]></description><link>https://blog.laryhills.dev/troubleshooting-starknet-frontend-integration</link><guid isPermaLink="true">https://blog.laryhills.dev/troubleshooting-starknet-frontend-integration</guid><category><![CDATA[starknet-devnet]]></category><category><![CDATA[sncast]]></category><category><![CDATA[starknet]]></category><category><![CDATA[React]]></category><dc:creator><![CDATA[Hilary Okoh]]></dc:creator><pubDate>Wed, 16 Jul 2025 04:14:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1752579915594/286ea4a7-a6ca-4076-8d83-351ea3bb97f8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As Ethereum scales through Layer 2 solutions, Starknet has emerged as a powerful ZK-Rollup platform for developers building secure, low-cost, and scalable decentralized applications. But like any emerging ecosystem, Starknet comes with its quirks—especially when connecting your frontend to a local devnet. Think of it as that friend who's brilliant but speaks in riddles and occasionally disappears when you need them most.</p>
<p>In this article, we'll walk through common issues developers face when integrating the frontend, Starknet Devnet, and Cairo smart contracts, and how to resolve them effectively. Consider this your survival guide for when things go sideways (and they will).</p>
<h2 id="heading-1-docker-alternative-for-devnet">🐳 1. Docker Alternative for Devnet</h2>
<p><strong>Problem:</strong></p>
<p>You've installed starknet-devnet, but running <code>starknet-devnet</code> throws errors or hangs like a Windows 95 computer trying to run Chrome. On windows, especially, you could use <code>docker</code> to containerize your way to happiness.</p>
<p><strong>Solution:</strong></p>
<p>You can run <code>devnet</code> via Docker like so:</p>
<pre><code class="lang-bash">docker pull shardlabs/starknet-devnet-rs:0.4.0-seed0
docker run -it --rm -p 5050:5050 shardlabs/starknet-devnet-rs:0.4.0-seed0
</code></pre>
<p>It's like having a pre-packaged development environment delivered to your door. No assembly required, batteries included.</p>
<h2 id="heading-2-wallet-connection-issues-in-frontend">🔒 2. Wallet Connection Issues in Frontend</h2>
<p><strong>Problem:</strong></p>
<p>Frontend can't detect a Starknet wallet like Argent X or Braavos during development. It's like trying to use your credit card at a lemonade stand – technically possible but not quite set up for it.</p>
<p><strong>Possible Causes:</strong></p>
<ul>
<li><p>Devnet is not compatible with testnet wallets (shocking, I know)</p>
</li>
<li><p>The frontend is connecting to mainnet or testnet while the contracts are on localhost (classic case of "works on my machine" syndrome)</p>
</li>
</ul>
<p><strong>Solution:</strong></p>
<p>Use Starknet.js to manually configure the provider to point to your devnet. Think of it as giving your frontend a GPS that actually knows where localhost is:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">import</span> { RpcProvider } <span class="hljs-keyword">from</span> <span class="hljs-string">"starknet"</span>;

<span class="hljs-keyword">const</span> provider = <span class="hljs-keyword">new</span> RpcProvider({
  <span class="hljs-attr">nodeUrl</span>: <span class="hljs-string">"http://127.0.0.1:5050"</span> <span class="hljs-comment">// or your devnet port</span>
});
</code></pre>
<p>If you're testing wallets, remember devnet does not support injected wallets directly (ArgentX connects to testnet/mainnet), so you must manually manage keys or use a custom signer. It's like being your own bouncer at a party – more work, but you control who gets in.</p>
<p>Preferably use an .env variable <code>RPC_URL</code>.</p>
<hr />
<h2 id="heading-3-contract-deployment-success-but-frontend-fails-to-interact">🧪 3. Contract Deployment Success but Frontend Fails to Interact</h2>
<p><strong>Problem:</strong></p>
<p>Smart contracts deploy correctly, but calls from the frontend fail or return empty responses. It's the digital equivalent of successfully ordering food but the delivery driver getting lost in your driveway.</p>
<p><strong>Possible Causes:</strong></p>
<ul>
<li><p>Incorrect ABI used in frontend (using last week's map for today's road trip)</p>
</li>
<li><p>Wrong contract address (especially common when redeploying) – because apparently contracts don't come with GPS tracking</p>
</li>
<li><p>Waiting for transaction finality not implemented properly (patience, young grasshopper)</p>
</li>
</ul>
<p><strong>Solution:</strong></p>
<ul>
<li><p>Always use the correct and latest ABI in the frontend. Treat your ABI like your morning coffee – fresh is essential.</p>
</li>
<li><p>Store and load the contract address from a .json file or .env (because hardcoding addresses is like writing your password on a sticky note):</p>
</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> contractAddress = process.env.NEXT_PUBLIC_MY_CONTRACT;
</code></pre>
<ul>
<li>Wait for transaction confirmation after deploy/invoke. Blockchain is like a slow-cooking stew – rushing it ruins everything:</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> tx = <span class="hljs-keyword">await</span> contract.invoke(<span class="hljs-string">"doSomething"</span>, [arg]);
<span class="hljs-keyword">await</span> provider.waitForTransaction(tx.transaction_hash);
</code></pre>
<hr />
<h2 id="heading-4-devnet-funded-accounts-not-working">📬 4. Devnet Funded Accounts Not Working</h2>
<p><strong>Problem:</strong></p>
<p>Devnet starts with pre-funded accounts, but transactions still revert due to "not enough funds". It's like being handed monopoly money and wondering why the coffee shop won't accept it.</p>
<p><strong>Possible Causes:</strong></p>
<ul>
<li><p>You're using an address that wasn't pre-deployed (using a fake ID at the bank)</p>
</li>
<li><p>You forgot to declare the contract class (skipping the introductions at a party)</p>
</li>
</ul>
<p><strong>Solution:</strong></p>
<p>When using Devnet, always use one of the pre-deployed accounts shown on start. It's like using the house keys instead of trying to break in through the window:</p>
<pre><code class="lang-bash">starknet-devnet --seed 123 --accounts 3 --initial-balance 100000
</code></pre>
<p>Use a script to fund accounts manually if needed (because sometimes you need to be the bank):</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">await</span> provider.sendTransaction({
  <span class="hljs-attr">sender</span>: funderAddress,
  <span class="hljs-attr">recipient</span>: targetAddress,
  <span class="hljs-attr">amount</span>: <span class="hljs-string">"10000000000000000"</span>
});
</code></pre>
<hr />
<h2 id="heading-5-cairo-contract-changes-not-reflected">🧱 5. Cairo Contract Changes Not Reflected</h2>
<p><strong>Problem:</strong></p>
<p>You updated your Cairo contract but the frontend is still calling the old logic. It's like renovating your house but your GPS still thinks it's the old layout.</p>
<p><strong>Possible Causes:</strong></p>
<ul>
<li><p>Old contract still deployed and being used</p>
</li>
<li><p>ABI in frontend not updated</p>
</li>
<li><p>Devnet not restarted (turning it off and on again – the universal solution)</p>
</li>
</ul>
<p><strong>Solution:</strong></p>
<ul>
<li><p>Any changes to contract requires a fresh contract <code>declare</code> and <code>deploy</code>.</p>
</li>
<li><p>After each deployment, always regenerate <code>abi.json</code> .</p>
</li>
</ul>
<h2 id="heading-6-l1-gas-missing-field-error">🏗️ 6. L1 Gas Missing Field Error</h2>
<p><strong>Problem:</strong></p>
<p>You're getting this cryptic error that sounds like blockchain gibberish:</p>
<pre><code class="lang-bash">Unknown RPC error: JSON-RPC error: code=-32602, message=<span class="hljs-string">"Invalid declare transaction v3: missing field `l1_data_gas`"</span>
</code></pre>
<p>It's like your transaction is missing its ID card at the blockchain border control.</p>
<p><strong>Possible Causes:</strong></p>
<ul>
<li><p>Version mismatch between your tools (the classic "my tools are fighting each other" scenario)</p>
</li>
<li><p>Outdated scarb or snforge versions</p>
</li>
</ul>
<p><strong>Solution:</strong></p>
<p>Check your tool versions:</p>
<pre><code class="lang-bash">asdf list scarb
asdf list snforge
</code></pre>
<p>Set proper versions for your project:</p>
<pre><code class="lang-bash">asdf <span class="hljs-built_in">set</span> scarb [your-version]
asdf <span class="hljs-built_in">set</span> snforge [your-version]
</code></pre>
<p>This creates a <code>.tool-versions</code> file that keeps your project's tools in harmony. Think of it as a peace treaty between your development tools.</p>
<hr />
<h2 id="heading-7-devnet-account-issues-with-argent-wallet">🎭 7. Devnet Account Issues with Argent Wallet</h2>
<p><strong>Problem:</strong></p>
<p>You're trying to use Argent wallet for frontend testing, but it's being more stubborn than a goat.</p>
<p><strong>Solution:</strong></p>
<p><strong>For Adding Accounts:</strong> Just use Argent to add accounts on devnet network from the deployed accounts. It's like introducing your wallet to your local blockchain playground.</p>
<p><strong>For "Private Key Wrong" Errors:</strong> If you get an error about private keys being wrong (which happens more often than we'd like), try backing up and updating your Argent wallet. Sometimes wallets need a little refresh.</p>
<p><strong>For Transaction Errors After Restarting Devnet:</strong> Here's a fun quirk: when you stop and start your devnet server, the accounts on Argent need to be reimported. It's like your wallet has short-term memory loss and forgets about your local blockchain every time you restart it. Just reimport the accounts and you're back in business.</p>
<hr />
<h2 id="heading-8-contract-owner-initialization-issues">👑 8. Contract Owner Initialization Issues</h2>
<p><strong>Problem:</strong></p>
<p>You set up your contract constructor but the ownership is going to some mysterious <code>Universal Deployer</code> instead of where you intended. It's like ordering pizza to your house but it gets delivered to the pizza place itself.</p>
<p><strong>Possible Causes:</strong></p>
<ul>
<li>Using <code>get_caller_address()</code> in constructor, which sets the owner to the Universal Deployer (UD)</li>
</ul>
<p><strong>Solution:</strong></p>
<p>When setting up your constructor, use:</p>
<pre><code class="lang-rust">  <span class="hljs-meta">#[constructor]</span>
  <span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">constructor</span></span>(<span class="hljs-keyword">ref</span> <span class="hljs-keyword">self</span>: ContractState, initial_owner: ContractAddress) {
    <span class="hljs-keyword">self</span>.ownable.initializer(initial_owner);
  }
</code></pre>
<p>Instead of:</p>
<pre><code class="lang-rust">  <span class="hljs-meta">#[constructor]</span>
  <span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">constructor</span></span>(<span class="hljs-keyword">ref</span> <span class="hljs-keyword">self</span>: ContractState, initial_owner: ContractAddress) {
    <span class="hljs-keyword">self</span>.ownable.initializer(get_caller_address());
  }
</code></pre>
<p>The <code>get_caller_address()</code> during deployment returns the Universal Deployer, not your actual address. It's like asking "who's calling?" during a conference call – you might not get the answer you expect.</p>
<p><em>Also note you would need to add the owner address to other constructor arguments.</em></p>
<hr />
<h2 id="heading-9-sncast-invoke-errors-with-arguments">🎯 9. Sncast Invoke Errors with Arguments</h2>
<p><strong>Problem:</strong></p>
<p>Sncast is throwing tantrums when you try to invoke functions with arguments. It's like trying to have a conversation with someone who keeps mishearing what you're saying.</p>
<p><strong>Solution:</strong></p>
<p>Check your call data format carefully. Better yet, use the <code>--arguments</code> flag properly:</p>
<pre><code class="lang-bash">sncast \
  --account some-account \
  invoke \
  --contract-address <span class="hljs-comment">################## \</span>
  --<span class="hljs-keyword">function</span> <span class="hljs-string">"some_function"</span> \
  --url http://127.0.0.1:5050 \
  --arguments <span class="hljs-string">'"arg1", "arg2"'</span>
</code></pre>
<p>Notice the quotes within quotes – it's like Russian nesting dolls, but for command-line arguments.</p>
<hr />
<h2 id="heading-bonus-useful-dev-tools-your-new-best-friends">🧭 Bonus: Useful Dev Tools (Your New Best Friends)</h2>
<ul>
<li><p>🧪 <strong>Starknet Devnet</strong>: Local ZK Rollup for testing smart contracts (your personal blockchain playground)</p>
</li>
<li><p>🧰 <strong>Starknet Foundry (sncast)</strong>: Command line tool for deploying/interacting with contracts (the Swiss Army knife of Starknet)</p>
</li>
<li><p>💡 <strong>Starknet.js</strong>: JavaScript SDK for frontend integration (the translator between your frontend and blockchain)</p>
</li>
</ul>
<hr />
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>Working on Starknet can be immensely rewarding—but getting the frontend to talk to devnet smoothly can be frustrating at first. It's like learning to dance with a partner who keeps changing the steps. With the right setup and understanding of common pitfalls, you'll save yourself hours of debugging and potentially a few gray hairs.</p>
<p>Remember: every expert was once a beginner who refused to give up when their devnet threw its first tantrum. The key is patience, coffee, and the occasional dramatic sigh at your computer screen.</p>
<p>If you're serious about dApp development on Starknet, mastering this local workflow is crucial before moving to testnet or mainnet. Think of it as learning to drive in a parking lot before hitting the highway.</p>
<hr />
<h2 id="heading-related-resources-your-survival-kit">🔗 Related Resources (Your Survival Kit):</h2>
<ul>
<li><p><a target="_blank" href="https://docs.starknet.io/">Starknet Docs</a></p>
</li>
<li><p><a target="_blank" href="https://foundry-rs.github.io/starknet-foundry/">Starknet Foundry</a></p>
</li>
<li><p><a target="_blank" href="https://0xspaceshard.github.io/starknet-devnet/">Starknet Devnet</a></p>
</li>
<li><p><a target="_blank" href="https://www.starknet-react.com/docs/getting-started">Starknet React</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/starknet-io/starknet.js">Starknet.js GitHub</a></p>
</li>
</ul>
<hr />
<p><em>P.S. If you found this helpful, share it with a fellow developer who's currently staring at their screen wondering why their perfectly logical code isn't working. We've all been there.</em></p>
]]></content:encoded></item><item><title><![CDATA[Troubleshooting Setting up Bitcoin and Lightning Node on Apple Silicon (arm64) MacBooks]]></title><description><![CDATA[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 ...]]></description><link>https://blog.laryhills.dev/troubleshooting-setting-up-bitcoin-and-lightning-node-on-apple-silicon-arm64-macbooks</link><guid isPermaLink="true">https://blog.laryhills.dev/troubleshooting-setting-up-bitcoin-and-lightning-node-on-apple-silicon-arm64-macbooks</guid><category><![CDATA[bitcoin-cli]]></category><category><![CDATA[bitcoind]]></category><category><![CDATA[Bitcoin]]></category><dc:creator><![CDATA[Hilary Okoh]]></dc:creator><pubDate>Sat, 10 Feb 2024 03:00:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1706612449060/7c76f0c8-b087-4a7d-8e80-1d9718247d87.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>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.</p>
<h3 id="heading-prerequisites-and-environment-setup">Prerequisites and Environment Setup</h3>
<p>This tutorial assumes you have <code>brew</code> and <code>git</code> installed. Here a few points to note in setting up your environment.</p>
<p>Before anything, we should follow guidelines, and tutorials properly, here is a resource that does justice to installing bitcoin on MacOS <a target="_blank" href="https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md">Install Bitcoin on MacOS</a>.</p>
<p>Run the following command to clone the repo:</p>
<ol>
<li><p><strong>Install Bitcoin with zmq</strong></p>
<p> You should compile <code>bitcoin</code> with zmq as it helps in debugging connections between bitcoin and lightning. To do this make sure <code>zeromq</code> is installed using</p>
<pre><code class="lang-bash"> brew install zeromq
</code></pre>
<p> And then configure bitcoin using this command</p>
<pre><code class="lang-bash"> ./configure --with-zmq --enable-zmq
</code></pre>
</li>
<li><p><strong>Aliases Update:</strong></p>
<p> Always make sure to update your aliases and run</p>
<pre><code class="lang-bash"> <span class="hljs-built_in">source</span> ~/.bash_profile
</code></pre>
<p> To update your current terminal tab.</p>
</li>
</ol>
<h3 id="heading-common-issues-and-solutions"><strong>Common Issues and Solutions</strong></h3>
<ol>
<li><p><strong>Command not found for</strong><code>lnd</code><strong>or</strong><code>lncli</code><strong>:</strong></p>
<p> If the <code>lnd</code> installation was completed and <code>go</code> is installed, and still <code>lnd</code> or <code>lncli</code> command not found, run</p>
<pre><code class="lang-bash"> <span class="hljs-built_in">which</span> go
</code></pre>
<p> should return something like</p>
<pre><code class="lang-bash"> /opt/homebrew/bin/go
</code></pre>
<p> then confirm the go executable path exist by running</p>
<pre><code class="lang-bash"> ls ~/go
</code></pre>
<p> should return</p>
<pre><code class="lang-bash"> bin pkg
</code></pre>
<p> We need to confirm <code>lnd</code> and <code>lncli</code> is part of the go path</p>
<pre><code class="lang-bash"> ls ~/go/bin
</code></pre>
<p> should return</p>
<pre><code class="lang-bash"> lncli lnd
</code></pre>
<p> Now we just copy the executables to default installation location</p>
<pre><code class="lang-bash">  sudo cp ~/go/bin/lnd /usr/<span class="hljs-built_in">local</span>/bin/
  sudo cp ~/go/bin/lncli /usr/<span class="hljs-built_in">local</span>/bin/
</code></pre>
</li>
<li><p><strong>Error Message: `LND setup: unable to create partial chain control: status code: 401, response: ""</strong></p>
<p> This usually rises from when your <code>rpcauth</code> on your <code>bitcoin.conf</code> does not match your <code>rpcuser</code> and <code>rpcpassword</code> in your lnd.conf</p>
<p> Make sure to use the username and password provided when you run this command</p>
<p> <code>python3 ./share/rpcauth/</code><a target="_blank" href="http://rpcauth.py"><code>rpcauth.py</code></a><code>&lt;your-desired-username&gt; &lt;your-password&gt;</code></p>
<p> and place the returned <code>rpcauth</code> in the <code>bitcoin.conf</code>.</p>
</li>
<li><p><strong>Error Message: Unable to connect to &lt;lightingnode-pubkey&gt;@127.0.0.1:9734: EOF</strong></p>
<p> You could get this if you trying to connect to a wrong <code>identity-pubkey</code> of another lightning node.</p>
</li>
<li><p><strong>Error: Bitcoind</strong> <code>testnet</code><strong>is consuming so much space when syncing.</strong></p>
<p> 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 <code>bitcoin.conf</code></p>
</li>
<li><p><strong>Error Message:  error message: Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee.</strong></p>
<p> This happens when connecting two nodes and creating a channel.</p>
<p> A walkaround for this would be adding <code>fallbackfee=0.000001</code> to the <code>bitcoin.conf</code> and restarting <code>bitcoind</code> and <code>lnd</code></p>
<p> So that transactions are quickly added to blocks mined in <code>regtest</code></p>
</li>
<li><p><strong>Error 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</strong></p>
<p> This simply says that your <code>lnd</code> is not talking to your <code>bitcoind</code> properly, meaning they are not on the same mode <code>[regtest, testnet, mainnet]</code></p>
<p> Check your <code>lnd.conf</code> mode and <code>bitcoind</code> with the same mode is running.</p>
</li>
<li><p>Balance not reflecting on <code>regtest</code> or <code>testnet</code></p>
<p> For <code>regtest</code> , you may get</p>
<pre><code class="lang-bash"> {
     <span class="hljs-string">"mine"</span>: {
         <span class="hljs-string">"trusted"</span>: 0.00000000,
         <span class="hljs-string">"untrusted_pending"</span>: 0.00000000,
         <span class="hljs-string">"immature"</span>: 100.00000000
       },
       <span class="hljs-string">"lastprocessedblock"</span>: {
         <span class="hljs-string">"hash"</span>: <span class="hljs-string">"5adf04f4ddbfe4d28e2f4877734a4171f726486e726aee3b2fbc0e6f558fe64f"</span>,
         <span class="hljs-string">"height"</span>: 107
       }
 }
</code></pre>
<p> when you run <code>bitstein-cli getbalances</code></p>
<p> You need to generate some blocks say like <code>100</code> 😀.</p>
<p> For <code>testnet</code> , 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.</p>
</li>
<li><p><strong>Error:</strong><code>lnd</code><strong>console stuck at "Waiting for chain backend to finish sync, start_height"</strong></p>
<p> Just generate a block in using <code>bitcoin-cli generate 1</code> while</p>
</li>
</ol>
<h3 id="heading-conclusion"><strong>Conclusion</strong></h3>
<p>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 <code>bitcoinjs-lib</code>.</p>
<p>If you have any questions, suggestions, or errata to submit, my DMs are open on <a target="_blank" href="https://discord.com/users/736574772141621332">Discord</a>. I hope this helps you on and going as it did for me!</p>
]]></content:encoded></item></channel></rss>