Bitcoin
This guide will walk you through the process of setting up a Bitcoin regtest network and Fulcrum Electrum server.
the library bitcoin-core.js
uses local bitcoin and electrum node for testing.
Table of Contents
Prerequisites
Bitcoin Core
Fulcrum (latest version)
Basic knowledge of command-line operations
Setting up Bitcoin Core in Regtest Mode
Learn about (Bitcoin Regtest)[https://developer.bitcoin.org/examples/testing.html]
Download and install Bitcoin Core from the official website: https://bitcoincore.org/en/download/
Create a directory for your regtest data:
Configuring Bitcoin Core
Create a configuration file for Bitcoin Core:
Add the following lines to the configuration file:
Save and close the file.
Starting Bitcoin Core in Regtest Mode
Start Bitcoin Core in regtest mode:
Create new wallet
Create a new internal regtest wallet
Using bitcoin-cli
These are some common commands for the cli:
Setting up Fulcrum
Download and compile Fulcrum from the official repository: https://github.com/cculianu/Fulcrum
Follow the compilation instructions in the Fulcrum README.
Configuring Fulcrum
Create a configuration file for Fulcrum:
Add the following lines to the configuration file:
Adjust the paths and credentials as needed.
Starting Fulcrum
Start Fulcrum:
Testing the Setup
Ensure Bitcoin Core is running in regtest mode.
Ensure Fulcrum is running and connected to your Bitcoin Core regtest node.
Use a compatible wallet (e.g., Electrum) to connect to your Fulcrum server (usually at 127.0.0.1:50001).
You should now have a working Bitcoin regtest network with Fulcrum as Electrum server.
Remember to stop both Bitcoin Core and Fulcrum when you're done testing:
This setup allows you to experiment with Bitcoin transactions and smart contracts in a controlled environment without using real Bitcoin or connecting to the main network.
Last updated