aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/main.cpp (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-03-04Copyright: Update to 2022mj-xmr1-1/+1
2021-08-20daemon: allow proxy configurationanon1-0/+2
Co-authored-by: selsta <selsta@sent.at> Co-authored-by: tobtoht <thotbot@protonmail.com>
2020-10-29Add rpc-restricted-bind-ip optionHoward Chu1-1/+2
Fixes #6369
2020-09-20daemon: Windows - fix FAT32 warning, trailing backslash is requiredxiphon1-1/+1
2020-05-04Adding ZMQ/Pub support for txpool_add and chain_main eventsLee Clagett1-0/+1
2020-07-19Merge pull request #6578Alexander Blair1-0/+21
a6803231e daemon: complain if data dir resides on FAT32 volume (Windows) (xiphon)
2020-05-21daemon: complain if data dir resides on FAT32 volume (Windows)xiphon1-0/+21
2020-05-06Update copyright year to 2020SomaticFanatic1-1/+1
Update copyright year to 2020
2020-02-17remove empty statementsInterchained1-1/+1
Cleaning up a little around the code base.
2019-09-24Merge pull request #5878luigi11111-11/+0
f9b3f6e Removed Berkeley DB and db switching logic (JesusRami)
2019-09-16Removed Berkeley DB and db switching logicJesus Ramirez1-11/+0
2019-08-28simplewallet: lock console on inactivitymoneromooo-monero1-6/+2
2019-07-24Merge pull request #5597luigi11111-0/+1
343c0b4 add a command line option to disable ZMQ server (jtgrassie)
2019-06-01add a command line option to disable ZMQ serverJethro Grassie1-0/+1
2019-05-22Add ssl_options support to monerod's rpc mode.Lee Clagett1-1/+5
2019-04-16daemon: fix absolute/relative log file test for windowsmoneromooo-monero1-5/+1
2019-04-13daemon: if a log file has a /, interpret it from the cwdmoneromooo-monero1-1/+6
rather than from data dir where it normally is. It makes things like --log-file ./foo.log behave as you'd expect.
2019-03-17Merge pull request #5190Riccardo Spagni1-1/+54
551104fb daemon: add --public-node mode, RPC port propagation over P2P (xiphon)
2019-03-05Update 2019 copyrightbinaryFate1-1/+1
2019-02-25daemon: add --public-node mode, RPC port propagation over P2Pxiphon1-1/+54
2018-11-30daemon: print monero version at startup when calling a detached daemonmoneromooo-monero1-10/+10
So people who want a timstamp get a timestamp
2018-08-31rpc: allow to pass RPC login via RPC_LOGIN env varDusan Klinec1-2/+5
- passing by parameter is insecure as it is shown in the process list
2018-07-19Merge pull request #3854luigi11111-2/+3
149da42 db_lmdb: enable batch transactions by default (stoffu) 34cb6b4 add --regtest and --fixed-difficulty for regression testing (vicsn) 9e1403e update get_info RPC and bump RPC version (vicsn) 207b66e first new functional tests (vicsn)
2018-06-29add --regtest and --fixed-difficulty for regression testingvictorsintnicolaas1-2/+3
on_generateblocks RPC call combines functionality from the on_getblocktemplate and on_submitblock RPC calls to allow rapid block creation. Difficulty is set permanently to 1 for regtest. Makes use of FAKECHAIN network type, but takes hard fork heights from mainchain Default reserve_size in generate_blocks RPC call is now 1. If it is 0, the following error occurs 'Failed to calculate offset for'. Queries hard fork heights info of other network types
2018-06-20Merge pull request #3897luigi11111-1/+2
63d0ab0 mlog: --max-log-files to set the max number of rotated log files (stoffu)
2018-06-13mlog: --max-log-files to set the max number of rotated log filesstoffu1-1/+2
2018-05-31daemon: fix readline interfering with std::cerr usagemoneromooo-monero1-0/+3
Once readline is initialized, std::cerr's operator<< will output a 0xff byte for unknown reasons.
2018-04-14daemon: read config file before reading any other argsstoffu1-23/+22
2018-03-05Stagenetstoffu1-0/+8
2018-02-16options: add testnet option dependencieswhythat1-7/+2
2018-02-16options: remove testnet-* optionswhythat1-10/+1
2018-02-16Merge pull request #3161Riccardo Spagni1-1/+1
78a2e15b daemon: exit with 0 when successful (moneromooo-monero)
2018-01-26Update 2018 copyrightxmr-eric1-1/+1
2018-01-20daemon: exit with 0 when successfulmoneromooo-monero1-1/+1
2017-12-27daemon+simplewallet: given an unknown command, show itstoffu1-1/+1
2017-12-16cryptonote_core does not depend on p2p anymoremoneromooo-monero1-0/+1
As a followon side effect, this makes a lot of inline code included only in particular cpp files (and instanciated when necessary.
2017-11-16daemon & simplewallet: don't set max-concurrency when unspecifiedstoffu1-1/+1
2017-11-14wallet: rejig to avoid prompting in wallet2moneromooo-monero1-1/+6
wallet2 is a library, and should not prompt for stdin. Instead, pass a function so simplewallet can prompt on stdin, and a GUI might display a window, etc.
2017-11-14move cryptonote command line options to cryptonote_coremoneromooo-monero1-5/+2
Those have no reason to be in a generic module
2017-10-15Merge pull request #2589Riccardo Spagni1-2/+2
8f0cea63 add a command_line function to check for defaulted options (moneromooo-monero)
2017-10-14Add tools::on_startup, and warn about glibc 2.25 bug if foundmoneromooo-monero1-1/+1
https://sourceware.org/bugzilla/show_bug.cgi?id=21778
2017-10-06add a command_line function to check for defaulted optionsmoneromooo-monero1-2/+2
2017-09-25Merge pull request #2456Riccardo Spagni1-1/+2
91def9a5 daemon, wallet: add --max-log-file-size option (selsta)
2017-09-18Merge pull request #2044Riccardo Spagni1-0/+3
0299cb77 Fix various oversights/bugs in ZMQ RPC server code (Thomas Winget) 77986023 json serialization for rpc-relevant monero types (Thomas Winget) 5c1e08fe Refactor some things into more composable (smaller) functions (Thomas Winget) 9ac2ad07 DRY refactoring (Thomas Winget)
2017-09-17daemon, wallet: add --max-log-file-size optionselsta1-1/+2
2017-09-05Fix various oversights/bugs in ZMQ RPC server codeThomas Winget1-1/+0
- Add some RPC commands (and touch up a couple others) - some bounds checking - some better pointer management - const correctness and error handling -- Thanks @vtnerd for type help with serialization and CMake changes
2017-09-05json serialization for rpc-relevant monero typesThomas Winget1-0/+4
Structured {de-,}serialization methods for (many new) types which are used for requests or responses in the RPC. New types include RPC requests and responses, and structs which compose types within those. # Conflicts: # src/cryptonote_core/blockchain.cpp
2017-08-29move db specific options to BlockchainDBmoneromooo-monero1-1/+1
Avoids common depending on blockchain_db, which can cause link errors.
2017-08-20More DB support cleanupHoward Chu1-6/+3
Hide DB types from db_types.h - no reason to recompile dependencies when DB types change. Also remove lingering in-memory DB references, they've been obsolete since 9e82b694da120708652871b55f639d1ef306a7ec
2017-02-24daemon: avoid pre-log-init spew on creating directoriesmoneromooo-monero1-1/+3
2017-02-21update copyright year, fix occasional lack of newline at line endRiccardo Spagni1-1/+1
2017-02-11Merge pull request #1689Riccardo Spagni1-3/+18
ce7fcbb4 Add server auth to monerod, and client auth to wallet-cli and wallet-rpc (Lee Clagett)
2017-02-08extract some basic code from libcryptonote_core into libcryptonote_basickenshi841-1/+1
2017-02-06Add server auth to monerod, and client auth to wallet-cli and wallet-rpcLee Clagett1-3/+18
2017-01-16Change logging to easylogging++moneromooo-monero1-43/+23
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.
2016-09-18epee: optionally restrict HTTP service to a configurable user agentmoneromooo-monero1-1/+2
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-16daemon: log version when startingmoneromooo-monero1-0/+3
Helps with investigating bug reports
2016-07-27cmake,common: flag for stack traceredfish1-1/+6
By default the flag is enabled whenever libunwind is found on the system, with the exception of static build on OSX (for which we can't install the throw hook #932 due to lack of support for --wrap in OSX ld64 linker).
2016-06-30daemon: print exception errors when failing to parse config filemoneromooo-monero1-1/+10
When an exception happens while reading the config file, we need to print the error, as the logging system isn't initialized yet, so the generic catch will not print anything.
2016-06-19Merge pull request #775Riccardo Spagni1-0/+2
e409e59 Print stack trace on exceptions (moneromooo-monero) ef4ff42 connection_basic: avoid gratuitous exception (moneromooo-monero)
2016-04-28Print stack trace on exceptionsmoneromooo-monero1-0/+2
if libunwind is found. Useful for debugging logs.
2016-04-28add a --max-concurrency flagmoneromooo-monero1-0/+4
It sets the max number of threads to use for a parallel job. This is different that the number of total threads, since monero binaries typically start a lot of them.
2016-02-22move g_test_dbg_lock_sleep from a global to a function level staticmoneromooo-monero1-1/+1
This avoids the need to define that variable in every program which uses epee.
2015-12-31update versionRiccardo Spagni1-2/+2
2015-12-31updated copyright yearRiccardo Spagni1-1/+1
2015-12-22Merge pull request #552Riccardo Spagni1-1/+0
9428d53 Strip redundant includes (hyc)
2015-12-21Strip redundant includeshyc1-1/+0
In particular, <boost/program_options.hpp> blows up daemon.cpp.obj, making it too big to compile in debug mode on Win32. Even on a release build it drops daemon.cpp.o on Linux from 31MB to 20MB. This has no effect on the final linked binary size.
2015-12-15Replace tabs with two spaces for consistency with rest of codebasewarptangent1-11/+11
Remove trailing whitespace in same files.
2015-12-08Register daemon command line arguments to core if they're used in coremoneromooo-monero1-14/+3
This fixes coretests, which does not register daemon specific arguments, but uses core, which uses those arguments. Also gets rid of an unwanted dependency on daemon code from core.
2015-11-21Fix startup crash when using a locale boost does not likemoneromooo-monero1-0/+2
There are various locale related bugs in various versions of boost, where exceptions are thrown in boost::filesystem APIs when the current locale is not to boost's liking. It's not clear what "not to boost's liking" means in detail, though "en" and "en_US.UTF-8" are not to its liking. Fix it by running a test function that's known to throw in such a case, and resetting LANG and LC_ALL to C if an exception is thrown. In simplewallet, the locale is queried before that so the correct translations will still be used.
2015-07-15** CHANGES ARE EXPERIMENTAL (FOR TESTING ONLY)NoodleDoodleNoodleDoodleNoodleDoodleNoo1-0/+6
Bockchain: 1. Optim: Multi-thread long-hash computation when encountering groups of blocks. 2. Optim: Cache verified txs and return result from cache instead of re-checking whenever possible. 3. Optim: Preload output-keys when encoutering groups of blocks. Sort by amount and global-index before bulk querying database and multi-thread when possible. 4. Optim: Disable double spend check on block verification, double spend is already detected when trying to add blocks. 5. Optim: Multi-thread signature computation whenever possible. 6. Patch: Disable locking (recursive mutex) on called functions from check_tx_inputs which causes slowdowns (only seems to happen on ubuntu/VMs??? Reason: TBD) 7. Optim: Removed looped full-tx hash computation when retrieving transactions from pool (???). 8. Optim: Cache difficulty/timestamps (735 blocks) for next-difficulty calculations so that only 2 db reads per new block is needed when a new block arrives (instead of 1470 reads). Berkeley-DB: 1. Fix: 32-bit data errors causing wrong output global indices and failure to send blocks to peers (etc). 2. Fix: Unable to pop blocks on reorganize due to transaction errors. 3. Patch: Large number of transaction aborts when running multi-threaded bulk queries. 4. Patch: Insufficient locks error when running full sync. 5. Patch: Incorrect db stats when returning from an immediate exit from "pop block" operation. 6. Optim: Add bulk queries to get output global indices. 7. Optim: Modified output_keys table to store public_key+unlock_time+height for single transaction lookup (vs 3) 8. Optim: Used output_keys table retrieve public_keys instead of going through output_amounts->output_txs+output_indices->txs->output:public_key 9. Optim: Added thread-safe buffers used when multi-threading bulk queries. 10. Optim: Added support for nosync/write_nosync options for improved performance (*see --db-sync-mode option for details) 11. Mod: Added checkpoint thread and auto-remove-logs option. 12. *Now usable on 32-bit systems like RPI2. LMDB: 1. Optim: Added custom comparison for 256-bit key tables (minor speed-up, TBD: get actual effect) 2. Optim: Modified output_keys table to store public_key+unlock_time+height for single transaction lookup (vs 3) 3. Optim: Used output_keys table retrieve public_keys instead of going through output_amounts->output_txs+output_indices->txs->output:public_key 4. Optim: Added support for sync/writemap options for improved performance (*see --db-sync-mode option for details) 5. Mod: Auto resize to +1GB instead of multiplier x1.5 ETC: 1. Minor optimizations for slow-hash for ARM (RPI2). Incomplete. 2. Fix: 32-bit saturation bug when computing next difficulty on large blocks. [PENDING ISSUES] 1. Berkely db has a very slow "pop-block" operation. This is very noticeable on the RPI2 as it sometimes takes > 10 MINUTES to pop a block during reorganization. This does not happen very often however, most reorgs seem to take a few seconds but it possibly depends on the number of outputs present. TBD. 2. Berkeley db, possible bug "unable to allocate memory". TBD. [NEW OPTIONS] (*Currently all enabled for testing purposes) 1. --fast-block-sync arg=[0:1] (default: 1) a. 0 = Compute long hash per block (may take a while depending on CPU) b. 1 = Skip long-hash and verify blocks based on embedded known good block hashes (faster, minimal CPU dependence) 2. --db-sync-mode arg=[[safe|fast|fastest]:[sync|async]:[nblocks_per_sync]] (default: fastest:async:1000) a. safe = fdatasync/fsync (or equivalent) per stored block. Very slow, but safest option to protect against power-out/crash conditions. b. fast/fastest = Enables asynchronous fdatasync/fsync (or equivalent). Useful for battery operated devices or STABLE systems with UPS and/or systems with battery backed write cache/solid state cache. Fast - Write meta-data but defer data flush. Fastest - Defer meta-data and data flush. Sync - Flush data after nblocks_per_sync and wait. Async - Flush data after nblocks_per_sync but do not wait for the operation to finish. 3. --prep-blocks-threads arg=[n] (default: 4 or system max threads, whichever is lower) Max number of threads to use when computing long-hash in groups. 4. --show-time-stats arg=[0:1] (default: 1) Show benchmark related time stats. 5. --db-auto-remove-logs arg=[0:1] (default: 1) For berkeley-db only. Auto remove logs if enabled. **Note: lmdb and berkeley-db have changes to the tables and are not compatible with official git head version. At the moment, you need a full resync to use this optimized version. [PERFORMANCE COMPARISON] **Some figures are approximations only. Using a baseline machine of an i7-2600K+SSD+(with full pow computation): 1. The optimized lmdb/blockhain core can process blocks up to 585K for ~1.25 hours + download time, so it usually takes 2.5 hours to sync the full chain. 2. The current head with memory can process blocks up to 585K for ~4.2 hours + download time, so it usually takes 5.5 hours to sync the full chain. 3. The current head with lmdb can process blocks up to 585K for ~32 hours + download time and usually takes 36 hours to sync the full chain. Averate procesing times (with full pow computation): lmdb-optimized: 1. tx_ave = 2.5 ms / tx 2. block_ave = 5.87 ms / block memory-official-repo: 1. tx_ave = 8.85 ms / tx 2. block_ave = 19.68 ms / block lmdb-official-repo (0f4a036437fd41a5498ee5e74e2422ea6177aa3e) 1. tx_ave = 47.8 ms / tx 2. block_ave = 64.2 ms / block **Note: The following data denotes processing times only (does not include p2p download time) lmdb-optimized processing times (with full pow computation): 1. Desktop, Quad-core / 8-threads 2600k (8Mb) - 1.25 hours processing time (--db-sync-mode=fastest:async:1000). 2. Laptop, Dual-core / 4-threads U4200 (3Mb) - 4.90 hours processing time (--db-sync-mode=fastest:async:1000). 3. Embedded, Quad-core / 4-threads Z3735F (2x1Mb) - 12.0 hours processing time (--db-sync-mode=fastest:async:1000). lmdb-optimized processing times (with per-block-checkpoint) 1. Desktop, Quad-core / 8-threads 2600k (8Mb) - 10 minutes processing time (--db-sync-mode=fastest:async:1000). berkeley-db optimized processing times (with full pow computation) 1. Desktop, Quad-core / 8-threads 2600k (8Mb) - 1.8 hours processing time (--db-sync-mode=fastest:async:1000). 2. RPI2. Improved from estimated 3 months(???) into 2.5 days (*Need 2AMP supply + Clock:1Ghz + [usb+ssd] to achieve this speed) (--db-sync-mode=fastest:async:1000). berkeley-db optimized processing times (with per-block-checkpoint) 1. RPI2. 12-15 hours (*Need 2AMP supply + Clock:1Ghz + [usb+ssd] to achieve this speed) (--db-sync-mode=fastest:async:1000).
2015-05-31cleaning up, removing redundant files, renaming, fixing incorrect licensesRiccardo Spagni1-7/+7
2015-05-28daemon: Set log file default to use data dirwarptangent1-1/+16
The log file previously used the default data dir even if --data-dir was set to something else. Document data dir and log file path.
2015-04-10[fix] log level change. compilation: dns, testsrfree2monero1-1/+1
old unbound #warning does not block compilation unit tests build fine. Even though the RPC/P2P network type is required again
2015-04-07Merge BlockchainDB into upstreamThomas Winget1-0/+15
2015-04-02Network 1.7; Quieted the debug a bit.rfree2monero1-1/+5
Really really finall version of this changes I hope.
2015-04-01remerged; commands JSON. logging upgrade. doxygenrfree2monero1-1/+9
2015-03-25Steps toward multiple dbs available -- workingThomas Winget1-0/+15
There will need to be some more refactoring for these changes to be considered complete/correct, but for now it's working. new daemon cli argument "--db-type", works for LMDB and BerkeleyDB. A good deal of refactoring is also present in this commit, namely Blockchain no longer instantiates BlockchainDB, but rather is passed a pointer to an already-instantiated BlockchainDB on init().
2015-03-01sending commands to forked daemon works on testnet nowThomas Winget1-0/+4
2015-03-01Fix tests building -- function signatures changedThomas Winget1-0/+2
2015-02-24RPC calls for background daemon added inThomas Winget1-24/+27
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-24Daemonize changes pulled in -- daemon buildsThomas Winget1-0/+229
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.