Skip to main content

ElectrumSV RegTest node

Project description

PyPI version Build Status Platforms Node Version

ElectrumSV-Node

The project is intended to provide Python packages for Linux, MacOS and Windows that include and help run pre-built Bitcoin SV executables. It should allow the consistently usable and available ability to run a Bitcoin SV node on any 64-bit platform with the installation of the electrumsv-node package using the standard pip package manager for Python.

These packages and the executables within them, are only intended for running nodes for development as Regtest blockchains. If we had the ability to do so, we would prevent them from running as any other blockchain. Do not bother us with your questions or problems related to non-Regtest usage.

  • You must be using 64-bit Python 3.7, 3.8, 3.9 or 3.10.
  • You must be using Windows, MacOS or Linux.
  • You must have the latest version of the pip package.

To update pip:

> python3 -m pip install --upgrade pip

To install electrumsv-node:

> pip3 install electrumsv-node

To use it:

import logging
import electrumsv_node

# Set logging level to debug mode to see logging information (Optional)
logging.basicConfig(
    format="%(asctime)s %(levelname)s %(message)s",
    level=logging.DEBUG,
    datefmt="%Y-%m-%d %H-%M-%S",
)
logger = logging.getLogger("testing")

electrumsv_node.start()

# (Optional keyword arguments)
# electrumsv_node.start(
#     data_path=</your/custom/datadir/path>,
#     rpcuser="rpcuser",
#     rpcpassword="rpcpassword",
#     rpcport=18332,
#     p2p_port=18444,
#     zmq_port=28332,
#     network='regtest',
#     print_to_console=True,  # feeds logging to stdout
#     extra_params=['-somearg1=var1', '-somearg2=var2']
# )

result = electrumsv_node.call_any('getinfo')
logger.debug(result.json())
electrumsv_node.stop()
electrumsv_node.reset()

Console output will look something like this (with custom data directory):

2021-01-03 11-50-29 INFO starting bitcoin node
2021-01-03 11-50-29 DEBUG polling bitcoin node...
2021-01-03 11-50-31 DEBUG polling bitcoin node...
2021-01-03 11-50-32 INFO bitcoin node online
2021-01-03 11-50-32 DEBUG {'result': {'version': 101000600, 'protocolversion': 70015, 'walletversion': 160300, 'balance': 0.0, 'blocks': 0, 'timeoffset': 0, 'connections': 0, 'proxy': '', 'difficulty': 4.656542373906925e-10, 'testnet': False, 'stn': False, 'keypoololdest': 1609627830, 'keypoolsize': 2000, 'paytxfee': 0.0, 'relayfee': 2.5e-06, 'errors': 'This is a pre-release or beta test build - use at your own risk - do not use for mining or merchant applications', 'maxblocksize': 10000000000, 'maxminedblocksize': 128000000, 'maxstackmemoryusagepolicy': 100000000, 'maxstackmemoryusageconsensus': 9223372036854775807}, 'error': None, 'id': 0}
2021-01-03 11-50-32 DEBUG stopping bitcoin node
2021-01-03 11-50-32 INFO bitcoin daemon stopped.
2021-01-03 11-50-32 DEBUG resetting state of RegTest bitcoin daemon...
2021-01-03 11-50-32 ERROR the bitcoin daemon must be shutdown to reset - retrying in 3 seconds
2021-01-03 11-50-35 DEBUG removed 'C:\Users\donha\AppData\Local\ElectrumSV-Node' successfully

The node data directory

By default, the node will be started with a data directory in a standard location. On Windows this will be within ElectrumSV-Node in the computer's LOCALAPPDATA directory, which will likely be c:\users\<user-name>\AppData\Local. On MacOS and Linux this will be within .electrumsv-node in the user's home directory, which will likely be something like /home/<user-name> on Linux or /Users/<user-name> on MacOS.

ElectrumSV and ElectrumSV-Node

This is part of a wider effort to provide a first class RegTest development environment experience with the ElectrumSV stack (which includes ElectrumX). It is expected that for these purposes, the ElectrumSV-SDK project will be the way that developers will make use of ElectrumSV-Node.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

electrumsv_node-0.0.27-cp310-cp310-win_amd64.whl (10.4 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

electrumsv_node-0.0.27-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

electrumsv_node-0.0.27-cp310-cp310-macosx_10_9_x86_64.whl (8.1 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

electrumsv_node-0.0.27-cp39-cp39-win_amd64.whl (10.4 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

electrumsv_node-0.0.27-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

electrumsv_node-0.0.27-cp39-cp39-macosx_10_9_x86_64.whl (8.1 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

electrumsv_node-0.0.27-cp38-cp38-win_amd64.whl (10.4 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

electrumsv_node-0.0.27-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

electrumsv_node-0.0.27-cp38-cp38-macosx_10_9_x86_64.whl (8.1 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

electrumsv_node-0.0.27-cp37-cp37m-win_amd64.whl (10.4 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

electrumsv_node-0.0.27-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

electrumsv_node-0.0.27-cp37-cp37m-macosx_10_9_x86_64.whl (8.1 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page