Drop altcoin pip extras, CI deps and docs; update CLAUDE.md and FORK.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
davideandClaude Sonnet 5.5 committed 2026-10-22 15:03:56 +02:00
1 parent 05f5fc9058
commit 137eb78f45
7 files changed
+15 -37

No files matched your search

+1 -4
View File
@@ -1,4 +1 @@
<!-- Note: Our primary focus is supporting Bitcoin, and contributions in that regard are appreciated the most! <!-- Note: this fork supports Palladium (PLM) only. Add a unit test for new behavior and make sure the CI tests pass. -->
Due to historical reasons, ElectrumX also has support for many altcoins. These will be kept as long as
maintenance burden can be kept *at a minimum*. When adding a new altcoin, (1) add a unit test (see tests/blocks),
and (2) make sure the CI tests pass. -->
-12
View File
@@ -46,18 +46,6 @@ jobs:
# e-x itself # e-x itself
# - install both leveldb and rocksdb bindings # - install both leveldb and rocksdb bindings
pip install ".[leveldb,rocksdb]" pip install ".[leveldb,rocksdb]"
# hashes and other altcoin-specific stuff
pip install tribushashm
pip install blake256
pip install dash_hash
pip install git+https://github.com/bitcoinplusorg/x13-hash
pip install xevan_hash
pip install quark_hash
pip install groestlcoin_hash
pip install x16r_hash
pip install pycryptodomex
pip install git+https://github.com/Electra-project/nist5_hash
pip install x16rv2_hash
- name: Run pytest - name: Run pytest
run: pytest --cov=electrumx run: pytest --cov=electrumx
+6 -6
View File
@@ -4,12 +4,12 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Project ## Project
ElectrumX 2.0.x (PyPI/package name `e-x`, import name `electrumx`): an Electrum-protocol server (asyncio) that indexes a coin daemon (bitcoind-like) into a local DB (LevelDB or RocksDB). This repo is a fork meant to be adapted to a custom coin; upstream is `spesmilo/electrumx`. Keep changes localized (mainly `src/electrumx/lib/coins.py`) so upstream merges stay easy. MIT license: keep `LICENCE`. `plm-electrumx`: a fork of ElectrumX 2.0.x (package name `e-x`, import name `electrumx`), an Electrum-protocol server (asyncio) that indexes a coin daemon into a local DB (LevelDB or RocksDB), supporting **Palladium (PLM) only**. All other coins and their code were removed (see `FORK.md` for the upstream base commit and how to merge upstream). Keep changes to core files small so upstream merges stay easy. MIT license: keep `LICENCE`.
## Commands ## Commands
```bash ```bash
pip install -e ".[leveldb,rocksdb]" # at least one DB engine extra is required; altcoin hash libs are extras too pip install -e ".[leveldb,rocksdb]" # at least one DB engine extra is required
pip install pytest pytest-asyncio pytest-cov pycodestyle pip install pytest pytest-asyncio pytest-cov pycodestyle
pytest # all tests (what CI runs, with --cov=electrumx) pytest # all tests (what CI runs, with --cov=electrumx)
@@ -18,7 +18,7 @@ pytest tests/server/test_mempool.py::test_name # single test
pycodestyle --max-line-length=140 src # the only lint, enforced in CI pycodestyle --max-line-length=140 src # the only lint, enforced in CI
cd docs && make html # docs (Sphinx) cd docs && make html # docs (Sphinx)
DB_ENGINE=rocksdb COIN=Bitcoin DB_DIRECTORY=... DAEMON_URL=http://user:pass@host:port/ electrumx_server DB_ENGINE=rocksdb DB_DIRECTORY=... DAEMON_URL=http://user:pass@host:port/ electrumx_server
electrumx_rpc getinfo # talk to a running server via local RPC electrumx_rpc getinfo # talk to a running server via local RPC
``` ```
@@ -28,12 +28,12 @@ Configuration is entirely via environment variables, parsed in `src/electrumx/se
Pipeline (see `docs/architecture.rst`): `Env` → `Controller` (`server/controller.py`) wires together `Daemon` (RPC client to the coin node, `server/daemon.py`), `BlockProcessor` (`block_processor.py`, indexes blocks/handles reorgs, writes via `db.py`/`history.py`/`storage.py`), `MemPool` (`mempool.py`), `SessionManager`/`ElectrumX` sessions (`session.py`, the only place that knows the Electrum wire protocol and its versions), and `PeerManager` (`peers.py`). `Notifications` in `controller.py` merges block and mempool "touched" hashXs/outpoints so clients are not notified twice. Pipeline (see `docs/architecture.rst`): `Env` → `Controller` (`server/controller.py`) wires together `Daemon` (RPC client to the coin node, `server/daemon.py`), `BlockProcessor` (`block_processor.py`, indexes blocks/handles reorgs, writes via `db.py`/`history.py`/`storage.py`), `MemPool` (`mempool.py`), `SessionManager`/`ElectrumX` sessions (`session.py`, the only place that knows the Electrum wire protocol and its versions), and `PeerManager` (`peers.py`). `Notifications` in `controller.py` merges block and mempool "touched" hashXs/outpoints so clients are not notified twice.
Coin abstraction is the key extension point: `lib/coins.py` defines `Coin` and a large hierarchy of subclasses. A coin class selects behavior through class attributes: `DESERIALIZER` (block/tx format, in `lib/tx.py`, `tx_dash.py`, `tx_axe.py`), `DAEMON`, `BLOCK_PROCESSOR`, `SESSIONCLS`, address verbytes, `GENESIS_HASH`, `REORG_LIMIT`, `RPC_PORT`, `PEERS`, header handling, etc. Coins are discovered by walking `Coin` subclasses (`lookup_coin_class` matches `NAME` + `NET`), so a new coin is just a new subclass; non-final classes are abstract bases with `NET = None`. Concrete classes must define `TX_COUNT`, `TX_COUNT_HEIGHT`, `TX_PER_BLOCK` (used only for sync ETAs) or lookup raises. Coin abstraction: `lib/coins.py` defines `Coin` and the `Palladium`, `PalladiumTestnet`, `PalladiumRegtest` subclasses. A coin class selects behavior through class attributes: `DESERIALIZER` (block/tx format, in `lib/tx.py`, only the segwit one remains), `DAEMON`, `BLOCK_PROCESSOR`, `SESSIONCLS`, address verbytes, `GENESIS_HASH`, `REORG_LIMIT`, `RPC_PORT`, `PEERS`, header handling, etc. Coins are discovered by walking `Coin` subclasses (`lookup_coin_class` matches `NAME` + `NET`; `COIN` defaults to `Palladium`). Concrete classes must define `TX_COUNT`, `TX_COUNT_HEIGHT`, `TX_PER_BLOCK` (used only for sync ETAs) or lookup raises.
Daemon requirements: for `COIN=Bitcoin`, Bitcoin Core >= 31 with `txindex=1` and `txospenderindex=1` is required (for `blockchain.outpoint.subscribe`); see `MIN_REQUIRED_DAEMON_VERSION` and `REQUIRED_DAEMON_INDEXES` on `Coin`. A custom coin on an older node must override these and the outpoint-subscribe path. Daemon: Palladium Core is based on Bitcoin Core 0.19: no `getindexinfo`, `txospenderindex` or `submitpackage`. So `MIN_REQUIRED_DAEMON_VERSION`/`REQUIRED_DAEMON_INDEXES` (see `Coin`) are unset, and `blockchain.outpoint.subscribe` / `blockchain.transaction.broadcast_package` return a daemon error to clients. The daemon needs `txindex=1`.
DB schema changed in 2.0 with no migration; changing on-disk format requires a full resync. DB schema changed in 2.0 with no migration; changing on-disk format requires a full resync.
## Tests ## Tests
`tests/lib` (coins, tx deserializers, hashes, scripts), `tests/server` (env, daemon, mempool, storage, API), plus fixture-driven `tests/test_blocks.py` / `test_transactions.py` using JSON files in `tests/blocks` and `tests/transactions` (add a fixture there when adding a coin with a custom deserializer). `tests/lib` (Palladium params, addresses, hashes, scripts), `tests/server` (env, daemon, mempool, storage, API), plus fixture-driven `tests/test_blocks.py` / `test_transactions.py` using JSON files named `<coin>_<net>_<id>.json` in `tests/blocks` and `tests/transactions` (real mainnet data from a synced node; tx vout values in satoshis). `test_storage.py` needs both DB engines installed. Bech32 addresses are not supported by `Coin.address_to_hashX` (base58 only).
+7
View File
@@ -24,6 +24,13 @@ changes are made in the commits after it:
Palladium changes are kept small and localized (mainly the `Palladium*` classes at the end of Palladium changes are kept small and localized (mainly the `Palladium*` classes at the end of
`src/electrumx/lib/coins.py`) to keep these merges easy. `src/electrumx/lib/coins.py`) to keep these merges easy.
## Removed from upstream
All other coins: their classes in `coins.py`, their transaction deserializers (`lib/tx.py`,
`tx_dash.py`, `tx_axe.py`), the session/daemon/block-processor subclasses only they used, their
tests and fixtures, and the altcoin pip extras. `Bitcoin` was folded into `Palladium`.
When merging upstream, resolve modify/delete conflicts on these files by keeping them deleted.
## Palladium specifics ## Palladium specifics
- Palladium Core is based on Bitcoin Core 0.19. It has no `getindexinfo`, `txospenderindex` or - Palladium Core is based on Bitcoin Core 0.19. It has no `getindexinfo`, `txospenderindex` or
-6
View File
@@ -23,11 +23,6 @@ DB Engine A database engine package is required; two are
supported (see `Database Engine`_ below). supported (see `Database Engine`_ below).
================ ======================== ================ ========================
Some coins need an additional package, typically for their block hash
functions. For example, `dash_hash`_ is required for DASH. Scrypt coins
require a Python interpreter compiled and/or linked with OpenSSL 1.1.0
or higher.
You **must** be running a non-pruning bitcoin daemon with:: You **must** be running a non-pruning bitcoin daemon with::
txindex=1 txindex=1
@@ -456,6 +451,5 @@ You can then set the port as follows and advertise the service externally on the
.. _`daemontools`: http://cr.yp.to/daemontools.html .. _`daemontools`: http://cr.yp.to/daemontools.html
.. _`runit`: http://smarden.org/runit/index.html .. _`runit`: http://smarden.org/runit/index.html
.. _`aiohttp`: https://pypi.python.org/pypi/aiohttp .. _`aiohttp`: https://pypi.python.org/pypi/aiohttp
.. _`dash_hash`: https://pypi.python.org/pypi/dash_hash
.. _`contrib/raspberrypi3/install_electrumx.sh`: https://github.com/spesmilo/electrumx/blob/master/contrib/raspberrypi3/install_electrumx.sh .. _`contrib/raspberrypi3/install_electrumx.sh`: https://github.com/spesmilo/electrumx/blob/master/contrib/raspberrypi3/install_electrumx.sh
.. _`contrib/raspberrypi3/run_electrumx.sh`: https://github.com/spesmilo/electrumx/blob/master/contrib/raspberrypi3/run_electrumx.sh .. _`contrib/raspberrypi3/run_electrumx.sh`: https://github.com/spesmilo/electrumx/blob/master/contrib/raspberrypi3/run_electrumx.sh
+1 -1
View File
@@ -22,7 +22,7 @@ Features
ElectrumX will failover round-robin style if the current one fails ElectrumX will failover round-robin style if the current one fails
for any reason. for any reason.
- Peer discovery protocol removes need for IRC - Peer discovery protocol removes need for IRC
- Coin abstraction makes compatible altcoin and testnet support easy. - Coin abstraction makes testnet support easy.
Implementation Implementation
============== ==============
-8
View File
@@ -62,11 +62,3 @@ orjson = [
uvloop = [ uvloop = [
"uvloop>=0.14", "uvloop>=0.14",
] ]
# For various altcoins
blake256 = ["blake256>=0.1.1", ]
crypto = ["pycryptodomex>=3.8.1", ]
groestl = ["groestlcoin-hash>=1.0.1", ]
tribushashm = ["tribushashm>=1.0.5", ]
xevan-hash = ["xevan-hash", ]
dash_hash = ["dash_hash>=1.4", ]
zny-yespower-0-5 = ["zny-yespower-0-5", ]