Commit graph

23 commits

Author SHA1 Message Date
Calin Culianu
89aeb474c5
WIP: playing with dling data from bitcoind in Controller class 2019-11-18 20:29:21 +02:00
Calin Culianu
f4091bb005
Devised a scheme for asynch messaging to bitcoind
And added some test code in Controller to use the scheme.

It's very asynchronous.  Needs some tuning long term to see how it deals
with load and perhaps throttle the requests if we know bitcoind is under
load.

But for right now, for testing, it should work ok.

Also in this commit small nits, plus bugfix to RPC::Message factory
methods (I forgot to populate some instance properties when constructing
the objects).

Additionally, we were registering the qMetaType wrong for RPC::Message
and RPC::Message::Id (this has been fixed).
2019-11-18 14:32:48 +02:00
Calin Culianu
0b6d6f0b70
Initial detection of bitcoinDs going up/down for Controller
Playing with lambdas. Detects when bitcoind goes down. Initial code --
can put hooks in the detection for eg. stopping block processing or
starting it, etc.
2019-11-18 09:47:18 +02:00
Calin Culianu
45e12158db
Added process function to controller, and hooks for bitcoind when ready
Also added the "Fatal" logging class which logs as Error but then
schedules an app exit when invoked.  Only to be used for truly terrible
errors.
2019-11-18 08:29:33 +02:00
Calin Culianu
742cee4090
a nit 2019-11-18 00:34:24 +02:00
Calin Culianu
c0ea7f75a0
Refactored things, added "Controller" class
Controller will manage BitcoinD and perhaps synching to bitcoind. It can
"see" all the servers as well as bitcoind.

Also refactored things a little bit and added some more startup sanity
checks.
2019-11-18 00:21:34 +02:00
Calin Culianu
43b7e915c4
Got rid of more ShuffleUp stuff, added CLI args 2019-11-07 23:55:13 +02:00
Calin Culianu
01d8d01ccd Added stats HTTP server. Also refactored TcpServer 2019-05-09 02:12:58 +03:00
Calin Culianu
386383d6d4 Made our JSON-RPC 2.0 implementation more closely match the spec
- It's still a little more restrictive than the spec allows -- doesn't
like non-positive-int 'id'
- We not made the shuffle.spec status report back 'notifications' to the
client rather than repeated 'result' messages (as those would be out of
spec). The first response to a 'shuffle.spec' request is either
result="pending", result="accepted", or an error response
- Subsequent shuffle.spec status changes come as a method notification
for "shuffle.spec" with params=["accepted"] or params=["some error
message"]

Overall I think our bare bones JSON-RPC will at least not break now as
interop with other impls.
2019-05-06 14:34:42 +03:00
Calin Culianu
212eb1169b Implemented onNewBlockHeight
- We check the address unspent cache and do cache upkeep
- Various other nits and corner cases handled in this commit
2019-05-05 12:45:26 +03:00
Calin Culianu
b40dfbeb20 Added 'CallOnObject' facility 2019-05-05 02:49:56 +03:00
Calin Culianu
0da480f3c5 Got Controller and EXMgr to use the TimersByNameMixin
This mixin should be useful as we move forward
2019-05-05 01:03:23 +03:00
Calin Culianu
e3471d743d nit 2019-05-04 23:32:10 +03:00
Calin Culianu
a0195a9ae0 Made the round-trip shuffle.spec command work and verify utxos
We are like 50% there to milestone 1. Next, implement shuffle logic,
python test client, and tx building/verification.

Who am I kidding.. we are still pretty far away. :)
2019-05-04 22:53:36 +03:00
Calin Culianu
d87720d110 Hooked Controller into more things from exMgr, etc 2019-05-04 16:54:17 +03:00
Calin Culianu
cb5def88a0 hooked the controller in further to tcpserver .. more to do on that front 2019-05-04 09:37:42 +03:00
Calin Culianu
31b891c006 hooked controller object in to app startup 2019-05-04 06:00:01 +03:00
Calin Culianu
f36d7d00c9 added unconfirmed utxo separation in AddressUnspentEntry 2019-05-04 05:13:35 +03:00
Calin Culianu
631b8d3e80 fixed bug in operator< for BTC::Address and BTC::UTXO 2019-05-03 21:39:25 +03:00
Calin Culianu
113efda25a Added spec rpc command from clients to us.. still need to do listunspent 2019-05-03 17:28:51 +03:00
Calin Culianu
8399ee0052 Added BTC::UTXO with tests
Faster encapsulation of UTXOs .. string based.  Copy-on-write.

interops with bitcoin::COutPoint
2019-05-03 14:37:07 +03:00
Calin Culianu
3f49dce1db Added some small goodies
- Util::RunInThread to run a lambda in a thread
- App exit handling cleanup
- EXMgr uses an id for clients now
- EXMgr keeps track of lagging clients
- EXMgr more aggressive with reconnects if no valid exclients
- Nits and refactorings and misc. cleanup
2019-04-27 12:38:50 +03:00
Calin Culianu
e65bacd7fd Petit refactoring
- Made the stale timeout be 2 mins now
- Check clients runs every 1 minute
- Added 'Controller' ABC which EXMgr is one of and the TcpServer will be
another.
2019-04-26 06:23:49 +03:00