Photo by James Harrison on Unsplash

Solving the Localhost & testnet Issues in dApp Development

MSBivens0x
BuildBear Labs
Published in
4 min readOct 5, 2022

--

This is the third and final part of a short series on how BuildBear solves the shortcomings of developing dApps and testing them on either Localhost or Testnets. I went over both of these in Where Localhost Fails and Where Testnets Fail.

I’ll very briefly recap both here. Localhost keeps you stuck on the local machine so your contracts won’t be deployed live for others to interact and test with. This is not a good option if your project is for a hackathon or if you’re on a team. Testnets can solve this issue but you have to sacrifice the control. You lose out on the level of control you can exert over the network when you are on a testnet, like how much test ether you can use for running large and complex transactions.

My answer to both of the articles is BuildBear. BuildBear will let you easily deploy a smart contract so your team can work together to test and interact with your MVP while also exerting far greater control than what you could otherwise achieve with a regular testnet.

I’m going to deploy a smart contract I wrote for a recent hackathon project with BuildBear so we can see what this looks like. This smart contract was written for a decentralized job board that stored job postings on-chain.

Here’s the GitHub repo for this example.

I followed the Getting Started and Deploying with BuildBear guides for setting up the BuildBear network in my hardhat project and deployment.

Now, with my contract deployed I was able to view it on the explorer here. Just like I could with Etherscan, I can write to the contract and run tests to ensure they are successful.

I can read from the contract and verify the information is being submitted and returned how I need it to be.

And reviewing the transactions is simple.

Having the capacity to do all of this and still letting your team able to interact with the same deployed contract is critical during hacks and enterprise-level development, and this is where BuildBear beats out localhost. The explorer will let you search by address, transaction hash, or block number everything you would expect or need from a block explorer but on your own private node.

While some of this can also be done with a normal testnet in combination with a tool like Etherscan, it’s the control that you have with BuildBear that outcompetes testnets. When I was setting up the RPC, I had a number of options to customize the node to my needs.

The forking options let you set custom gas prices, a hard fork from major upgrades throughout Ethereum’s life, and set the chain ID. Your hardhat options ensure you decide how and what can be done like impersonating accounts or setting storage locations or block fees. The EVM options control whether the node will auto mine or revert.

Ultimately, BuildBear lets you can customize each of these options as you fine-tune your node to the exact specifications needed for a robust testing environment and with a dedicated faucet that will let you claim as much test ether as often as you need, there’s no throttling your testing capacity for large and complex transactions.

It’s for these advantages here and more that BuildBear clearly sets itself apart as a private node provider that combines the best of developing on localhost and testnets. Building with your custom node, testing transactions against deployed contracts. and exerting control over the entire ecosystem while letting your whole team participate in this process is key as you look to take your MVPs to the next stage of development.

Until then, you can find us on Twitter and LinkedIn!

--

--