Commit graph

20 commits

Author SHA1 Message Date
Calin Culianu
713d2d714f
Fix for FulcrumAdmin query comment not formatting amounts properly
Oops. Fixed.
2023-04-08 20:56:55 -04:00
Calin Culianu
7689402ec3
Add the query subcommand to the FulcrumAdmin script. (#166)
This closes #165. It allows the user to use a new `query` verb with `FulcrumAdmin`, 
similar to how it works on elextrumx_rpc.
2023-04-07 20:12:16 -04:00
Calin Culianu
551476f740
Added the 'simdjson' command to the FulcrumAdmin script
This allows one to enable/disable the simdjson parser on the server at
runtime.

Also in this commit: Some tiny nits.
2020-10-26 00:26:54 +02:00
Calin Culianu
a0b596c091
Fixed misuse of units "MiB" and "MB".
The code, comments, and documentation were saying "MiB" (mebibyte, e.g.
2^20) in places when really they meant "MB" (= 1 million bytes).

This inconsistency has been fixed in all code, documentation, and
comments.  I had to rename some JSON keys from `getinfo` but hopefully
this won't break anyone's scripts or code that depend on this esoteric
admin RPC call.

Also in this commit: off-by-1 inaccuracy in computing the LRU num2hash
and height2hashes cache entry sizes.  TxHash actually takes 33 bytes of
memory, not 32 per data item (QByteArray always appends a nul byte).
2020-09-01 00:51:18 +03:00
Calin Culianu
1fe470e819
Added Web Socket support to CLI, conf files, etc
Now it's possible to start Fulcrum with ws://, wss:// support. This
commit contains various changes:

- Added config vars: ws, wss, public_ws_port, public_wss_port,
tor_ws_port, tor_wss_port
- Added CLI options -w/--ws and -W/--wss
- Modified FulcrumAdmin script to show WS & WSS client types
- Modified server name and logger to show WS/WSS clients properly in the
log.
- Updated the man page and the inline comments/documentation in the
example configs.
- Various nits and fixups in the code.
- Fixed a typo or two in documentation.
2020-04-16 02:58:12 +03:00
Calin Culianu
7f4a63321b
FulcumAdmin script: Some small Python nits 2020-03-24 00:02:35 +02:00
Calin Culianu
23979f069f
Added bitcoin_throttle admin command to FulcrumAdmin
See 'FulcrumAdmin -h bitcoind_throttle' for how to use this command.

Also got rid of 'setmaxbuffer' and made 'maxbuffer' both query and
set, depending on if it has args or not.
2020-03-17 21:38:19 +02:00
Calin Culianu
0414968f57
Added the ability to change the server's max_buffer setting at runtime
Also in this commit: Set the default max_buffer back to 4000000.

Now we have the ability to set the max_buffer at runtime.

This is accomplished by two new FulcrumAdmin commands: `setmaxbuffer` for
setting and `maxbuffer` for reading.

The max_buffer will, in future commits, be more aggressively enforced
and clients exceeding it for a long enough period of time will be
kicked.
2020-03-17 14:56:32 +02:00
Calin Culianu
ffcb417d46
FulcrumAdmin: Added better time field formatting
Raw seconds are no longer displayed.. instead the value is tranformed to
minutes, hours, days, months, etc.

Also added an additional column to the clients display, which is the
'Elapsed' column which shows how long a particular client has been
connected.
2020-01-19 10:11:36 +02:00
Calin Culianu
4d13fc42a2
Admin RPC: Added the 'loglevel' command
This can dynamically set the logging verbosity (e.g. toggle 'debug'
logging on/off or 'trace' debugging on/off).
2020-01-16 08:40:04 +02:00
Calin Culianu
9339c23c9d
Admin RPC: Added the 'rmpeer' command, plus a bugfix
The rmpeer command is like a weak banpeer.  It just immediately
disconnects said peer(s) from the server and/or deletes their entries
from the internal peers table.  However, unlike banpeer, the peer is not
banned and thus it may come back at any time in the future if our other
peers tell us about it.

rmpeer's primary usecase is intended for admins to remove defunct seed
peers from the peer list, or to undo a previous badly-inputted 'addpeer'
command.

Also in this commit: It occurred to me that our policy of purging
"Failed" peers after 24 hours of being failed has an edge case that is
not good: Namely the running server may lose internet connectivity for
24 hours without the operator noticing or restarting it.  When the
server finally has connectivity again -- it will have purged all its
failed peers.. including the seed peers.  This is not a good situation,
since now the server has no "lifeline" to the outside world and cannot
announce itself to other servers.

To mitigate this, we simply never purge the seed peers (the ones in
servers.json) from our tables and will retry them indefinitely forever.
This has very little downside, and mitigates the pathological case where
the outside world goes away and comes back again after 24 hours.
2020-01-16 07:59:23 +02:00
Calin Culianu
a324d85ce0
Admin RPC: Added the 'addpeer' command
Basically enqueues the peer immediately if not already in the peer list.
If this is an "update" to an existing failed peer, it will update the
port info and the app will try again in ~10 mins.

If the peer already exists and is already valid and connected, then the
addpeer request is silently ignored (even if the ports specified on CLI
differ).

Coming soon: 'rmpeer' to explicitly delete peers (but not ban them)
2020-01-16 07:02:54 +02:00
Calin Culianu
d7d5c8eeda
Fixed FulcrumAdmin script to read data correctly
The python side had a bug in reading from the socket.  Fixed.
2020-01-15 15:45:28 +02:00
Calin Culianu
ed12f2dc5d
Admin: Implemented banpeer unbanpeer, plus some tweaks
Refactored the code a bit.  Banning peeers is hostname-suffix-based so
some.server.com is the same as *.some.server.com internally.  This works
well in practice if a little confusing for users.

The admin script has been updated slightly too.

Also this commit has some internal refactorings and nits.
2020-01-15 14:41:37 +02:00
Calin Culianu
152a43b283
Some tweaks to output for the peers command in FulcrumAdmin 2020-01-15 09:34:04 +02:00
Calin Culianu
3d75aefea4
Added formatting for the 'peers' command to FulcrumAdmin
Also removed some dead code from PeerMgr.cpp -- it turns out we don't
use that 'sharedPeers' list.  So we got rid of the mutex and the shared
list.
2020-01-15 01:43:52 +02:00
Calin Culianu
d64ac03e61
Fixed Linux build
Also added beginnings of peer management admin RPC
2020-01-14 23:53:34 +02:00
Calin Culianu
757e07a7d4
Added Admin RPC commands: ban, unban, & listbanned
These work by-IP only currently.  Hostname banning is trickier (involves
DNS lookups, etc) and may not be required for client banning.

IP banning doesn't affect peering yet. That will be added in a
subsequent commit.
2020-01-14 23:14:05 +02:00
Calin Culianu
1a92c6fe53
Added 'kick' Admin RPC command
Kick clients by ID or by IP address.  Accepts multiple arguments on the
command-line (may be a mixed IP address/ID).  Because it accepts
multiple arguments, it's compatible with things like e.g. xargs on the
CLI.
2020-01-14 15:49:54 +02:00
Calin Culianu
5fa384d2be
Added FulcrumAdmin Python script, and a few commands, see -h for help
'clients' (sessions) output looks decent enough! :D
2020-01-14 14:55:55 +02:00