Commit Graph

43 Commits

Author SHA1 Message Date
Riccardo Casatta
add53ebfa1
internal loop for client re-creation, keeping the lock 2020-11-24 15:50:09 +01:00
Riccardo Casatta
ef3ddfdabc
Pass Arc<io::Error> to waiting threads 2020-11-24 13:46:20 +01:00
Riccardo Casatta
f200b7fc61
Implements retry, timeout, socks credential and others fixes
Retry works by checking if an non-protocol error happened during the call, if so an attempt to take a write lock on the client is made and a new client attempted
if both operationare succesfull the old_client is substituted with the new one.

Timeout is a single parameter for connect,read and write TCP timeouts, special handling is required for the following situation: cannot set a timeout with a proxy and cannot set timeout with multipl SocketAddrs

Since configurations parameter grow, a Config struct with a builder has been introduced

Some new errors variant has been introduced

Errors in reading input in the reader thread now warns other eventual threads with ChannelMessage::Error

Add github actions equivalent to travis cause travis is slow
2020-11-24 12:03:51 +01:00
Nadav Ivgi
c1f4e9d76d
Allow to initialize SSL clients with an existing TcpStream 2020-11-07 03:15:07 +02:00
Alekos Filini
11c2b1b6ce
Release 0.3.0-beta.1 2020-09-30 11:28:58 +02:00
Riccardo Casatta
6f8cefd1f1
bump bitcoin version to 0.25 2020-09-30 10:23:51 +02:00
Alekos Filini
5a5fdca348
Fix conditional imports of client::* 2020-08-03 11:18:23 +02:00
Alekos Filini
3502a5c7ab
Release 0.2.0-beta.2 2020-08-03 10:18:13 +02:00
Riccardo Casatta
d5e4bfe3e7
allow Client with openssl+proxy 2020-07-31 17:58:11 +02:00
Alekos Filini
335fd49eb5
Add extra test + minor refactoring 2020-07-16 14:06:54 +02:00
Riccardo Casatta
110fff5d4f
remove from waiting_map also in case of errors 2020-07-16 14:06:51 +02:00
Alekos Filini
f9b318c1c6
New interface 2020-07-16 14:06:49 +02:00
Alekos Filini
db4554f9e2
Test against mainnet servers 2020-07-16 14:06:25 +02:00
Alekos Filini
f37bcd59e0
New multithreaded model
This new model is based on the idea of having only one thread monitor the socket and then
distribute the responses to every other thread that's waiting.

Whenever a request is made, a new mpsc channel is created and added to an internal map.
Then, if there are not other threads waiting for pending responses, that thread will
become the "reader thread" and monitor the socket until it receives the response it was
waiting for. In the meantime, if it sees responses coming on the socket with different
ids, it will lookup the correct Sender from the internal map and send that message to
the thread that created the request in the first place.

The other threads will be waiting trying to read from their Receiver, where they will
either get the message in response to their request, or a signal to wake up and
become the new "reader thread".
2020-07-16 14:06:13 +02:00
Alekos Filini
7b4e99e80c
Revert "Move to async I/O with Tokio"
This reverts commit e1dbfd7ceb.
2020-07-09 16:11:52 +02:00
Alekos Filini
2a9278879f
Revert "Fix the internal Tokio runtime for sync methods"
This reverts commit 33f4ea2e51.
2020-07-09 16:11:33 +02:00
Alekos Filini
33f4ea2e51
Fix the internal Tokio runtime for sync methods 2020-04-14 14:55:46 +02:00
Alekos Filini
e1dbfd7ceb
Move to async I/O with Tokio 2020-04-09 10:21:38 +02:00
Alekos Filini
686aafce41
Release 0.1.0-beta.6 2020-04-01 10:50:12 +02:00
Riccardo Casatta
396ab8ea57
add broadcast_transaction_raw and fix docs 2020-04-01 10:44:45 +02:00
Riccardo Casatta
e26ed29ee8
add raw methods for transactions and headers 2020-03-24 15:27:06 +01:00
Alekos Filini
c240adcd1d
Merge remote-tracking branch 'RCasatta/par_u32' 2020-03-15 15:19:20 +01:00
Alekos Filini
98b70e4791
Merge remote-tracking branch 'RCasatta/other_batches' 2020-03-15 15:14:46 +01:00
Riccardo Casatta
0eb74e6176
Add Param::U32 2020-03-14 17:35:10 +01:00
Riccardo Casatta
3a360e4d46
add batch_block_header and fix batch_transaction_get 2020-03-13 09:35:25 +01:00
Riccardo Casatta
cccb808e6f
add optional fee in get_history result 2020-03-10 18:53:17 +01:00
Alekos Filini
79bae1a90d
Release 0.1.0-beta.5 2020-03-05 17:22:20 +01:00
Alekos Filini
73ce9dc2db Merge remote-tracking branch 'RCasatta/deser_header' 2020-03-01 18:06:18 -08:00
Riccardo Casatta
e27d82d702
deserialize block header with custom serde deserializer 2020-02-26 20:19:34 +01:00
Riccardo Casatta
60321b9807
Add estimate_fee to batch methods 2020-02-26 20:04:59 +01:00
Alekos Filini
7b37037e79
Release 0.1.0-beta.4 2020-02-12 14:36:25 +01:00
Alekos Filini
decb954086
Merge #6: "add crate and travis badges" 2020-02-12 14:35:11 +01:00
Riccardo Casatta
4676f8d421
add crate and travis badges 2020-02-12 09:50:15 +01:00
Alekos Filini
68cd825b16
Take a bool for SSL domain validation 2020-02-11 18:12:41 +01:00
Alekos Filini
6ef3da97ff
Release 0.1.0-beta.3 2020-02-11 12:48:47 +01:00
Alekos Filini
c52f6629ba
Refactor streams 2020-02-10 18:17:11 +01:00
Alekos Filini
2694c22e12
Generalize the interface 2020-02-10 18:17:08 +01:00
Riccardo Casatta
3ef1a6d8cd
Update lib.rs 2020-02-10 18:15:32 +01:00
Alekos Filini
5e95c44b04
Release 0.1.0-beta.2 2020-02-10 14:55:44 +01:00
Alekos Filini
a7ec4ce5fd
Add docs 2020-02-10 14:45:01 +01:00
Riccardo Casatta
496fa2cea6 derive Debug trait for Client 2020-02-10 14:10:19 +01:00
Alekos Filini
40d78e4027
Release 0.1.0-beta.1 2020-02-06 18:15:22 +01:00
Alekos Filini
ec45e909c7
Initial commit 2020-02-06 17:54:27 +01:00