Commit graph

18 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
9e07f32e95
Added more stats 2019-11-17 12:38:36 +02:00
Calin Culianu
7e16244609
Nits: Runtime check that classes deriving from QObjectMixin are ok.
added some asserts, plus -DNDEBUG to release build to disable asserts
for release.
2019-11-17 10:59:50 +02:00
Calin Culianu
ca9db3fc8d
Refactored stats stuff into a mixin class, StatsMixin
This makes it so that subobjects that return stats get the "statsSafe()"
function for free (which does a Util::LambdaOnObject).
2019-11-17 00:18:44 +02:00
Calin Culianu
bb7732adec
Some nits 2019-11-16 23:33:40 +02:00
Calin Culianu
dc8d95ee69
Refactoring; made all AbstractConnection inherit TimersByNameMixin
Also wrote a virtual methd 'getStats()' for AbstractConnection which
puts some basic stats into a QVariantMap for the /stats endpoint.

Subclasses can call the base implementation and add their own stats to
the returned map.

Also in this commit: misc refactoring and nits
2019-11-16 22:28:27 +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
7c5cfb8993
More nits and cleanup.
I'm getting a little OCD here..  but it's good. :)
2019-11-12 11:29:45 +02:00
Calin Culianu
7a5f12dcd5
Added some checking to prevent memory exhaustion attacks from EX clients 2019-11-12 00:12:05 +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
6508ea1912
Refactored RPC::Connection to be a little bit transport agnostic
This allows it to talk to things like bitcoind. It still wants a tcp
socket as its transport -- but it can at least now be wrapped in HTTP
for bitcoin as well as re-use of the same code for ElectronX style
linefeed based JSON.

Our RPC lib is nowhere near 100% generic and re-usable but it's a good
first step here with this refactor job.
2019-11-09 17:06:40 +02:00
Calin Culianu
4ef96a9ae5
more nits 2019-11-09 14:17:32 +02:00
Calin Culianu
e07f7be562
Added support for "named" (kwargs) params. Eg "params" : { .. }
This should hopefully fully complete our implementation to support
JSON-RPC 2.0 without batching.  We still are missing batching but at
least now we implement the non-batching portion of the spec more
completely.
2019-11-09 13:08:36 +02:00
Calin Culianu
1dc1373922
nit 2019-11-09 03:30:10 +02:00
Calin Culianu
20066bff04
Put the JSON RPC error codes in an enum, and used it 2019-11-09 03:26:21 +02:00
Calin Culianu
81a323f9c0
Nits and fixups for "Server" class
Put its rpc dispatch tables in a "StaticData" namespace
2019-11-09 00:04:28 +02:00
Calin Culianu
724d7d3366
Refactorings 2019-11-08 17:11:58 +02:00
Renamed from TcpServer.cpp (Browse further)