Commit Graph

23 Commits

Author SHA1 Message Date
Neil Booth
3f35bc0298 More PEP8 stuff 2017-02-18 13:05:26 +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
John L. Jegutanis
fd19bddeb1 fix crash due to a missing env variable in irc.py and a typo fix (#112)
Thank you!
2017-01-30 23:52:56 +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
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
517f78858c Fix IRC flood issues
Tweaked version of suggestions from Valesi, petrkr, and bauerj.
Fixes #93
2017-01-02 17:30:32 +09:00
Neil Booth
5cbe878cb8 Move ServerManager to controller.py
rename Controller
2017-01-02 17:30:32 +09:00
Neil Booth
b8239c54d9 Catch UnicodeError in IRC gethostbyname
Fixes #68
2016-12-10 08:52:24 +09:00
Neil Booth
556574640f IRC encoding fix 2016-12-03 20:19:58 +09:00
Neil Booth
7a9e8c7fef Small tweaks to IRC code 2016-12-02 07:45:51 +09:00
Shane Moore
0edff0056d Add Tor-specific port options for IRC 2016-12-01 03:21:52 -08:00
Shane Moore
33c5bd65aa Fix IRC port bug, more readable 2016-12-01 02:25:21 -08:00
Shane Moore
95c848a720 Add IRC option to publish Tor address 2016-11-30 23:50:20 -08:00
Neil Booth
1aaed2e913 Create just one server connection
I hope this
Fixes #47
2016-11-26 18:10:03 +09:00
Neil Booth
956d1b8039 Fix IRC regression 2016-11-23 22:49:37 +09:00
Neil Booth
9e220820aa Rework futures and event handling 2016-11-23 17:52:09 +09:00
TheLazieR Yip
f075f0bb5f Add coin's IRC parameters 2016-11-23 08:15:03 +07:00
Neil Booth
8b34d1c134 Log IRC errors, typically missing package 2016-11-20 18:09:32 +09:00
Neil Booth
db187540d5 Have task coros handle cancelled exceptions 2016-11-15 20:09:38 +09:00
Neil Booth
e7e0dd15be Don't log new peers any more 2016-11-13 15:44:37 +09:00
Neil Booth
14d8ece7c6 Return a version the Electrum client expects
If you don't do this you don't appear in the network dialog box
2016-11-12 23:20:20 +09:00
Neil Booth
d84417e2d6 Add note about IRC package 2016-11-12 22:09:00 +09:00
Neil Booth
501807bf1a Implement IRC support and related queries from clients 2016-11-12 21:06:51 +09:00