Commit Graph

148 Commits

Author SHA1 Message Date
LaoDC
3c8ab998e4 sorry about permissions 2017-05-03 19:27:00 +07:00
LaoDC
70c6c87852 fixed typo. 2017-05-03 19:26:49 +07:00
LaoDC
c5c75c30de Updated docs/ENVIRONMENT.rst to reflect changes in variables 2017-05-03 19:25:14 +07:00
Neil Booth
a94d320e5d New feature: force peer discovery via proxy
Set FORCE_PROXY to non-empty to force peer discovery to go
through the proxy.  See docs/ENVIRONMENT.rst

Wait for an attempt at proxy discovery to be made before beginning
peer discovery.
2017-04-02 15:06:29 +09:00
Neil Booth
9abc1dc11e REPORT_HOST no longer defaults to HOST
Cleanup of identity handling.  It is now possible to specify
a Tor identity and no clearnet identity.
2017-04-01 12:03:53 +09:00
Neil Booth
9f12379181 Update notes about rocksdb in Python 2017-03-29 17:01:40 +09:00
Neil Booth
31755e1dac Update PROTOCOL.rst and PEER_DISCOVERY.rst 2017-03-25 13:28:20 +09:00
John L. Jegutanis
a820829e0e Dynamic header support
Block headers can have a dynamic size that is being indexed on a
new meta file "headers_offsets".

The offsets are 64 bits in order to accommodate coins with big
headers that will accumulate GBs of header data after some years.

Closes #128
2017-03-25 11:35:55 +09:00
Neil Booth
127b4de745 Add new RPC method: add_peer 2017-03-25 11:35:54 +09:00
Neil Booth
30c91c69e1 Update protocol docs 2017-03-22 23:45:26 +09:00
shsmith
5ef25976c4 merge samples into contrib 2017-03-12 18:30:44 -07:00
Neil Booth
9c6d2f5764 Update ACKNOWLEDGEMENTS 2017-03-11 13:51:51 +09:00
Neil Booth
30bb832ef8 Prepare 1.0 2017-03-05 13:22:09 +09:00
Neil Booth
39bcdb1b6a Require Python 3.5.3
3.5.2 has various socket and API issues affecting peer discovery

Closes #135
2017-03-01 07:23:11 +09:00
Neil Booth
6f32f99a06 Prepare 0.99 2017-02-19 19:42:26 +09:00
Neil Booth
5662f1fa88 Add facility to disable peer discovery
and/or self announcement.
2017-02-19 19:02:01 +09:00
Neil Booth
e261824593 Tweak docs 2017-02-19 10:32:28 +09:00
xHire
881e9cc6cc A note about testnet-segwit NET in docs (#130)
Thanks
2017-02-19 10:32:27 +09:00
Neil Booth
151da40d5b Implement peer discovery protocol
Closes #104

DEFAULT_PORTS now a coin property
A Peer object maintains peer information
Revamp LocalRPC "peers" call to show a lot more information
Have lib/jsonrpc.py take care of handling request timeouts
Save and restore peers to a file
Loosen JSON RPC rules so we work with electrum-server and beancurd which don't follow the spec.
Handle incoming server.add_peer requests
Send server.add_peer registrations if peer doesn't have us or correct ports
Verify peers at regular intervals, forget stale peers, verify new peers or those with updated ports
If connecting via one port fails, try the other
Add socks.py for SOCKS4 and SOCKS5 proxying, so Tor servers can now be reached by TCP and SSL
Put full licence boilerplate in lib/ files
Disable IRC advertising on testnet
Serve a Tor banner file if it seems like a connection came from your tor proxy (see ENVIONMENT.rst)
Retry tor proxy hourly, and peers that are about to turn stale
Report more onion peers to a connection that seems to be combing from your tor proxy
Only report good peers to server.peers.subscribe; always report self if valid
Handle peers on the wrong network robustly
Default to 127.0.0.1 rather than localhost for Python <= 3.5.2 compatibility
Put peer name in logs of connections to it
Update docs
2017-02-18 12:43:45 +09:00
Neil Booth
82d57dc90f Accept IPv6 addresses in DAEMON_URL
Fixes #126
2017-02-16 08:00:08 +09:00
Neil Booth
60ad792179 Update docs 2017-02-12 08:35:47 +09:00
Neil Booth
616bcf6bfd Add daemon_url RPC call and document it.
Closes #111
2017-01-31 08:13:25 +09:00
Neil Booth
cd078be882 Fix some typos 2017-01-29 18:43:58 +09:00
Neil Booth
d0ecdcc5bc Add docs/PROTOCOL.rst 2017-01-29 18:38:23 +09:00
Neil Booth
4a8cec9988 Prepare 0.10.14 2017-01-29 08:29:41 +09:00
Neil Booth
0202b2210a Add peer discovery document 2017-01-29 08:24:18 +09:00
Neil Booth
e56f188816 Implement peer subscriptions
Incremental updates are passed.
Also implement a server.features RPC
2017-01-25 20:28:19 +09:00
Neil Booth
a7462a6ea3 Complete rewrite of JSON RPC infrastructure
Aim to be easier for clients to use, because to do peer
discovery we must act as a client to other servers.

Split out JSON session concept from the asyncio protocol
concept.  This makes the JSON RPC support more easily
testable and usable as a stand-alone library.

In addition, support JSON RPC v1 and v2, and auto-detection
of peer's version.
2017-01-23 23:36:02 +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
c958b3af49 Remove LMDB
Performance of history writes was very poor even with
the code rewritten to accommodate the environment concept
(see db_abstraction branch)
2017-01-16 22:03:45 +09:00
Neil Booth
5aaee6b608 Update docs 2017-01-16 19:32:22 +09:00
Neil Booth
8d58d2a0e7 Clean up shutdown logic and logging
Add RPC "stop" command, and document it.

Fixes the 2nd part of #100
2017-01-16 19:31:57 +09:00
Neil Booth
d2da494120 Clarify README; no need to resync.
Update HOWTO and docs
2017-01-12 22:40:21 +09:00
Neil Booth
2ad64f6243 Add an RPC call to force a reorg at run-time
This required a large rework block processor and prefetcher
interaction, and led to various cleanups

Closes #103
2017-01-09 17:14:06 +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
0f43ce564a Fix log message 2017-01-07 11:51:00 +09:00
Neil Booth
038d9a9720 Tweak documentation for clarity 2017-01-07 11:51:00 +09:00
Neil Booth
9ca68a5084 Update the ARCHITECTURE document
Also has a pretty line diagram
2017-01-03 17:05:39 +09:00
Neil Booth
beb546219a Move ENV-NOTES to ENVIRONMENT.rst
Improve environment documentation
2017-01-03 14:18:59 +09:00
Neil Booth
b29ce0604d Explain what logging a session means 2017-01-03 09:18:30 +09:00
Neil Booth
5bf59a1cc7 Add documentation of the RPC interface 2017-01-02 19:29:19 +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
6fcb8b0574 Fix cut-n-pasteo 2016-12-10 09:07:08 +09:00
Neil Booth
99d7e65de8 Give sockets a grace period to close
Defaults to 15 seconds for now.
Update docs on systemd and process limits.
Fixes #62
2016-12-10 08:52:24 +09:00
Neil Booth
643c990684 Revert "Add feature to rate limit connections"
This reverts commit a82ab0b075.
2016-12-05 23:27:36 +09:00
Neil Booth
a82ab0b075 Add feature to rate limit connections 2016-12-04 21:14:45 +09:00
Neil Booth
26de3f0261 Prepare 0.8.1 2016-12-03 20:24:53 +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
cc6d183ec4 Prepare 0.7.14 2016-11-29 22:22:07 +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
9eb701f220 Replace $VERSION in the banner file
with the ElectrumX version string
2016-11-26 18:19:53 +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
9157618089 Tweak ENV-NOTES 2016-11-26 10:13:19 +09:00
Neil Booth
9544170c55 Prepare release-0.7.10 2016-11-26 09:53:47 +09:00
Neil Booth
292073f2c7 Log large requests and reject them 2016-11-26 09:32:29 +09:00
Neil Booth
9f2bd981f0 Prepare 0.7.9 2016-11-25 21:23:14 +09:00
Neil Booth
2dbb9f44f6 Prepare release 0.7.8 2016-11-25 08:10:53 +09:00
Neil Booth
86b0f7fa72 Prepare 0.7.7 2016-11-24 23:42:49 +09:00
Neil Booth
de4930b96d Introduce MAX_HIST environment variable. 2016-11-24 23:30:40 +09:00
Neil Booth
70ee7eebd8 Prepare 0.7.6 2016-11-23 22:52:23 +09:00
Neil Booth
86086cac63 Prepare 0.7.5 2016-11-23 17:59:18 +09:00
Neil Booth
f20859a8a6 Prepare 0.7.4 2016-11-23 09:55:54 +09:00
Neil Booth
640360c809 Add feature to simulate reorgs for debugging 2016-11-23 09:52:30 +09:00
Neil Booth
39021792ca Prepare 0.7.3 2016-11-22 08:11:05 +09:00
Neil Booth
10e0ff2e01 Update REL-NOTES 2016-11-22 07:06:00 +09:00
cluelessperson
84faf6cc8d Reorganization of init systems files, adding systemd sample config 2016-11-20 08:51:27 -06:00
Neil Booth
285a66fceb Prepare 0.7.1 2016-11-20 22:03:04 +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
d856cbab90 Prepare 0.6.3 2016-11-19 17:10:58 +09:00
Neil Booth
0b52376f23 Add subscription limits 2016-11-19 10:51:16 +09:00
Neil Booth
4a4d11ad7c Prepare release 0.6.2 2016-11-19 08:21:17 +09:00
Neil Booth
6d7bc7595f Prepare release 0.6.1 2016-11-18 22:28:42 +09:00
Neil Booth
022a919701 Prepare release 0.6 2016-11-17 23:08:19 +09:00
Neil Booth
bdb50e0ff7 Move file 2016-11-16 07:32:53 +09:00
Neil Booth
b60eb5ca17 Prepare 0.5.1 2016-11-15 21:34:08 +09:00
Neil Booth
c22366c1cc Prepare 0.5 release 2016-11-13 22:41:11 +09:00
Neil Booth
41ff6e5b11 Prepare 0.4.3 2016-11-13 17:55:50 +09:00
Neil Booth
fdb5b33fba Prepare 0.4.2 2016-11-13 15:37:51 +09:00
TheLazieR Yip
b1c995ce09 Update Howto and setup.py about x11_hash package required for Dash 2016-11-13 09:35:27 +07:00
Neil Booth
d816c21752 Prepare 0.4.1 2016-11-12 23:23:08 +09:00
Neil Booth
d84417e2d6 Add note about IRC package 2016-11-12 22:09:00 +09:00
Neil Booth
5624809933 Prepare 0.4 2016-11-12 21:51:43 +09:00
Neil Booth
501807bf1a Implement IRC support and related queries from clients 2016-11-12 21:06:51 +09:00
Neil Booth
261682439d Prepare 0.3.3 2016-11-12 09:46:20 +09:00
Neil Booth
419ab68a38 Prepare 0.3.2 2016-11-12 09:27:46 +09:00
Neil Booth
3798ef80ef Prepare 0.3.1 2016-11-12 09:12:18 +09:00
Neil Booth
244a0f2fab Update release notes. 2016-11-11 21:18:51 +09:00
Neil Booth
5a2a8b4ec1 Prepare 0.2.3 release 2016-11-10 23:57:13 +09:00
Neil Booth
bf6a8f58d5 Hotfixes for two issues in 0.2.2 2016-11-10 07:43:07 +09:00
Neil Booth
4e619c9f5e Prepare 0.2.2 2016-11-09 07:44:17 +09:00
Neil Booth
ed44c6ab73 Clean up startup procedure 2016-11-09 00:47:49 +09:00
Neil Booth
93d53bdd87 The controller is dead! 2016-11-08 08:29:56 +09:00
Neil Booth
e7912928c5 Prepare for release 2016-11-07 23:10:56 +09:00
Neil Booth
be975a3f7c Create docs directory 2016-11-07 05:35:00 +09:00