Commit Graph

264 Commits

Author SHA1 Message Date
moneromooo-monero 679a5ab85b
daemon: print estimated tx backlog in print_pool_stats 2017-08-23 12:12:06 +01:00
moneromooo-monero 42b34b3545
Consistently print peer id in hex and on 16 chars 2017-08-16 10:56:55 +01:00
moneromooo-monero 2ec15a6931
daemon: print peers' top height in sync_info 2017-08-12 20:36:31 +01:00
Riccardo Spagni 6db8a60a18
Merge pull request #2149
158c3ecf core: thread most of handle_incoming_tx (moneromooo-monero)
f57ee382 cryptonote_protocol: retry stale spans early (moneromooo-monero)
90df52e1 cryptonote_protocol: light cleanup (moneromooo-monero)
84e23156 cryptonote_protocol: avoid spurious SYNCHRONIZED OK messages (moneromooo-monero)
5be43fcd cryptonote_protocol_handler: sync speedup (moneromooo-monero)
2017-08-07 15:24:58 +02:00
moneromooo-monero 5be43fcdba
cryptonote_protocol_handler: sync speedup
A block queue is now placed between block download and
block processing. Blocks are now requested only from one
peer (unless starved).

Includes a new sync_info coommand.
2017-08-07 09:33:04 +01:00
moneromooo-monero d37e8f8868
daemon: add average seconds per block in bc_dyn_stats 2017-07-29 18:43:50 +01:00
Riccardo Spagni c0f155d3a0
Merge pull request #2170
c3bb6bec daemon: fix status in command line mode if using restricted rpc (moneromooo-monero)
2017-07-19 11:51:35 +02:00
moneromooo-monero c3bb6becd9
daemon: fix status in command line mode if using restricted rpc 2017-07-13 10:17:57 +01:00
Howard Chu 8db68a57f5
Fix #2164 histogram output
When there are more than 50txs, the timestamp for the last
bin was printed incorrectly. Subtracting "now" was omitted by mistake
in 3fc22e7b78
2017-07-10 15:51:03 +01:00
Howard Chu 3fc22e7b78
Add histogram to poolstats 2017-06-04 22:48:14 +01:00
Howard Chu 5414970dcd
Speedup print_pool_stats
Since we're just counting txs, there's no reason to deserialize all the blobs.
2017-06-01 17:34:03 +01:00
Riccardo Spagni 9ed496bbc5
Merge pull request #1956
eb20f720 daemon: print average fee per byte in print_pool_stats (moneromooo-monero)
37be70bb daemon: add fee/byte when print pool transaction info (moneromooo-monero)
893f5a30 tx_pool: add blob size and fee/byte when logging a new tx (moneromooo-monero)
2017-04-11 00:34:46 +02:00
moneromooo-monero eb20f7209e
daemon: print average fee per byte in print_pool_stats 2017-04-04 19:00:57 +01:00
moneromooo-monero 37be70bbd7
daemon: add fee/byte when print pool transaction info 2017-04-04 09:04:39 +01:00
moneromooo-monero 548075b1f5
daemon: new relay_tx command and RPC 2017-04-02 12:17:35 +01:00
moneromooo-monero c94f8facf5
daemon: better error reporting in commands 2017-03-21 19:21:00 +00:00
moneromooo-monero d5fbfd677c
daemon: fix missing close parenthesis in alt_chain_info output
Reported by assylias_ on IRC
2017-03-18 19:19:32 +00:00
moneromooo-monero 63d7cd8882
daemon: alt_chain_info now prints fork depth 2017-03-18 16:59:57 +00:00
kenshi84 7d07c64fe5
fix dependency: put HardFork back to cryptonote_basic, made some BlockchainDB functions virtual again to avoid missing symbols error 2017-03-10 11:22:39 +09:00
Riccardo Spagni 9e10fac223
Merge pull request #1814
11a00df6 daemon: fix bc_dyn_stats via rpc (moneromooo-monero)
2017-03-03 14:14:51 +02:00
Riccardo Spagni 3787ffca80
Merge pull request #1804
12adb4a3 core: move hardfork back to cryptonote_core (moneromooo-monero)
2017-03-03 14:11:09 +02:00
moneromooo-monero 11a00df699
daemon: fix bc_dyn_stats via rpc 2017-02-26 23:12:55 +00:00
moneromooo-monero 12adb4a3f3
core: move hardfork back to cryptonote_core
should fix a cross dependency betewen cryptonote_basic and
blockchain_db
2017-02-25 16:41:35 +00:00
moneromooo-monero ea873ceb2c
daemon/rpc: updates command and RPC
subcommands "check", "download", and "update".
update is not yet implemented.
2017-02-24 23:18:27 +00:00
Miguel Herranz 3bdda60f3e Add print_pl_stats daemon command 2017-02-23 18:20:17 +01:00
Riccardo Spagni c3599fa7b9
update copyright year, fix occasional lack of newline at line end 2017-02-21 19:38:18 +02:00
Dion Ahmetaj 69ab14d91e More robust battery status handling.
Added an extra path to check for linux power supply status.
Added ignore battery option. If set to true, then when we can't figure out
the power status, we'll assume the system is plugged in.
2017-02-16 14:35:01 -05:00
Dion Ahmetaj ad95e65028 Added a note about smart mining to status command. Fixed up a bug where I was resetting bg mining enabled instead of started. Upped the miner threshold. Also moved setting of enabled on start above miner thread creation since starting with true, then stopping, then starting with false resulted in race condition. 2017-02-10 18:07:43 -05:00
Dion Ahmetaj 345ed4823c Background/smart mining. If a users' computer is plugged into a power
source, and CPU has been idle for some time, then begin mining to some
threshold (don't destroy the users' CPU).

This patch only supports windows and linux (I've only tested on Win64 and
Ubuntu).

The variables currently default to pretty conservative values (i.e. 20%
CPU mining threshold).
2017-02-10 18:07:39 -05:00
Riccardo Spagni eacf2124b6 Merge pull request #1689
ce7fcbb4 Add server auth to monerod, and client auth to wallet-cli and wallet-rpc (Lee Clagett)
2017-02-11 00:35:25 +02:00
Riccardo Spagni 4feaa790e2
Merge pull request #1680
db0a5392 Clarify in/out connections for users (NanoAkron)
2017-02-11 00:21:12 +02:00
kenshi84 8027ce0c75 extract some basic code from libcryptonote_core into libcryptonote_basic 2017-02-08 22:45:15 +09:00
Lee Clagett ce7fcbb4ae Add server auth to monerod, and client auth to wallet-cli and wallet-rpc 2017-02-06 01:15:41 -05:00
NanoAkron db0a5392a5
Clarify in/out connections for users 2017-02-05 11:15:51 +00:00
Miguel Herranz 03ff363982 Fix missing parentheses 2017-02-02 22:05:31 +01:00
Riccardo Spagni f4fe39ca92
Merge pull request #1654
084aef70 Added days uptime to the status message (NanoAkron)
2017-02-02 21:38:15 +02:00
NanoAkron 084aef700b
Added days uptime to the status message
Also broke down the time calculations for legibility
2017-01-31 09:49:32 +00:00
moneromooo-monero a39cd745c9
rpc: fix bc_dyn_stats not setting grace blocks
This caused a random value to be used, and the resulting
incorrect fee when it wasn't 0.
2017-01-23 19:28:00 +00:00
moneromooo-monero 5833d66f65
Change logging to easylogging++
This replaces the epee and data_loggers logging systems with
a single one, and also adds filename:line and explicit severity
levels. Categories may be defined, and logging severity set
by category (or set of categories). epee style 0-4 log level
maps to a sensible severity configuration. Log files now also
rotate when reaching 100 MB.

To select which logs to output, use the MONERO_LOGS environment
variable, with a comma separated list of categories (globs are
supported), with their requested severity level after a colon.
If a log matches more than one such setting, the last one in
the configuration string applies. A few examples:

This one is (mostly) silent, only outputting fatal errors:

MONERO_LOGS=*:FATAL

This one is very verbose:

MONERO_LOGS=*:TRACE

This one is totally silent (logwise):

MONERO_LOGS=""

This one outputs all errors and warnings, except for the
"verify" category, which prints just fatal errors (the verify
category is used for logs about incoming transactions and
blocks, and it is expected that some/many will fail to verify,
hence we don't want the spam):

MONERO_LOGS=*:WARNING,verify:FATAL

Log levels are, in decreasing order of priority:
FATAL, ERROR, WARNING, INFO, DEBUG, TRACE

Subcategories may be added using prefixes and globs. This
example will output net.p2p logs at the TRACE level, but all
other net* logs only at INFO:

MONERO_LOGS=*:ERROR,net*:INFO,net.p2p:TRACE

Logs which are intended for the user (which Monero was using
a lot through epee, but really isn't a nice way to go things)
should use the "global" category. There are a few helper macros
for using this category, eg: MGINFO("this shows up by default")
or MGINFO_RED("this is red"), to try to keep a similar look
and feel for now.

Existing epee log macros still exist, and map to the new log
levels, but since they're used as a "user facing" UI element
as much as a logging system, they often don't map well to log
severities (ie, a log level 0 log may be an error, or may be
something we want the user to see, such as an important info).
In those cases, I tried to use the new macros. In other cases,
I left the existing macros in. When modifying logs, it is
probably best to switch to the new macros with explicit levels.

The --log-level options and set_log commands now also accept
category settings, in addition to the epee style log levels.
2017-01-16 00:25:46 +00:00
Riccardo Spagni 10c6afd316
Merge pull request #1571
81c384e4 fix do_not_relay not preventing relaying on a timer (moneromooo-monero)
2017-01-15 14:50:10 -05:00
moneromooo-monero 81c384e408
fix do_not_relay not preventing relaying on a timer
Also print its value when printing pool
2017-01-14 13:07:05 +00:00
moneromooo-monero 5b5017e267
rpc: add a command to get info about the current blockchain
About the tip of the main chain, and the last N blocks
2017-01-13 23:21:38 +00:00
Miguel Herranz 19be7225cc Add start_time to get_info methods and show uptime 2017-01-12 00:15:21 +01:00
moneromooo-monero 9731b4e54f
rpc: add block size to GET_BLOCK_HEADER RPC
and print it in print_bc
2017-01-06 19:38:27 +00:00
moneromooo-monero 55fa0479a0
rpc: new function and RPC to get alternative chain info 2016-12-17 11:28:49 +00:00
Dion Ahmetaj d61bd8187e add lightweight block propagation ("fluffy blocks")
Added a new command to the P2P protocol definitions to allow querying for support flags.

Implemented handling of new support flags command in net_node. Changed for_each callback template to include support flags. Updated print_connections command to show peer support flags.

Added p2p constant for signaling fluffy block support.

Added get_pool_transaction function to cryptnote_core.

Added new commands to cryptonote protocol for relaying fluffy blocks.

Implemented handling of fluffy block command in cryptonote protocol.

Enabled fluffy block support in node initial configuration.

Implemented get_testnet function in cryptonote_core.

Made it so that fluffy blocks only run on testnet.
2016-11-09 14:24:27 -05:00
moneromooo-monero eb4ecd442d
daemon: fix min/max tracking using the wrong size
Reported by iDunk
2016-10-23 23:18:34 +01:00
moneromooo-monero 30946700a3
daemon: even when switching branches, compile the damn thing ffs 2016-10-23 20:21:00 +01:00
moneromooo-monero 2f4f6c7c26
daemon: do not divide by 0 when the pool is empty 2016-10-23 20:05:13 +01:00
Riccardo Spagni a0975e59ed
Merge pull request #1250
839280d daemon: add a print_pool_stats daemon command (moneromooo-monero)
2016-10-23 19:25:33 +02:00
moneromooo-monero 839280d5fc
daemon: add a print_pool_stats daemon command
Helps see what's going on now that Monero is getting used
2016-10-23 16:11:20 +01:00
moneromooo-monero 10a79eae24
daemon: report transaction relay status in print_pool* commands 2016-10-23 00:32:55 +01:00
moneromooo-monero 88faec75fe
wallet: select part of the fake outs from recent outputs
25% of the outputs are selected from the last 5 days (if possible),
in order to avoid the common case of sending recently received
outputs again. 25% and 5 days are subject to review later, since
it's just a wallet level change.
2016-10-15 18:17:16 +01:00
Dion Ahmetaj 7db29d6903 print_coinbase_tx_sum now breaks output into fee and emission components 2016-10-10 19:55:18 -04:00
Dion Ahmetaj dd6c44327b changed params from start/end index to height/count 2016-10-10 17:19:36 -04:00
Dion Ahmetaj e95d3f359b attempted to remove whitespace spam 2016-10-10 16:41:24 -04:00
Dion Ahmetaj 412da63622 added print_coinbase_tx_sum option 2016-10-10 15:45:51 -04:00
Riccardo Spagni ab60c0503c
Merge pull request #1164
179b1f4 daemon: implement missing print_bc and matching RPC (moneromooo-monero)
2016-10-04 12:14:12 +02:00
Riccardo Spagni e34ef4de6c
Merge pull request #1171
6390673 Removed all code related to fast_exit (NanoAkron)
2016-10-04 11:41:41 +02:00
Riccardo Spagni 298a0723e8
Merge pull request #1149
25be1d3 Noticed two spellings of the word 'response' in the codebase, one 'responce' and the other 'response'. (NanoAkron)
2016-10-04 11:34:53 +02:00
NanoAkron 6390673137 Removed all code related to fast_exit 2016-10-03 02:06:55 +01:00
moneromooo-monero 179b1f43af
daemon: implement missing print_bc and matching RPC 2016-10-02 10:21:21 +01:00
NanoAkron 25be1d3ed4 Noticed two spellings of the word 'response' in the codebase, one 'responce' and the other 'response'.
Fixed to the standard spelling 'response'. This may fix some functionality - some calls had mixed spellings.
2016-09-29 14:38:12 +01:00
moneromooo-monero 8b4e7c6c9c
daemon: report status at 99.9% rather than 100% when not quite synced
Less confusing for users.
2016-09-24 11:45:19 +01:00
moneromooo-monero eeb2bbc0fc
epee: optionally restrict HTTP service to a configurable user agent
This is intended to catch traffic coming from a web browser,
so we avoid issues with a web page sending a transfer RPC to
the wallet. Requiring a particular user agent can act as a
simple password scheme, while we wait for 0MQ and proper
authentication to be merged.
2016-09-18 20:32:02 +01:00
iDunk5400 f1381388ec Daemon: fix hashrate display in diff command output 2016-09-10 23:16:25 +02:00
Riccardo Spagni df63e0704a
fix remaining bitmonero and simplewallet bits 2016-09-03 22:03:44 +02:00
moneromooo-monero 7e4e0021f4
daemon: print time to next fork 2016-08-12 20:32:23 +01:00
moneromooo-monero 78cc10f3fa
daemon: fix ban seconds being misinterpreted as absolute
Absolute to relative conversion is already done by the callee.
2016-07-10 15:13:53 +01:00
Riccardo Spagni c2e9866fc6
Merge pull request #797
d662ab5 rpc: print human readable time since received when printing pool (moneromooo-monero)
5c9dd23 rpc: add a do_not_relay boolean to tx submission (moneromooo-monero)
2016-04-14 16:20:41 +09:00
moneromooo-monero f17b2f42b2
rpc: add pool/blockchain and block height results to gettransactions 2016-04-09 12:40:32 +01:00
moneromooo-monero d662ab5cec
rpc: print human readable time since received when printing pool 2016-04-05 20:16:05 +01:00
moneromooo-monero 600a3cf0c0
New RPC and daemon command to get output histogram
This is a list of existing output amounts along with the number
of outputs of that amount in the blockchain.

The daemon command takes:
- no parameters: all outputs with at least 3 instances
- one parameter: all outputs with at least that many instances
- two parameters: all outputs within that many instances

The default starts at 3 to avoid massive spamming of all dust
outputs in the blockchain, and is the current minimum mixin
requirement.

An optional vector of amounts may be passed, to request
histogram only for those outputs.
2016-03-26 21:10:43 +00:00
moneromooo-monero f7301c3563
Revert "Print stack trace upon exceptions"
Ain't nobody got time for link/cmake skullduggery.

This reverts commit fff238ec94.
2016-03-21 10:12:23 +00:00
Riccardo Spagni 9b10e9cc75
Merge pull request #735
d2aa427 rpc: fix print_tx in command line mode (moneromooo-monero)
2016-03-20 21:27:28 +02:00
moneromooo-monero d2aa427c78
rpc: fix print_tx in command line mode
It was only filling the input in non rpc mode
2016-03-19 23:58:30 +00:00
moneromooo-monero fff238ec94
Print stack trace upon exceptions
Useful for debugging users' logs
2016-03-19 21:48:36 +00:00
Mike C 5dd91f6332 fix formatting error on bitmonero print_block return
Example of current return for `print_block 912345`:

    timestamp: 1452793716
    previous hash:
b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78
    nonce: 1646
    is orphan: 0
    height: 912345
    depth: 85434
    hash:
e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6difficul
ty: 815625611
    reward: 7388968946286
    {
      "major_version": 1,
      "minor_version": 2,
      …

Without `std::endl`, the difficulty gets smashed on the end of the hash.
2016-03-14 23:31:09 -06:00
moneromooo-monero d9f4b395e8
daemon: remove leftover debug log 2016-02-05 16:36:28 +00:00
Riccardo Spagni 39d73d2a27
Merge pull request #631
bcac101 daemon: fix a few issues reported by valgrind (moneromooo-monero)
a7e8174 tx_pool: fix serialization of new relayed data (moneromooo-monero)
601ad76 hardfork: fix mixup in indexing variable in get_voting_info (moneromooo-monero)
444e22f blockchain: remove unused timer (moneromooo-monero)
7edfdd8 blockchain: fix m_sync_counter uninitialized variable use (moneromooo-monero)
d97582c epee: use generate_random_bytes for new random uuids (moneromooo-monero)
17c7c9c epee: remove dodgy random code that nobody uses (moneromooo-monero)
2016-01-31 15:20:18 +02:00
moneromooo-monero bcac1018af
daemon: fix a few issues reported by valgrind
In particular, ensure we check the status of RPC response structures,
as some functions will return success, but with a BUSY status, when
the daemon is not yet synced, and the response will not filled.
2016-01-30 22:14:51 +00:00
moneromooo-monero bf6d1474c0
new flush_txpool command, and associated RPC call
It can flush a particular tx, or the whole pool (the RPC command
can flush a list of transactions too)
2016-01-30 13:28:26 +00:00
Riccardo Spagni afe2d1a09f
add received time to print_pool and print_pool_sh 2016-01-28 11:24:26 +02:00
binaryFate 0100e951d3 'max limit of...' is redundant wording, rephrase 2016-01-14 23:13:12 +01:00
binaryFate 80e38895b3 Print msg when successfully updating out_peers 2016-01-14 23:10:07 +01:00
moneromooo-monero eaf4dcd747
daemon: fix status command when run from command line 2016-01-11 21:50:41 +00:00
Riccardo Spagni de03926850
updated copyright year 2015-12-31 08:39:56 +02:00
moneromooo-monero 0ab56b80db
print top block hash in daemon diff command
and add top block hash in get_info RPC
2015-12-18 19:56:17 +00:00
moneromooo-monero f7464343ea
daemon: add mining status to the status command 2015-12-07 19:40:12 +00:00
Riccardo Spagni 83b412f471
Merge pull request #503
55e5a33 rpc: pass current block target in rpc (moneromooo-monero)
2015-11-30 00:16:58 +02:00
moneromooo-monero 55e5a33d85
rpc: pass current block target in rpc
This fixes the hash rate being wrong on testnet after the switch
to 2 minute blocks
2015-11-26 00:25:13 +00:00
moneromooo-monero 38ceb73848
add RPC calls and commands to get/set bans 2015-11-26 00:04:22 +00:00
moneromooo-monero 06c8b94925
daemon: fix blockchain height display not updating after sync 2015-11-23 13:16:05 +00:00
moneromooo-monero 051ddbc741
rpc: fix start_mining and status RPC crashes
They check whether they're running on testnet by accessing the
m_rpc_server object, which does not exist when in RPC mode.

Also, fix hard_fork_info being called with the wrong API.
2015-10-28 18:09:36 +00:00
Riccardo Spagni 0640cde88f
Merge pull request #448
06c65cb rpc: fix hard_fork_info RPC (moneromooo-monero)
6f5c129 rpc: fix a few commands not working as command line (moneromooo-monero)
2015-10-26 17:59:25 +02:00
moneromooo-monero 06c65cb0ef
rpc: fix hard_fork_info RPC
I had never tested it, obviously
2015-10-26 10:17:48 +00:00
moneromooo-monero 6f5c129c92
rpc: fix a few commands not working as command line
The method name to the "json_rpc" commands are names, not part
of URLs.
2015-10-26 10:17:03 +00:00
moneromooo-monero 9caf52bf5a
daemon: add a status command
Displays current block height and target, net hash, hard fork
basic info, and connections.
Useful as a basic user friendly "what's going on here" command.
2015-10-25 21:36:46 +00:00
moneromooo-monero ca23c0e5c8
core_rpc_server: add a getblock RPC command, and fix print_block 2015-10-13 21:37:35 +01:00
moneromooo-monero e546f3724a
Add an RPC call and daemon command to get info on hard fork voting 2015-09-19 16:47:48 +01:00
moneromooo-monero 83bbea4c7f
Add a is_key_image_spent daemon command and RPC call 2015-08-11 10:52:41 +01:00
moneromooo-monero 2634307863
daemon: omit extra set of <> in error message
The string conversion already adds them
2015-08-09 16:28:13 +01:00
moneromooo-monero 0822933524
daemon: print a decoded tx in print_tx
in addition to the raw hex representation
2015-08-09 16:25:05 +01:00
moneromooo-monero 1d678b1ee2
daemon: fix print_tx not find transactions
It was not even trying to
2015-08-09 15:48:02 +01:00
Riccardo Spagni e01d32e52d
cleaning up, removing redundant files, renaming, fixing incorrect licenses 2015-05-31 13:40:18 +02:00
moneromooo-monero 693a8bf7b1
rpc_command_executor: fix mining in testnet mode 2015-05-28 23:14:58 +01:00
moneromooo-monero d8ee0a95c7
print limits when running limit commands with no arguments
It's more user friendly that an error message saying the command
does not exist.
2015-05-17 13:15:09 +01:00
warptangent b76857f9d9
Add mempool output to daemon via command and RPC
This is for the "print_pool" command and "get_transaction_pool" RPC
method.

Add mempool's spent key images to the results.
2015-04-23 07:04:36 -07:00
rfree2monero 32c19c6c3d
[fix] log level change. compilation: dns, tests
old unbound #warning does not block compilation
unit tests build fine. Even though the RPC/P2P network type is required again
2015-04-10 16:54:21 +02:00
Thomas Winget 5b01493047
Fixes start_mining in cli interactive mode 2015-04-10 04:08:04 -04:00
rfree2monero c511abf005 remerged; commands JSON. logging upgrade. doxygen 2015-04-01 19:00:45 +02:00
Thomas Winget a0590d29cd
Restore daemon interactive mode
Daemon interactive mode is now working again.

RPC mapped calls in daemon and wallet have both had connection_context
removed as an argument as that argument was not being used anywhere.
2015-03-27 08:01:30 -04:00
Thomas Winget 96cbecffd7
RPC calls for background daemon added in
The RPC calls the daemon executable uses to talk to the running daemon
instance have mostly been added back in.  Rate limiting has not been
added in upstream, but is on its way in a separate effort, so those
calls are still NOPed out.
2015-02-24 00:44:36 -05:00
Thomas Winget 9193d6fb5b
Daemonize changes pulled in -- daemon builds
many RPC functions added by the daemonize changes
(and related changes on the upstream dev branch that were not merged)
were commented out (apart from return).  Other than that, this *should*
work...at any rate, it builds, and that's something.
2015-02-24 00:05:19 -05:00