Commit graph

29 commits

Author SHA1 Message Date
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
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
5e9b659f81
some nits 2019-11-17 11:10:41 +02:00
Calin Culianu
04c4d5d5b7
Squashed commit of the following:
commit 326de9f8e9670ace95d6044e4f2d36a697a78ef9
Author: Calin Culianu <calin.culianu@gmail.com>
Date:   Wed Nov 13 11:27:23 2019 +0200

    fix apple compiler check

commit f794b3df1dda0c8b7df3c587688b8182a0de029d
Author: Calin Culianu <calin.culianu@gmail.com>
Date:   Wed Nov 13 11:12:01 2019 +0200

    added guard for msc_ver which doesn't support #warning

commit 04fbc36bbb40cbcc926e504f2109d766d2335113
Author: Calin Culianu <calin.culianu@gmail.com>
Date:   Wed Nov 13 11:06:12 2019 +0200

    Fix for win32-g++ compilation

commit a79b38b13da03ae741d81ca5a1a7978f9c09d961
Author: Calin Culianu <calin.culianu@gmail.com>
Date:   Wed Nov 13 10:49:33 2019 +0200

    Beat project into sunmission to compile on Linux using clang
2019-11-13 11:32:52 +02:00
Calin Culianu
a34585da1b
Added BitcoinD classes.. lord help me.
Also "upgraded" the universal ID we use for all objects to use quint64
(unsigned) rather than signed, and the "NO_ID" is 0.
2019-11-12 22:14:04 +02:00
Calin Culianu
0d0f41c2f5
Changed the way timestamps are printed in the log 2019-11-11 11:55:10 +02:00
Calin Culianu
b2b2509f25
Got HttpConnection working and talking to bitcoind
It works!  I still haven't figured out how to provoke the dreaded
"Workdepth exceeded" error .. but we pretty much drop the connection
anyway on anything too unexpected from bitcoind.

When the bitcoind manager class is written it will back off and try
again if too many disconnects happen.

For now though, the code we have is fast and works well against
bitcoind.
2019-11-11 00:22:31 +02:00
Calin Culianu
45daaf6e91
some nits 2019-11-09 21:14:07 +02:00
Calin Culianu
cd643e7323
Made Message::Id type a std::variant
I restricted the possible underlying types it can contain down to
qint64, QString, and nullptr_t. This should make it more type safe since
we don't want it to inadvertently end up holding lists or maps
(previously it was a straight up QVariant).

It has a conversion to QVariant so it should work nicely.
2019-11-09 01:55:48 +02:00
Calin Culianu
724d7d3366
Refactorings 2019-11-08 17:11:58 +02:00
Calin Culianu
8898e5c9ba
Fixed /stats endpoint 2019-11-08 03:15:47 +02:00
Calin Culianu
43b7e915c4
Got rid of more ShuffleUp stuff, added CLI args 2019-11-07 23:55:13 +02:00
Calin Culianu
b22f81a463
Minor removal of old references to ShuffleUp 2019-11-04 00:41:47 +02:00
Calin Culianu
01d8d01ccd Added stats HTTP server. Also refactored TcpServer 2019-05-09 02:12:58 +03:00
Calin Culianu
31b891c006 hooked controller object in to app startup 2019-05-04 06:00:01 +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
b84bcbd8b5 Added Linux compile fixups. Also a check that the endianness in bitcoin:: is ok. 2019-05-01 18:19:17 +03:00
Calin Culianu
24b8e992b5 initial schema impl 2019-04-29 10:01:58 +03:00
Calin Culianu
2547dc35cb Added SysLogger for -S option which actually uses unix syslog()
On Windows it still prints to console, however (without timestamps).

Note that syslog mode doesn't produce any debug output even if -d is
specified (at least on macOS) -- probably the sysadmin needs to
enable debug logging.
2019-04-27 16:00:58 +03:00
Calin Culianu
5ccef909af Nits and refactoring of RunInThreads app exit handling 2019-04-27 14:55:10 +03:00
Calin Culianu
9366b6a244 trivial nit 2019-04-27 12:52:29 +03:00
Calin Culianu
631a3e5cf7 Windows: Fixups to handle signals CTRL-C on windows 2019-04-27 12:48:48 +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
56103a9299 Refactoring nits. Put default Options in Options.h rather than Common.h 2019-04-26 09:02:53 +03:00
Calin Culianu
2477a7a8a3 Added initial TcpServer stub implementation
- Already supports listening on as many sockets as you wish
- Each listening server has its own thread
- Will implement later: SSL server

Also refactored code a bit, created the generic "Controller" class, made
EXMgr and SrvMgr inherit from it.

ToDo: Figure out workflow for connections and clients, model client
sessions, etc.
2019-04-26 08:47:46 +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
Calin Culianu
57148960c4 Added some command line options and a command line parser 2019-04-23 23:26:07 +03:00
Calin Culianu
4637012e22 Added more EXClient stuff 2019-04-23 12:36:51 +03:00
Calin Culianu
62101beeac Initial revision. Just laying out a skeleton to build on. 2019-04-23 02:33:16 +03:00