Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update testnet genesis #2

Open
wants to merge 269 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
269 commits
Select commit Hold shift + click to select a range
7a989ad
Remove get_chunk restriction
Feb 22, 2018
2f26b73
Reenable nightly but without coverage (#383)
bauerj Feb 22, 2018
6add2e5
Add custom base58check algorithm (#389)
erasmospunk Feb 27, 2018
4f871ce
Feathercoin: Fix P2SH (#391)
lclc Mar 1, 2018
49ee008
Relax the constraints on read_headers
Mar 3, 2018
7823129
Clarify truncation behaviour of get_chunk in docs
Mar 3, 2018
5109990
Add blockchain.block.headers RPC call
Mar 3, 2018
5f5c599
Add example response to docs
Mar 3, 2018
adf8113
typos in PROTOCOL.rst (#394)
SomberNight Mar 4, 2018
19e0f9b
Add Denarius (DNR) (#396)
metaspartan Mar 5, 2018
5f38908
Bitcoin Cash: remove dead server
Mar 6, 2018
62220f6
Remove dead code left over from prior
Mar 6, 2018
a3da48e
Fix daemontools run script for dash shell
Mar 6, 2018
521227c
coin is on the controller, unfortunately
Mar 6, 2018
d5d5df5
electrum_server: set logging format (#398)
romanz Mar 6, 2018
824dc76
Add coin SNG (#400)
Mar 6, 2018
cf49b73
Enable verbose mode in blockchain.transaction.get (#397)
gdassori Mar 7, 2018
28531bb
Initial attempt at Sphinx documentation
Mar 7, 2018
fe37b47
More work on sphinx docs
Mar 7, 2018
d8d2515
More work on sphinx docs
Mar 7, 2018
a10ff97
More sphinx doc work.
Mar 7, 2018
70dfaa8
More sphinx work
Mar 8, 2018
9eee1c8
Finish protocol documentation switch
Mar 8, 2018
c1bf4eb
Move changelog to separate file.
Mar 8, 2018
c517c1d
Fix some markup
Mar 8, 2018
bab8d9f
Add server.ping RPC call
Mar 8, 2018
0654d96
Remove logger name from logs
Mar 8, 2018
47f65ff
Add raw header subscriptions.
Mar 8, 2018
a3793a1
Add a link to the github repo.
Mar 8, 2018
bfca87d
Release 1.3
Mar 8, 2018
77f0a3d
Documentation updates
Mar 8, 2018
1e6b30f
Litecoin: fix BIP32 version bytes (#404)
pooler Mar 8, 2018
c262274
Add Decred(DCR) (#402)
cipherzzz Mar 8, 2018
96b5c5e
Improve documentation of the RPC interface
Mar 8, 2018
9d6ddfb
Change RPC testnet port and remove invalid assert (#405)
cipherzzz Mar 8, 2018
e426b66
Show example of RPC peers output
Mar 8, 2018
569b81a
Fix doc typo
Mar 8, 2018
be4036b
Tweak peers docs
Mar 8, 2018
7f08cdf
Typo edit (#407)
gdassori Mar 8, 2018
b5e97b6
Log supported protocol versions
Mar 9, 2018
5e3ab51
Suffix a + to version post-release
Mar 9, 2018
e2f1864
Update peer discovery notes
Mar 9, 2018
ebc83b4
Import peers in main_loop
Mar 10, 2018
80fc334
Switch to aiorpcX for SOCKS proxying.
Mar 10, 2018
d2e6f7d
Log from Peer Manager directly
Mar 10, 2018
f621043
Update travis
Mar 10, 2018
e8e5b3b
Fix doc typo
Mar 11, 2018
60761b3
Make some EnvBase methods class methods
Mar 12, 2018
4ec8502
Add LOG_FORMAT envvar to control logging format.
Mar 12, 2018
74bc80f
Revert "Log from Peer Manager directly"
Mar 12, 2018
19565a1
Fix small typo in server/db.py (#412)
Mar 12, 2018
fe0f109
bitbayd rawblock newer daemon (#410)
GiorgosK Mar 12, 2018
0f4f51d
Changes for BTG (#409)
wilsonmeier Mar 13, 2018
c11ad5d
Bump to aiorpcX version 0.4.4
Mar 13, 2018
4707e97
Update ssl_port and tcp_port to what peer advertises
Mar 14, 2018
e577172
Improve HOWTO markup
Mar 16, 2018
0e7cd49
More improvements to HOWTO.rst
Mar 16, 2018
3ac2e82
Add arihanc to various coins (#416)
Mar 17, 2018
8b669b6
update koto server (#422)
wakiyamap Mar 23, 2018
991ddf1
update monacoin server (#421)
wakiyamap Mar 23, 2018
b33cf8b
modify SnowGem header (#427)
TENTOfficial Mar 25, 2018
8c54111
Improve envvar docs
Mar 26, 2018
ebfe93e
Lower case doc files
Mar 26, 2018
1b65bd8
attr->envvar for NET
Mar 26, 2018
81141eb
Proxy detection improvements
Mar 26, 2018
a2635f4
Bump reported version to 1.3.1
Mar 26, 2018
c1ba211
Remove code appropriate for future aiorpcX
Mar 26, 2018
a1802b4
add AXE support (#429)
charlesrocket Mar 30, 2018
02ab8e5
Add block tests for DASH (#431)
thelazier Mar 30, 2018
90f2831
Add DROP_CLIENT env variable (#432)
erasmospunk Apr 4, 2018
0ef6267
mod fujicoin SegWit (#435)
fujicoin Apr 4, 2018
e69b1d9
Convert PeerSession to use aiorpcX
Mar 11, 2018
8043069
Use aiorpcx in electrumx_rpc script
Mar 16, 2018
bc6093a
Fully integrate aiorpcX
Mar 26, 2018
381593f
Update BCH servers
Apr 7, 2018
fbf0ec4
Update BitcoinSegwit peers
Apr 7, 2018
4155529
Fix group consolidation logic
Apr 8, 2018
e92c9bd
ElectrumX 1.4
Apr 8, 2018
837bea2
Remove controller.groups
Apr 8, 2018
34c45e6
Remove down / obsolete servers
Apr 8, 2018
8bf30fb
Move server/version.py to Controller class
Apr 8, 2018
fec2ee1
Set PROTOCOL_MIN to 1.0
Apr 8, 2018
4eebf42
Cleaner shutdown
Apr 9, 2018
f54c4e6
Resolve address locally if proxy and not tor
Apr 9, 2018
142aa48
Release 1.4.2
Apr 9, 2018
1a0eea2
ElectrumX 1.4.3
Apr 9, 2018
0dc99d7
Fix RPCError import
Apr 10, 2018
dc309d3
Feathercoin activated SegWit (#447)
lclc Apr 10, 2018
3bedef6
indent fix (#449)
you21979 Apr 11, 2018
d586a74
Fix doc build
Apr 12, 2018
ec25656
Force close stale sessions that aren't closing
Apr 12, 2018
a858b3f
fix height is not define (#450)
wakiyamap Apr 13, 2018
46f2458
Point to readthedocs
Apr 13, 2018
7ef6e78
Add NewYorkCoin testnet in coins.py (#452)
nicovs Apr 18, 2018
3749900
Fix bitzeny params and header (#453)
wakiyamap Apr 18, 2018
acb1815
Update the roadmap
Apr 22, 2018
55e060c
RPC member is 'message' not 'msg'
Apr 24, 2018
ee7e536
Fix small typo in protocol-basics.rst (#462)
May 4, 2018
e5cd5f3
Add Uniform Fiscal Object (UFO) (#463)
Bushstar May 5, 2018
a7a8a1b
add GameCredits (GAME) (#467)
cipig May 12, 2018
9877e1f
added Machinecoin (MAC) (#470)
Nico205 May 18, 2018
c813918
Add version to the getinfo result (#471)
erasmospunk May 18, 2018
56de4de
Adding Xuez Coin (#472)
ddude1 May 19, 2018
77051f8
Make HASHX_LEN a global, not a coin property
May 22, 2018
5d22e27
Add .pytest_cache to .gitignore
May 22, 2018
5e1ed3f
Separate history management into its own object
May 21, 2018
e88b8c0
Update compaction test
May 25, 2018
e0186d7
Move clean_db() logic to when hist DB is opened
May 26, 2018
8d42c23
Update for Zcash v3 tx (#475)
wo01 May 26, 2018
379fef1
Update coins.py (#477)
SuBPaR42 May 26, 2018
7d9ffbb
Minimum supported protocol version is 1.1
May 29, 2018
6241565
Merge remote-tracking branch 'upstream/master'
ryan-shaw May 31, 2018
69754a6
Be more careful closing history DB
Jun 2, 2018
6928b25
Change COIN to BitcoinSegwit (#486)
sangaman Jun 3, 2018
52658cf
Set the shutdown event via call_soon
Jun 4, 2018
b993bd8
Rename protocol_version_string to version_string
Jun 4, 2018
2559751
Display aiorpcX version on startup
Jun 4, 2018
7baf6cf
Add $PAC (#474)
elmora-do Jun 6, 2018
653b84e
Update BitcoinCash metadata
Jun 6, 2018
0646d87
update version aiorpcx (#490)
wakiyamap Jun 8, 2018
93ee197
Add Koto testnet (#491)
wo01 Jun 9, 2018
e29b692
Fix typo
Jun 10, 2018
46adf54
Enforce pycodestyle in server/
Jun 10, 2018
23e484b
Enforce pycodestyle in lib/
Jun 10, 2018
50e2785
Update masternode doc and masternode_list rpc method (#493)
elmora-do Jun 12, 2018
b21987f
Hardcoded username directory replaced with ~ (#494)
DaShak Jun 14, 2018
4ae6af6
Fix typo (contributed by gabriel-samfira)
Jun 17, 2018
f968a45
Added working DASH Testnet server. (#501)
ser Jun 24, 2018
068e230
Add mainnet, testnet and regtest peers for BTG (#500)
wilsonmeier Jun 24, 2018
2cb8981
Force verbose to be a boolean (#503)
Jun 26, 2018
93e4b1f
Add Polis, ColossusXT, GoByte, Monoeci (#504)
eabz Jul 2, 2018
38d045c
librocksdb is unauthenticated
Jul 2, 2018
32b461a
Fix underscore length
Jul 4, 2018
8388969
Document status when tx list empty.
Jul 4, 2018
cc36935
Fix link
Jul 4, 2018
f2f19ae
Cast verbose to int for daemon RPC
Jul 4, 2018
e425b60
Remove decred - mainnet fails to sync
Jul 4, 2018
1e763b7
Check docs (#509)
Jul 5, 2018
2928900
electrumx package (#511)
eukreign Jul 9, 2018
ddae007
+ BitcoinCashRegtest coin class (#512)
eukreign Jul 10, 2018
4511189
make it easier to configure logging for electrumx (#514)
eukreign Jul 10, 2018
c28b5af
Export Controller and Env from the package (#515)
Jul 10, 2018
f8ebcf3
Env accepts custom Coin class (#517)
eukreign Jul 11, 2018
71b3d30
Server listening (#516)
eukreign Jul 11, 2018
c35ac6d
Deprecate blockchain.block.get_header as of protocol 1.3
Jul 11, 2018
4171e58
Use version directly
Jul 11, 2018
26206fd
Drop the .py suffix from electrumx_server & electrumx_rpc
Jul 11, 2018
7911f0d
Remove blockchain.address.* methods from protocol 1.3+
Jul 12, 2018
029d943
Update .gitignore
Jul 12, 2018
7c82d1f
blockchain.headers.subscribe: raw defaults to True in 1.3
Jul 12, 2018
3063dec
Document removed metohds in new file
Jul 12, 2018
30680bf
More doc updates
Jul 12, 2018
9534a83
Log class name only from server script
Jul 12, 2018
d51f98e
Create and use class_logger() utility function
Jul 12, 2018
8a4f9e2
Prepare 1.5
Jul 12, 2018
40db883
Minor doc tweaks
Jul 12, 2018
70c81ab
Add a note to 1.5 release notes
Jul 12, 2018
2cfcbc0
Remove some old history from the changelog
Jul 12, 2018
9f43fb8
Tweak setup.py
Jul 12, 2018
02fb534
Don't import version in setup.py
Jul 13, 2018
cd85a49
Use our own logging, not aiorpcX's
Jul 13, 2018
9d02b03
Log Python interpreter version on startup
Jul 13, 2018
d2e8fe7
Update peer discovery code for protocol 1.3
Jul 13, 2018
27f1c24
Update BCH peers
Jul 13, 2018
e1e4129
Prepare 1.5.1
Jul 13, 2018
70f8d7c
Partial reversion of 2cb89814b6c8df2d2e19f0a2192c2c7216964140
Jul 14, 2018
af45363
Add merkle library with tests
Jul 14, 2018
c22b7d4
Have server code use merkle library
Jul 14, 2018
3c3a1b7
Fix thinko in prior
Jul 14, 2018
73a46df
Remove hash_to_str
Jul 14, 2018
997a1be
Prepare 1.5.2
Jul 14, 2018
4168341
Implement a markle cache with tests
Jul 14, 2018
26d8026
Increase merkle cache test coverage to 100%
Jul 16, 2018
d390b38
Add cache truncation and tests
Jul 16, 2018
0ee2797
Update documentation for protocol 1.4
Jul 16, 2018
2088417
Remove raw argument to blockchain.headers.subscribe
Jul 16, 2018
46d8e0c
Implement merkle proofs for blockchain.block.header
Jul 16, 2018
061cac5
Implement merkle proof for blockchain.block.headers
Jul 16, 2018
3624997
Prepare 1.6pre1
Jul 16, 2018
e5ea1c1
Update docs for raw headers.
Jul 16, 2018
8630c91
Have the header merkle cache handle reorgs
Jul 16, 2018
382fc5e
Improve logging of client version requests
Jul 16, 2018
5ba5d05
Protocol 1.4: only accept a single server.version message
Jul 16, 2018
fdb34e7
Store session's protocol version as a tuple, not string
Jul 17, 2018
c790fd5
Move things from Controller to session class
Jul 17, 2018
739bb68
Convert PROTOCOL_MIN, PROTOCOL_MAX to tuples
Jul 17, 2018
4f99f25
Move scripthash handlers from controller to session
Jul 17, 2018
3dbc10b
Move address handlers from controller to session
Jul 17, 2018
ca777ed
Move three more methods from the controller to session
Jul 17, 2018
063f1b2
Move block_get_header and estimate_fee to session
Jul 17, 2018
c35c062
Move more code to session class from controller
Jul 17, 2018
e41d1db
Create SessionManager class
Jul 17, 2018
0b55a3f
Mark as pre2
Jul 17, 2018
a3d3bbe
Move more code out of controller to sessions
Jul 17, 2018
c712d4b
Fix session_count invocation
Jul 17, 2018
c7f6f3e
Move get_utxos to session
Jul 17, 2018
60435c0
Fix peer discovery for protocol >= 1.4
Jul 17, 2018
c7f3f7a
new protocol method: blockchain.transaction.id_from_pos (#524)
SomberNight Jul 18, 2018
c8c896a
Minor tweaks.
Jul 18, 2018
b7572ce
More refactoring of controller
Jul 18, 2018
9cf3b53
Move raw_header to session manager
Jul 18, 2018
22b01d4
Move masternode cache.
Jul 18, 2018
53425ce
Move task logic to Tasks object
Jul 18, 2018
391e69b
Introduce ChainState object
Jul 18, 2018
f5926cf
Label as 1.6pre3
Jul 18, 2018
7ce91b1
Minor tweaks
Jul 18, 2018
813fc09
Use JSON RPC terms in docs, not Python
Jul 18, 2018
94d1f7a
Save raw blocks to disk for reorg purposes
Jul 18, 2018
049017a
Fix doc linkage
Jul 18, 2018
023e463
Prepare 1.6
Jul 19, 2018
2276966
Added Motion Coin mainnet (#528)
Jul 19, 2018
a019656
Make it clear where BlockProcessor is instantiated
Jul 19, 2018
bd636a7
Clean up the process of opening the DBs, make asynchronous
Jul 19, 2018
41e734c
Clean up controller interface with other parts
Jul 20, 2018
530c7ca
Clean up shutdown process of the block processor
Jul 20, 2018
431989f
Label 1.6a
Jul 20, 2018
ca3ba2b
Rework mempool and BP<->prefretcher communication
Jul 20, 2018
8e99d07
Logging tweaks
Jul 20, 2018
0c28136
Remove dead code
Jul 20, 2018
f7c9598
Fix failing test
Jul 20, 2018
74c5c3f
Don't accept onion peers if we have no proxy
Jul 20, 2018
6cf7b04
Require aiohttp >= 2.0
Jul 21, 2018
3e8c413
In ChainState prepend private members with an underscore
Jul 20, 2018
c715ae6
Rework mempool and notification code
Jul 21, 2018
e568ee2
Improve comments
Jul 21, 2018
277e244
Fix the package versions in setup.py
Jul 21, 2018
35506f6
Make notifications properly async
Jul 22, 2018
a9a69ac
Pass the daemon not chain_state to mempool constructor
Jul 22, 2018
2c51b12
Clarify mempool's exported interface
Jul 22, 2018
821f907
Put stats logging into its own task
Jul 22, 2018
4da95dd
Simplify refresh hashes loop
Jul 22, 2018
9bd9476
Make mempool processing more properly asynchronous
Jul 22, 2018
4b3ceff
Deserialize mempool txs in a thread
Jul 22, 2018
21604ca
Create a MemPoolTx object and use it
Jul 22, 2018
0963ce5
Completely overhaul mempool sync logic
Jul 22, 2018
3e535e4
Start peer discovery whilst syncing the mempool
Jul 23, 2018
b05cc4e
Clean up fee histogram implementation
Jul 23, 2018
7c01acd
Remove comment
Jul 23, 2018
45ccf8a
fix mempool tx fee calculation typo (#531)
SomberNight Jul 23, 2018
7485d0a
Retain the prevouts with each MemPoolTx
Jul 23, 2018
316f642
Reduce memory footprint
Jul 24, 2018
221f122
Defer peer discovery
Jul 24, 2018
83732af
Support for Minexcoin (#529)
joesixpack Jul 24, 2018
92ddb52
Update various comments
Jul 24, 2018
79b98b2
Distinguish private and public methods of peer mgr
Jul 24, 2018
12c024f
Log proxy detection failure
Jul 24, 2018
ba60754
Avoid callback in peer manager
Jul 24, 2018
eac214e
Rework peer discovery
Jul 24, 2018
e130983
Fix typo in prior
Jul 24, 2018
75f6b1d
Merge remote-tracking branch 'upstream/master'
ryan-shaw Jul 24, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
*/__pycache__/
**/__pycache__/
.cache/
tests/*/__pycache__/
.pytest_cache/
*/*~
*.#*
*#
*~
docs/_build
/build
/dist
/electrumx.egg-info
31 changes: 27 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,41 @@ language: python
before_install:
- sudo add-apt-repository -y ppa:giskou/librocksdb
- sudo apt-get -qq update
- sudo apt-get install -yq libleveldb-dev librocksdb libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev
- sudo apt-get install -yq libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev
- sudo apt-get install -yq --allow-unauthenticated librocksdb
- wget https://launchpad.net/ubuntu/+archive/primary/+files/leveldb_1.20.orig.tar.gz
- tar -xzvf leveldb_1.20.orig.tar.gz
- pushd leveldb-1.20 && make && sudo mv out-shared/libleveldb.* /usr/local/lib && sudo cp -R include/leveldb /usr/local/include && sudo ldconfig && popd
python:
- "3.6"
- "nightly"
# command to install dependencies
install:
- pip install aiohttp
- pip install aiorpcX
- pip install ecdsa
- pip install plyvel
- pip install pycodestyle
- pip install pylru
- pip install pyrocksdb
- pip install pytest-cov
- pip install python-coveralls
- pip install Sphinx
# hashes
- pip install tribus-hash
- pip install blake256
- pip install x11_hash
- pip install xevan_hash
- pip install quark_hash
- pip install git+https://github.com/goacoincore/neoscrypt
- pip install git+https://github.com/motioncrypto/x16r_hash
# command to run tests
script: pytest --cov=server --cov=lib --cov=wallet
after_success: coveralls
script:
- pytest --cov=electrumx
- pycodestyle electrumx/server/*.py electrumx/lib/*.py
- sh -c "cd docs && make html"
# Dont report coverage from nightly
after_success:
- if [[ $(python3 -V 2>&1) == *"Python 3.6"* ]]; then
pip install python-coveralls;
coveralls;
fi
224 changes: 2 additions & 222 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,232 +13,12 @@ For a future network with bigger blocks.
:Language: Python (>= 3.6)
:Author: Neil Booth

Getting Started
===============
Documentation
=============

See `docs/HOWTO.rst`_.
There is also an `installer`_ available that simplifies the installation on various Linux-based distributions.

.. _installer: https://github.com/Joe0/electrumx-installer

Features
========

- Efficient, lightweight reimplementation of electrum-server
- Fast synchronization of bitcoin mainnet from Genesis. Recent
hardware should synchronize in well under 24 hours. The fastest
time to height 448k (mid January 2017) reported is under 4h 30m. On
the same hardware JElectrum would take around 4 days and
electrum-server probably around 1 month.
- The full Electrum protocol is implemented. The only exception is
the blockchain.address.get_proof RPC call, which is not used by
Electrum GUI clients, and can only be invoked from the command line.
- Various configurable means of controlling resource consumption and
handling denial of service attacks. These include maximum
connection counts, subscription limits per-connection and across all
connections, maximum response size, per-session bandwidth limits,
and session timeouts.
- Minimal resource usage once caught up and serving clients; tracking the
transaction mempool appears to be the most expensive part.
- Fully asynchronous processing of new blocks, mempool updates, and
client requests. Busy clients should not noticeably impede other
clients' requests and notifications, nor the processing of incoming
blocks and mempool updates.
- Daemon failover. More than one daemon can be specified, and
ElectrumX will failover round-robin style if the current one fails
for any reason.
- Peer discovery protocol removes need for IRC
- Coin abstraction makes compatible altcoin and testnet support easy.

Implementation
==============

ElectrumX does not do any pruning or throwing away of history. I want
to retain this property for as long as it is feasible, and it appears
efficiently achievable for the forseeable future with plain Python.

The following all play a part in making ElectrumX very efficient as a
Python blockchain indexer:

- aggressive caching and batching of DB writes
- more compact and efficient representation of UTXOs, address index,
and history. Electrum Server stores full transaction hash and
height for each UTXO, and does the same in its pruned history. In
contrast ElectrumX just stores the transaction number in the linear
history of transactions. For at least another 5 years this
transaction number will fit in a 4-byte integer, and when necessary
expanding to 5 or 6 bytes is trivial. ElectrumX can determine block
height from a simple binary search of tx counts stored on disk.
ElectrumX stores historical transaction hashes in a linear array on
disk.
- placing static append-only metadata indexable by position on disk
rather than in levelDB. It would be nice to do this for histories
but I cannot think of a way.
- avoiding unnecessary or redundant computations, such as converting
address hashes to human-readable ASCII strings with expensive bignum
arithmetic, and then back again.
- better choice of Python data structures giving lower memory usage as
well as faster traversal
- leveraging asyncio for asynchronous prefetch of blocks to mostly
eliminate CPU idling. As a Python program ElectrumX is unavoidably
single-threaded in its essence; we must keep that CPU core busy.

Python's ``asyncio`` means ElectrumX has no (direct) use for threads
and associated complications.


Roadmap
=======

- offloading more work of wallet synchronization to the client
- supporting better client privacy
- wallet server engine
- new features such as possibly adding label server functionality
- potentially move some functionality to C or C++


ChangeLog
=========

IMPORTANT: version 1.2 changes script hash indexing in the database,
so you will need to rebuild your databases from scratch. Running this
version will refuse to open the DB and not corrupt it, so you can
revert to 1.1.x if you wish. The initial synchronisation process
should be around 10-15% faster than 1.1, owing to this change and
Justin Arthur's optimisations from 1.1.1.

Version 1.2.1
-------------

- remove IRC support. Most coins had empty IRC channels. Those that
don't have peers populated.
- use estimatesmartfee RPC call if available (SomberNight)
- new/updated coins: Emercoin (Sergii Vakula), Bitcoin Gold (erasmospunk),
Monacoin testnet (Wakiyama P), sibcoin (53r63rn4r), Komodo and Monaize
(cipig), Hush (Duke Leto)
- doc updates (fr3aker)
- issues fixed: `#302`_

Version 1.2
-----------

- separate P2PKH from P2PK entries in the history and UTXO databases.
These were previously amalgamated by address as that is what
electrum-server used to do. However Electrum didn't handle P2PK
spends correctly and now the protocol admits subscriptions by script
hash there is no need to have these merged any more.

For Bitcoin (BitcoinSegwit/mainnet) you can download a leveldb database
synced up to block 490153 using this bittorrent magnet link (~24GB):
magnet:?xt=urn:btih:caa804f48a319b061be3884ac011656c27121a6f&dn=electrumx_1.2_btc_leveldb_490153

Version 1.1.2
-------------

- PEER_DISCOVERY environment variable is now tri-state (fixes
`#287`_). Please check your setting as its meaning has changed
slightly.
- fix listunspent protocol methods to remove in-mempool spends (fixes
`#277`_).
- improved environment variable handling
- EMC2 update (cipig), Monacoin update (cryptocoin-junkey),
Canada Ecoin (koad)
- typo fixes, Bitcoin testnet peers updates (SomberNight)

Version 1.1.1
-------------

- various refactorings, improvement of env var handling
- update docs to match
- various optimizations mainly affecting initial sync (Justin Arthur)
- Dash fixes (cipig)
- Add ALLOW_ROOT option (Luke Childs)
- Add BitZeny support, update Monacoin (cryptocoin-junkey)

Version 1.1
-----------

See the changelogs below for recent changes. The most important is
that for mainnet bitcoin **NET** must now be *mainnet* and you must
choose a **COIN** from *BitcoinCash* and *BitcoinSegwit*. Similarly
for testnets. These coins will likely diverge further in future so
it's best they become separate coins now.

- no longer persist peers, rediscover on restart
- onion peers only reported if can connect; hard-coded exception removed
- small fix for blockchain.transaction.broadcast

Version 1.1pre2
---------------

- peerdisc: handle protocol 1.1 server replies
- issue `#251`_: fix protocol version reported in server.peers.subscribe
- fix handling of failed transaction broadcast
- fix typos (SomberNight)
- doc and test updates
- dash: return errors in JSON error field for protocol 1.1

Version 1.1pre1
---------------

Many changes, mostly to prepare for support of Electrum protocol 1.1
which the next Electrum client release will use.

*NOTE*: the **COIN** environment variable is now mandatory, and if you
were running for any bitcoin flavour (Cash, Segwit, mainnet or
testnet) you will need to update your **COIN** and **NET** environment
variable settings as the old ones will no longer work.

- implement protocol version 1.1 and update protocol documentation
- rework lib/coins.py for the various bitcoin flavours
- show protocol version in "sessions" ElectrumX RPC call
- permit **HOST** envvar to be a comma-separated list
- daemon abstraction refactoring (erasmospunk)
- permit alternative event loop policies (based on suggestion / work
of JustinTArthur)
- misc configuration updates (SubPar)
- add Neblio support (neblioteam) and Bitbay (anoxxxy)
- HOWTO.rst update for running on privileged port (EagleTM)
- issues closed: exclude test dirs from installation (`#223`_).

Version 1.0.17
--------------

- fix #227 introduced in 1.0.16

Version 1.0.16
--------------

- updated server lists for post-fork. If you are on the Segwit chain
you should have NET be "bitcoin-segwit", and if on the Bitcoin Cash chain
continue to use "mainnet".
- binding address fix for multi-homed machines (mmouse)
- listen to IPv4 and IPv6 local interfaces
- add Fujicoin (fujicoin), Crown (Extreemist), RegTest (RCasatta),
Monacoin (cryptocoin-junkey)
- bug fixes and updates (Kefkius, mmouse, thesamesam, cryptocoin-junkey,
jtarthur)

Version 1.0.15
--------------

- split server networks faster if a fork is detected
- minor speedup
- add Vertcoin support (erasmospunk)
- update Faircoin (thokon00)


**Neil Booth** [email protected] https://github.com/kyuupichan

1BWwXJH3q6PRsizBkSGm2Uw4Sz1urZ5sCj

LKaFk4KkVpw9pYoUpbckQSKKgCVC4oj78b

.. _#223: https://github.com/kyuupichan/electrumx/issues/223
.. _#251: https://github.com/kyuupichan/electrumx/issues/251
.. _#277: https://github.com/kyuupichan/electrumx/issues/277
.. _#287: https://github.com/kyuupichan/electrumx/issues/287
.. _#302: https://github.com/kyuupichan/electrumx/issues/287
.. _docs/HOWTO.rst: https://github.com/kyuupichan/electrumx/blob/master/docs/HOWTO.rst
.. _docs/ENVIRONMENT.rst: https://github.com/kyuupichan/electrumx/blob/master/docs/ENVIRONMENT.rst
.. _docs/PROTOCOL.rst: https://github.com/kyuupichan/electrumx/blob/master/docs/PROTOCOL.rst
24 changes: 15 additions & 9 deletions compact_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,46 @@
subsequent compactions will restart from the beginning.
'''

import asyncio
import logging
import sys
import traceback
from os import environ

from server.env import Env
from server.db import DB
from electrumx import Env
from electrumx.server.db import DB


def compact_history():
async def compact_history():
if sys.version_info < (3, 6):
raise RuntimeError('Python >= 3.6 is required to run ElectrumX')

environ['DAEMON_URL'] = '' # Avoid Env erroring out
env = Env()
db = DB(env)
await db.open_for_sync()

assert not db.first_sync
history = db.history
# Continue where we left off, if interrupted
if db.comp_cursor == -1:
db.comp_cursor = 0
if history.comp_cursor == -1:
history.comp_cursor = 0

db.comp_flush_count = max(db.comp_flush_count, 1)
history.comp_flush_count = max(history.comp_flush_count, 1)
limit = 8 * 1000 * 1000

while db.comp_cursor != -1:
db._compact_history(limit)
while history.comp_cursor != -1:
history._compact_history(limit)

# When completed also update the UTXO flush count
db.set_flush_count(history.flush_count)

def main():
logging.basicConfig(level=logging.INFO)
logging.info('Starting history compaction...')
loop = asyncio.get_event_loop()
try:
compact_history()
loop.run_until_complete(compact_history())
except Exception:
traceback.print_exc()
logging.critical('History compaction terminated abnormally')
Expand Down
2 changes: 1 addition & 1 deletion contrib/daemontools/env/ELECTRUMX
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/path/to/electrumx_server.py
/path/to/electrumx_server
2 changes: 1 addition & 1 deletion contrib/daemontools/log/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
exec multilog t s500000 n10 /path/to/log/dir
exec multilog s500000 n10 /path/to/log/dir
4 changes: 3 additions & 1 deletion contrib/daemontools/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/sh
echo "Launching ElectrumX server..."
exec 2>&1 envdir ./env /bin/sh -c 'setuidgid $USERNAME python3 $ELECTRUMX'
USERNAME=$(envdir ./env printenv USERNAME)
ELECTRUMX=$(envdir ./env printenv ELECTRUMX)
ulimit -n 4000 && exec 2>&1 envdir ./env envuidgid $USERNAME python3 $ELECTRUMX
2 changes: 1 addition & 1 deletion contrib/python3.6/python-3.6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update && sudo apt-get install python3.6 python3.6-dev

cd /home/username
cd ~
git clone https://github.com/kyuupichan/electrumx.git
cd electrumx
sudo python3.6 setup.py install
Expand Down
4 changes: 2 additions & 2 deletions contrib/raspberrypi3/run_electrumx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
###############

# configure electrumx
export COIN=Bitcoin
export COIN=BitcoinSegwit
export DAEMON_URL=http://rpcuser:[email protected]
export NET=mainnet
export CACHE_MB=400
Expand All @@ -25,7 +25,7 @@ export RPC_PORT=8000

# run electrumx
ulimit -n 10000
/usr/local/bin/electrumx_server.py 2>> /home/username/.electrumx/electrumx.log >> /home/username/.electrumx/electrumx.log &
/usr/local/bin/electrumx_server 2>> /home/username/.electrumx/electrumx.log >> /home/username/.electrumx/electrumx.log &

######################
# auto-start electrumx
Expand Down
2 changes: 1 addition & 1 deletion contrib/systemd/electrumx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ DB_DIRECTORY = /db
# Bitcoin Node RPC Credentials
DAEMON_URL = http://username:password@hostname:port/

# See https://github.com/kyuupichan/electrumx/blob/master/docs/ENVIRONMENT.rst for
# See http://electrumx.readthedocs.io/en/latest/environment.html for
# information about other configuration settings you probably want to consider.
Loading