Commit Graph

39 Commits

Author SHA1 Message Date
Neil Booth
06c8eda161 Preparations for peer discovery
DEFAULT_PORTS is a now a coin property.
Other miscellaneous updates to get things closer
2017-01-29 06:47:43 +09:00
Neil Booth
551c04a3bc Remove all uses of "except:" 2017-01-25 20:28:19 +09:00
Neil Booth
05a6da1920 Move peer management to peers.py from irc
It's cleaner and will be useful for peer-to-peer comms later
2017-01-22 23:34:44 +09:00
Neil Booth
15051124af Make flushes and reorgs async
Apart from the flush on shutdown and the flush when caught up,
neither of which matter, this makes flushes asynchronous.

Also, block processing for reorgs is now asynchronous.

This also removes the FORCE_REORG debug envvar; I want to
put that into the RPC interface.

Closes #102
2017-01-09 16:15:17 +09:00
Neil Booth
dcc2c92bd6 Rename NETWORK envvar to NET
For consistency with lib/coins.py

SegWit testnet needs its own NET
2017-01-08 10:07:58 +09:00
Neil Booth
91ca5fc14a Split out history into its own DB. 2017-01-07 11:51:12 +09:00
Neil Booth
2b2909f1c4 Move to hashX
The hashX of a script is the first 11 bytes of its sha256 hash.

Closes #72.
2017-01-07 11:51:01 +09:00
Neil Booth
e2f4847632 New env var MAX_SESSIONS
When the number of sessions reaches MAX_SESSIONS, which defaults
to 1,000, turn off TCP and SSL listening sockets to prevent new
connections.  When the session count falls below a low watermark,
currently 90% of MAX_SESSIONS, the listening sockets will be re-opened.
Helps prevent DoS and limit open file usage.

Bug fix: do not start serving paused connections until the buffer
socket is sufficiently drained.  Also, loop.
2016-12-13 22:47:03 +09:00
Neil Booth
3d2824218b Close stale sessions
New envvar SESSION_TIMEOUT
A session with no activity is cut off after this time
Fixes #56
2016-12-03 13:06:20 +09:00
Shane Moore
0edff0056d Add Tor-specific port options for IRC 2016-12-01 03:21:52 -08:00
Shane Moore
95c848a720 Add IRC option to publish Tor address 2016-11-30 23:50:20 -08:00
Neil Booth
b65bcda504 Add per-session bandwidth limits 2016-11-29 22:19:12 +09:00
Neil Booth
5053101cee LOG_SESSIONS should use self.integer 2016-11-29 19:32:11 +09:00
Neil Booth
c08ade5861 Add session logging facility
Move session logging code to protocol.py from electrum_rpc.py
Use it for periodic logging controlled by envvar LOG_SESSIONS
For each session, track sent transaction stats and show that
per-session instead of errors
2016-11-29 08:00:54 +09:00
Neil Booth
4e26e0fe96 Bump default value of MAX_SEND to 1m bytes.
Otherwise historic large txs could not be served to clients.
2016-11-26 15:22:42 +09:00
Neil Booth
292073f2c7 Log large requests and reject them 2016-11-26 09:32:29 +09:00
Neil Booth
de4930b96d Introduce MAX_HIST environment variable. 2016-11-24 23:30:40 +09:00
Neil Booth
640360c809 Add feature to simulate reorgs for debugging 2016-11-23 09:52:30 +09:00
Neil Booth
8970205e6c Remove obsolete debugging feature 2016-11-23 09:16:41 +09:00
Neil Booth
87cdd2709d Implement daemon failover
Daemon URLs can be comma-separated in the DAEMON_URL env var.
Surrounding whitespace is stripped.
http:// is preprended if missing.
The coin's default port is supplied if missing.
A trailing / is supplied if missing.
Closes #33
2016-11-20 20:52:54 +09:00
Neil Booth
0b52376f23 Add subscription limits 2016-11-19 10:51:16 +09:00
Neil Booth
66c493dbf4 Make the default reorg_limit a coin property 2016-11-18 19:21:38 +09:00
Neil Booth
cc2db4a62c Bump HIST_MB default to 300MB 2016-11-16 06:39:39 +09:00
Johann Bauer
d45321927e Add optional option to anonymise logs (remove IP addresses) 2016-11-13 23:56:16 +01:00
Neil Booth
501807bf1a Implement IRC support and related queries from clients 2016-11-12 21:06:51 +09:00
Neil Booth
00e9c5a31d Add daemon debugging caught-up facility 2016-11-05 21:37:02 +09:00
Neil Booth
f9fcdf2232 Merge branch 'master' into develop 2016-11-03 16:53:08 +09:00
Neil Booth
3d11afbda2 Enable servers 2016-11-03 16:48:10 +09:00
Neil Booth
d2ebb80fac Extend copyright notice; improve comments 2016-11-03 16:45:06 +09:00
Neil Booth
c09182534f Update for release 2016-11-03 16:25:11 +09:00
Neil Booth
5c63cd40de Implement reorg logic 2016-10-29 14:38:54 +09:00
Neil Booth
334ffdaa4f Begin work on proper server 2016-10-17 20:02:42 +09:00
Neil Booth
0b01026b88 Add an RPC server
And associated electrumx_rpc command
2016-10-16 08:58:53 +09:00
Neil Booth
282d46a46c Flush to disk when flushing history 2016-10-15 11:41:55 +09:00
Neil Booth
5f77ff4ef0 Flush history separately.
We do not yet remove excess history.
2016-10-14 20:09:47 +09:00
Neil Booth
6b513a91d0 CACHE_MB is now the environment var. 2016-10-14 07:56:25 +09:00
Neil Booth
4e777b5861 Let's try a smarter UTXO cache. 2016-10-11 00:04:13 +09:00
Neil Booth
64b7554b73 Fix some typos 2016-10-08 17:34:12 +09:00
Neil Booth
a3dbc68614 Initial revision 2016-10-08 17:17:43 +09:00