Skip to main content

Connectrum

Stratum (electrum-server) Client Protocol library

Uses python3 to be a client to the Electrum server network. It makes heavy use of asyncio module and newer Python 3 keywords such as await and async.

For non-server applications, you can probably find all you need already in the standard Electrum code and command line.

Features

  • can connect via Tor, SSL, proxied or directly

  • filter lists of peers by protocol, .onion name

  • manage lists of Electrum servers in simple JSON files.

  • fully asynchronous design, so can connect to multiple at once

  • a number of nearly-useful examples provided

  • any call to methods blockchain.address.* is converted into the more modern equivilent blockchain.scripthash.* transparently. Requires pycoin module.

Examples

In examples you will find a number little example programs.

  • cli.py send single commands, plan is to make this an interactive REPL

  • subscribe.py stream changes/events for an address or blocks.

  • explorer.py implements a simplistic block explorer website

  • spider.py find all Electrum servers recursively, read/write results to JSON

Version History

  • 0.8.2 Indicate we support protocol version 1.4.2, StratumClient.protocol_version now string

  • 0.8.1 Handle protocol version reporting correctly, use ‘ping’ msg. (Says we are 1.4)

  • 0.8.0 Support for ElectrumX protocol 1.4 with some helpers to restore useful functions.

  • 0.7.4 Add actual_connection atrribute on StratumClient with some key details

  • 0.7.3 Not sure

  • 0.7.2 Bugfix: port numbers vs. protocols

  • 0.7.1 Python 2.6 compat fix

  • 0.7.0 Reconnect broken server connections automatically (after first connect).

  • 0.6.0 Various pull requests from other devs integrated. Thanks to @devrandom, @ysangkok!

  • 0.5.3 Documents the build/release process (no functional changes).

  • 0.5.2 Make aiosocks and bottom modules optional at runtime (thanks to @BioMike)

  • 0.5.1 Minor bug fixes

  • 0.5.0 First public release.

TODO List

  • be more robust about failed servers, reconnect and handle it.

  • connect to a few (3?) servers and compare top block and response times; pick best

  • some sort of persistant server list that can be updated as we run

  • type checking of parameters sent to server (maybe)?

  • lots of test code

  • an example that finds servers that do SSL with self-signed certificate

  • an example that fingerprints servers to learn what codebase they use

  • some bitcoin-specific code that all clients would need; like block header to hash

Metadata

Release files for connectrum 0.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for connectrum 0.8.2
File Size Uploaded Provenance Actions
connectrum-0.8.2.tar.gz 19.5 kB Without provenance Details for connectrum-0.8.2.tar.gz

Release files / connectrum-0.8.2.tar.gz

Download URL connectrum-0.8.2.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
71ec8c55eae9c6abfcd62f726a5640974508461628121987e93131d466358651
BLAKE2b-256 checksum
How to use checksums
6084d0c7649bddcfbb4fa1f254e8d0ed141a62d2117d583ba73a207ed15d5904
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.15

Security for connectrum 0.8.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page