Local Development
EVM and Bitcoin
EVM Setup
If you are developing on the BOB network, you need to install a wallet and a development environment.
Install a wallet
You can also use other EVM wallets. BOB has a special Snap though so that you can use MetaMask for both the BOB chain and Bitcoin.
Install a development environment
- Foundry (based on Rust)
- Hardhat (based on TypeScript)
Quickstart:
# Install foundry
curl -L https://foundry.paradigm.xyz | bash
# Init a new project
forge init hello_bob
cd hello_bob
# Build the project
forge build
# Start a local chain
anvil
Check the docs for more information: Foundry.
Quickstart:
# Install hardhat
yarn add --dev hardhat
# Init a new project
npx hardhat init
Check the docs for more information: Hardhat.
Bitcoin
Install
Install Bitcoin Core 25.0
or higher so that you have access to the bitcoind
and bitcoin-cli
commands:
- MacOS:
brew install bitcoin
- Ubuntu:
sudo add-apt-repository ppa:bitcoin/bitcoin && sudo apt-get update && sudo apt-get install bitcoind
- Arch:
yay bitcoin-core
- Download a binary: https://bitcoin.org/en/download
Start Bitcoin Core
# Start a regtest node
bitcoind -regtest
# Create a wallet named Alice
bitcoin-cli -regtest createwallet alice
# Get a new address for Alice
ADDRESS=$(bitcoin-cli -regtest -rpcwallet=alice getnewaddress)
# Mine 101 blocks to the address
bitcoin-cli -regtest -rpcwallet=alice generatetoaddress 101 $ADDRESS
Wallet
You can use bitcoin-cli
to manage the wallet. However, if you prefer a UI, you can use Bitcoin QT.
Start Bitcoin QT (for wallet functionality):
bitcoin-qt -regtest