Neil Booth
cf99f733d9
Remove the get_proof RPC.
...
The client will get an unknown method error message instead.
2017-10-15 16:27:10 +09:00
Neil Booth
74cb4c2f45
Require Python 3.6
2017-10-14 11:51:11 +09:00
Neil Booth
9bf220dec6
Widen min and max columns
2017-10-12 14:19:28 +09:00
Neil Booth
e039ba4b15
Prepare 1.2
2017-10-12 14:11:11 +09:00
Neil Booth
56d03625f6
Keep P2PK scripts separate from P2PKH scripts
...
This makes the DB incompatible with prior versions,
so the DB version is bumped.
2017-10-12 14:02:22 +09:00
Neil Booth
1cf084fb69
Prepare 1.1.2
2017-10-12 14:02:22 +09:00
Neil Booth
346385680e
Fix listunspent methods to remove mempool spends
...
Fixes #277
2017-10-12 13:56:46 +09:00
Neil Booth
81947d796b
Enhance PEER_DISCOVERY environment variable
...
It is now tri-state - ON, OFF or SELF.
Fixes #287
2017-10-11 13:54:13 +09:00
Neil Booth
7fa7d290ca
Prepare 1.1.1
2017-09-28 09:05:51 +08:00
Neil Booth
3e376a79eb
Rename lib/env to lib/env_base
2017-09-28 08:57:44 +08:00
Neil Booth
366c556c5f
Split out lib/server_base.py
2017-09-28 08:56:12 +08:00
Neil Booth
ae03ea6cb6
Add env object for wallet engine
...
Split out common Env parts to a base class.
2017-09-21 18:16:37 +08:00
cipig
b16a4f5a94
fix DASH set_protocol_handlers ( #271 )
...
fix NameError: name 'masternode_announce_broadcast_1_0' is not defined
2017-09-21 09:32:42 +08:00
Luke Childs
0e6b59eb92
Add ALLOW_ROOT option ( #268 )
...
* Add ALLOW_ROOT option
* Document ALLOW_ROOT option
* Update controller.py
* Update ENVIRONMENT.rst
2017-09-20 08:14:06 +08:00
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
2017-09-09 22:00:54 +09:00
Justin Turner Arthur
0c2e5c6368
Minor optimizations to Bitcoin tx processing ( #214 )
...
* Construct unpacking functions for byte format up front to save time
wasted on parsing format string every iteration.
* Store length ahead of time as the overhead adds up.
* Reduce object attribute lookups in hash functions.
* Clean up lib pkg API changes. Unit test new "public" API members.
Underscore prefix for internal hash module funcs. Make bytes.fromhex a
public function.
* Document recent performance findings.
2017-09-09 11:06:46 +07:00
Neil Booth
8cfa42ed9c
Prepare 1.1
2017-09-09 10:51:43 +09:00
Neil Booth
2f69aaa487
Remove dead code
2017-09-09 10:39:13 +09:00
Neil Booth
305fd89740
Stop persisting peers; resdiscover on restart
2017-09-08 17:39:48 +09:00
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.
2017-09-08 17:31:46 +09:00
Neil Booth
9dd5541f82
RPCError has msg member, not message
2017-09-08 17:02:37 +09:00
Neil Booth
f723455992
Prepare 1.1pre2
2017-09-08 11:28:23 +09:00
Neil Booth
4f5a219438
Dash: return errors in JSON error field for protocol 1.1
2017-09-08 11:09:30 +09:00
Neil Booth
06693c5880
Fix handling of failed transaction broadcast
2017-09-08 10:55:09 +09:00
Neil Booth
794e1d86ff
Peerdisc: handle protocol 1.1 server.version replies
2017-09-07 17:03:17 +09:00
Neil Booth
c1c4906fba
Prepare 1.1pre1
2017-09-07 14:16:22 +09:00
Neil Booth
3cc5b5ea43
Make COIN env variable mandatory.
...
- make a clean split between the Cash and Segwit flavours of bitcoin
by giving them their own COIN names. They can then both have a NET
of mainnet.
- The previous Bitcoin COIN names no longer exist, and the env var is
now mandatory, so everyone will need to set COIN and NET appropriately
for their flavour of bitcoin and mainnet or testnet.
2017-09-07 13:53:44 +09:00
Neil Booth
2684f3b888
Require protocol_version to be given if >= 1.1
2017-09-07 13:20:39 +09:00
Neil Booth
09783aeacc
Accept protocols down to 0.9 for Electrum 1.x clients
...
Fixes #248
2017-09-07 13:13:47 +09:00
Neil Booth
2a955a922a
Improved handler handling
...
- move server.donation_address to the session from controller
- session controls handler map, no longer lives partly on controller
2017-09-07 13:13:34 +09:00
Neil Booth
a978ca6df7
Permit HOST to be a comma-separated list.
...
Update documentation to match.
2017-09-06 20:19:59 +09:00
Neil Booth
37c15f7018
Show protocol version in sessions RPC call
2017-09-06 18:14:52 +09:00
Neil Booth
f2f2b1e7b6
Update protocol documentation
2017-09-06 17:56:23 +09:00
Neil Booth
9c25685eb9
Handle client protocol range requests.
...
Add more tests.
2017-09-06 17:11:18 +09:00
Neil Booth
e7601a23cd
Implement other address methods for scripthash
2017-09-06 16:41:14 +09:00
Neil Booth
135ab68f74
Simple protocol negotiation and setting of handlers
...
It turns out clients pass 0.10 instead of 1.0 as the protocol version.
Distinguish some handlers for 1.0 and 1.1 protocols.
Log protocol version request
Add tests of new library function
2017-09-06 16:24:56 +09:00
Neil Booth
f8a838c589
Add "hash_function" member to server.features.
...
Update documentation
2017-08-26 15:37:59 +09:00
Neil Booth
137236712f
Add EVENT_LOOP_POLICY environment variable
...
Based on #215 by JustinTArthur.
- Accept EVENT_LOOP_POLICY of uvloop
- Move initilisation from electrumx_server to controller
- SocksProxy now requires a loop
- Update tests
2017-08-26 14:03:02 +09:00
Neil Booth
1f3e942cbc
Some further cleanup
2017-08-26 12:47:47 +09:00
John L. Jegutanis
885872f0b5
Various improvements ( #233 )
...
* Fix formatting
* Refactor daemons
Replaced FujiDaemon with FakeEstimateFeeDaemon that simulates estimate
fee calls and provide the same functionality.
Removed the parameter False for LegacyRPCDaemon's getblock RPC call as
it is not needed.
* Fix Crown coin P2SH_VERBYTES and add REORG_LIMIT
2017-08-26 12:33:20 +09:00
Neil Booth
d324bdc0d1
Prepare 1.0.17
2017-08-21 23:41:30 +09:00
Neil Booth
fab3f5affe
Have proxy.create_connection use kwargs
...
Fixes #227
2017-08-21 23:38:54 +09:00
Neil Booth
7442bad66c
Prepare 1.0.16
2017-08-21 20:52:02 +09:00
Neil Booth
4d2456e4b4
Explicitly bind to both IPv4 and IPv6.
2017-08-21 20:07:08 +09:00
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
2017-08-21 05:47:05 +07:00
Kefkius
59d8421c87
Fix KeyError on incorrect genesis hash ( #224 )
...
Fix KeyError that occurs when creating an exception for an incorrect genesis hash.
2017-08-20 05:31:55 +07:00
FujiCoin
b4ac4b6a05
Add Fujicoin ( #218 )
...
* Add Fujicoin
* Add explanation of FujiDaemon
2017-08-18 15:05:54 +07:00
sam
5b475751f1
Correct 'seessions' (sessions) ( #220 )
2017-08-13 07:29:20 +07:00
Neil Booth
92ba67037f
Use None instead of localhost
...
See #211 . Some don't have localhost mapped, and
we should also bind to IPv6 interfaces.
Thanks to gaoyaxing24 for testing.
2017-08-02 16:54:58 +09:00
Justin Turner Arthur
28764936c4
Remove semicolons and a couple unused variables. ( #212 )
2017-08-02 15:55:44 +09:00
Neil Booth
23b121e799
Prepare 1.0.15
2017-07-30 21:38:51 +09:00
Neil Booth
75feac5d1e
Check prior header hashes to detect forks
2017-07-30 21:32:41 +09:00
Neil Booth
3eef0ba4cf
Rename block_full to block.
...
Retain the raw block in the named tuple.
2017-07-30 20:41:08 +09:00
Neil Booth
d593dd2c6e
Prepare 1.0.14
2017-07-23 14:57:02 +09:00
Neil Booth
2ade5fce9c
Revert "More logical mempool hash handling"
...
This reverts commit 87d24f38dc .
2017-07-23 14:55:03 +09:00
Neil Booth
7abde2e514
Prepare 1.0.13
2017-07-21 12:40:37 +09:00
Neil Booth
87d24f38dc
More logical mempool hash handling
...
Fixes the issue whereby notifications weren't sent as long as new blocks
kept coming in. Now a new height notification, with an appropriate mempool
update, is sent after each batch of blocks is processed.
2017-07-19 23:50:44 +09:00
Neil Booth
3f9e2363c2
Prepare 1.0.12
2017-07-16 15:07:13 +09:00
Neil Booth
4665ba6315
Improve daemon JSON RPC compatibility
...
- give an ID to each request
- allow client session to be customized by derived classes
Based on changes suggested by erasmospunk
2017-07-13 10:51:54 +09:00
Neil Booth
858bac217d
Move DB UTXO code into one place.
2017-07-10 14:12:27 +09:00
Neil Booth
2f26e81629
Implement history compression with tests.
...
Still to do: running compression in background when the flush
count reaches a certain level
2017-06-18 22:59:30 +09:00
Neil Booth
2940ea3199
Add new function get_history_txnums
2017-06-17 16:33:15 +09:00
John L. Jegutanis
1e9a65dccb
Handle legacy daemon RPCs
...
Add support for daemons that don't have the new 'getblock' RPC call that
returns the block in hex, the workaround is to manually recreate the block
bytes. The recreated block bytes may not be the exact ones as in the
underlying blockchain but it is good enough for our indexing purposes.
2017-06-11 01:37:45 +03:00
Neil Booth
0cf4210a66
Prepare 1.0.11
2017-06-07 23:47:18 +09:00
Neil Booth
4cc3720589
Disable IRC for bitcoin mainnet
...
Only require IRC_CHANNEL if IRC_PREFIX is given.
2017-06-07 23:47:17 +09:00
Neil
d9ff685958
Merge pull request #183 from thelazier/dash_mn_methods
...
Add support for Dash Masternode methods
2017-05-16 19:02:17 +07:00
Neil Booth
08dbbf217a
client_version must be a tuple
...
Fixes #180
2017-05-16 14:55:19 +09:00
TheLazieR Yip
2e87d49e04
Add more comment on DashElectrumX.server_version
2017-05-15 08:10:09 +00:00
TheLazieR Yip
e99400c225
Update DashElectrumX as commented
2017-05-15 04:12:33 +00:00
TheLazieR Yip
4da2278729
Force server string response for Electrum-Dash 2.6.4 client
2017-05-14 17:38:55 +00:00
TheLazieR Yip
f179c67935
Add support for Dash Masternode methods
...
+ Add DashDaemon class
+ Add DashElectrumX class
+ Update coin configurations for Dash
2017-05-14 16:36:02 +00:00
TheLazieR Yip
b0e23e903d
Allow custom ElectrumX class
2017-05-14 16:26:17 +00:00
Neil
325097f0e6
Merge pull request #176 from erasmospunk/allow-customizations
...
Allow custom Daemon and BlockProcessor classes
2017-05-07 19:42:25 +07:00
John L. Jegutanis
a4e4f80ad7
Allow custom Daemon and BlockProcessor classes
2017-05-07 14:22:23 +02:00
LaoDC
9e34bf8583
reverted and made the version split isolated within the banner logic only as not to affect other parts of the code.
2017-05-03 17:43:47 +07:00
LaoDC
9dceeb914c
Add new variables to BANNER(_TOR)
...
$SERVER_VER will return the version number (eg: 1.0.10)
$SERVER_SUBVERSION will return the full version string (eg: ElectrumX 1.0.10)
$VERSION is kept for legacy which is the same as $SERVER_SUBVERSION
2017-05-03 17:10:52 +07:00
LaoDC
5e92feb8a6
Add new variables to BANNER(_TOR)
...
$SERVER_VER will return the version number (eg: 1.0.10)
$SERVER_SUBVERSION will return the full version string (eg: ElectrumX 1.0.10)
$VERSION is kept for legacy which is the same as $SERVER_SUBVERSION
2017-05-03 17:09:52 +07:00
Neil Booth
2fe67932c5
Prepare 1.0.10
2017-04-28 22:44:48 +09:00
Neil Booth
e9acb685ab
Display hosts in diagnostic
2017-04-09 14:32:45 +09:00
Neil Booth
d216d5111b
Prepare 1.0.9
2017-04-09 14:20:17 +09:00
Neil Booth
8a2821d542
Reject invalid hostnames in Env
2017-04-09 14:15:10 +09:00
Neil Booth
b6d8b86dd6
Ignore hosts not appearing in their own features
2017-04-09 14:02:32 +09:00
Neil Booth
c0ff2c0c20
Bump to 1.0.8b
2017-04-06 07:36:04 +09:00
Neil Booth
f3de91180e
Add tests for server/env.py
2017-04-06 07:27:48 +09:00
Neil Booth
30df09534f
Bump to 1.0.8a
2017-04-03 21:40:02 +09:00
Neil Booth
2c43e89b05
Only set last_good if successfully verified
...
Rename last_connect to last_good
2017-04-03 21:37:51 +09:00
Neil Booth
e0a79c313c
Prepare 1.0.8
2017-04-03 20:13:35 +09:00
Neil Booth
7b17d99c5a
Put log on one line
2017-04-03 20:10:42 +09:00
Neil Booth
9f27ea875c
Fix peer replacement logic
...
- drop the IP address peer
- update the remaining peer with fresh info
2017-04-03 20:07:46 +09:00
Neil Booth
2656fd78a4
Clarify that we may not have a clearnet peer
2017-04-02 21:25:02 +09:00
Neil Booth
e96b8f0421
Prepare 1.0.7
2017-04-02 15:12:50 +09: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
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.
2017-04-02 14:27:49 +09:00
Neil Booth
178de6c396
Tighten restrictions on HOST
...
- private IP not allowed if intending for public use
- localhost not allowed
2017-04-02 10:58:55 +09:00
Neil Booth
81e6577838
Catch address resolution failure exceptions
2017-04-01 22:55:16 +09:00
Neil Booth
321315ace0
Fix typo
2017-04-01 15:17:17 +09:00
Neil Booth
d1894356d0
Prepare 1.0.6
2017-04-01 12:10:18 +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
abba36ac6c
Relax the get_chunk restriction based on client
...
Closes #162
2017-04-01 11:17:57 +09:00
Neil Booth
55cedfea9c
Have Daemon work with aiohttp 1 and 2
...
Fixes #163
2017-04-01 10:43:34 +09:00