Neil Booth
bc6093a8fe
Fully integrate aiorpcX
7 years ago
Neil Booth
e69b1d930f
Convert PeerSession to use aiorpcX
7 years ago
Neil Booth
c1ba211d43
Remove code appropriate for future aiorpcX
Closes #428
7 years ago
Neil Booth
81141eb390
Proxy detection improvements
- don't detect in a loop. Only detect at startup, and later if
needed and 15 minutes has passed since the last attempt
7 years ago
Neil Booth
c11ad5d189
Bump to aiorpcX version 0.4.4
Update peers.py to not pass local_addr to proxy
7 years ago
Neil Booth
74bc80ffbd
Revert "Log from Peer Manager directly"
This reverts commit d2e6f7d75b
.
7 years ago
Neil Booth
d2e6f7d75b
Log from Peer Manager directly
7 years ago
Neil Booth
80fc334449
Switch to aiorpcX for SOCKS proxying.
7 years ago
Neil Booth
ebc83b4028
Import peers in main_loop
Also only if peer discovery is enabled. It's less confusing
that way.
7 years ago
Neil Booth
35dd1f6199
Remove IRC support
7 years ago
Neil Booth
72fce87088
Put server_features() on the environment object
Fixes #302
7 years ago
Neil Booth
81947d796b
Enhance PEER_DISCOVERY environment variable
It is now tri-state - ON, OFF or SELF.
Fixes #287
7 years ago
Neil Booth
131344715a
Minor environment variable improvements
- COIN and NET strip surrounding whitespace
- new environment variable RPC_HOST, similar to HOST, but
for RPC. Permits fine-grained control of which addresses
the RPC server listens on.
- HOST and RPC_HOST strip surrounding whitespace from hostnames
and IP addresses
- tests and documentation updated to match
8 years ago
Neil Booth
2f69aaa487
Remove dead code
8 years ago
Neil Booth
305fd89740
Stop persisting peers; resdiscover on restart
8 years ago
Neil Booth
40fa79da63
Remove exception for onion peers
Like clearnet peers, they are only returned in server.peers.subscribe
if there was a successful connection.
8 years ago
Neil Booth
794e1d86ff
Peerdisc: handle protocol 1.1 server.version replies
8 years ago
Neil Booth
a978ca6df7
Permit HOST to be a comma-separated list.
Update documentation to match.
8 years ago
Neil Booth
f8a838c589
Add "hash_function" member to server.features.
Update documentation
8 years ago
Neil Booth
fab3f5affe
Have proxy.create_connection use kwargs
Fixes #227
8 years ago
mmouse-
69c1535d13
Use our listening Host/IP for outgoing connections also ( #226 )
Explicitely set the local IP for outgoing connections, if we're listening
on only one Hostname or IP (of a multi-IP machine). This makes sure our
peers see our outgoing connections coming from the same IP that we're
listening on when we have a specific HOST= configured.
For machines with more than one IP this avoids source-destination
mismatch errors when advertizing our peer. Resolves kyuupichan/electrumx#225
8 years ago
Neil Booth
75feac5d1e
Check prior header hashes to detect forks
8 years ago
Neil Booth
4cc3720589
Disable IRC for bitcoin mainnet
Only require IRC_CHANNEL if IRC_PREFIX is given.
8 years ago
Neil Booth
e9acb685ab
Display hosts in diagnostic
8 years ago
Neil Booth
8a2821d542
Reject invalid hostnames in Env
8 years ago
Neil Booth
b6d8b86dd6
Ignore hosts not appearing in their own features
8 years ago
Neil Booth
f3de91180e
Add tests for server/env.py
8 years ago
Neil Booth
2c43e89b05
Only set last_good if successfully verified
Rename last_connect to last_good
8 years ago
Neil Booth
7b17d99c5a
Put log on one line
8 years ago
Neil Booth
9f27ea875c
Fix peer replacement logic
- drop the IP address peer
- update the remaining peer with fresh info
8 years ago
Neil Booth
2656fd78a4
Clarify that we may not have a clearnet peer
8 years ago
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.
8 years ago
Neil Booth
77a441ad06
Improve proxy handling
Have a background proxy detection loop; removes need to check
specific peers at startup.
Consider proxy down once attempts to use it fail 3 times in a row.
Regularly attempt to rediscover a proxy if it is down.
8 years ago
Neil Booth
81e6577838
Catch address resolution failure exceptions
8 years ago
Neil Booth
8e00affc1a
Fix the diagnostic looping in PeerSession
Fixes #160
8 years ago
Neil Booth
23a408c572
More logging
8 years ago
Neil Booth
2650459012
Peer discovery fixes
Change last_connect to mean last connection as its name implies,
not last connection that wasn't bad.
Keep bad peers around for 3 tries.
Improve diagnostic
8 years ago
Neil Booth
79bce5335e
Fix missing self
8 years ago
Neil Booth
3236989165
Fix bad peer looping
JWU42 pointed out an issue where peer discovery could get in a
failure loop for bad peers; this fixes the the root cause and
the immediate retries
8 years ago
Neil Booth
f04ff6f5b3
Don't add_peer to ourself
8 years ago
Neil Booth
8236aaf234
Be more strict on form of features dictionary
8 years ago
Neil Booth
be5397a853
Validate hostnames before accepting a new peer
Don't retain non-public addresses
Closes #157
8 years ago
Neil Booth
7a2f29aabe
Be stricter accepting add_peer requests
- rate-limit onion add_peer requests
- for clearnet peers only accept if the peer resolves to the
source address
8 years ago
Neil Booth
060d32211f
Check height for all peers
Closes #152
8 years ago
Neil Booth
d198b95798
Reduce new peers per source limit to 2 by default
8 years ago
Neil Booth
30bb832ef8
Prepare 1.0
8 years ago
Neil Booth
27f94cfb04
Take up to 2 peers randomly from each bucket
Bumped up from 1.
Restore STALE_SECS to 1 day
8 years ago
Neil Booth
39bcdb1b6a
Require Python 3.5.3
3.5.2 has various socket and API issues affecting peer discovery
Closes #135
8 years ago
Neil Booth
be9d063457
Rename function
8 years ago
Neil Booth
31b978f21e
Remove debug logging and peers semaphore.
Increase STALE_SECS to 4 hrs. Will revert to 1 day soon.
8 years ago