summaryrefslogtreecommitdiff
path: root/src/common
Commit message (Collapse)AuthorAgeFilesLines
* daemon, wallet: new pay for RPC use systemmoneromooo-monero2019-10-251-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Daemons intended for public use can be set up to require payment in the form of hashes in exchange for RPC service. This enables public daemons to receive payment for their work over a large number of calls. This system behaves similarly to a pool, so payment takes the form of valid blocks every so often, yielding a large one off payment, rather than constant micropayments. This system can also be used by third parties as a "paywall" layer, where users of a service can pay for use by mining Monero to the service provider's address. An example of this for web site access is Primo, a Monero mining based website "paywall": https://github.com/selene-kovri/primo This has some advantages: - incentive to run a node providing RPC services, thereby promoting the availability of third party nodes for those who can't run their own - incentive to run your own node instead of using a third party's, thereby promoting decentralization - decentralized: payment is done between a client and server, with no third party needed - private: since the system is "pay as you go", you don't need to identify yourself to claim a long lived balance - no payment occurs on the blockchain, so there is no extra transactional load - one may mine with a beefy server, and use those credits from a phone, by reusing the client ID (at the cost of some privacy) - no barrier to entry: anyone may run a RPC node, and your expected revenue depends on how much work you do - Sybil resistant: if you run 1000 idle RPC nodes, you don't magically get more revenue - no large credit balance maintained on servers, so they have no incentive to exit scam - you can use any/many node(s), since there's little cost in switching servers - market based prices: competition between servers to lower costs - incentive for a distributed third party node system: if some public nodes are overused/slow, traffic can move to others - increases network security - helps counteract mining pools' share of the network hash rate - zero incentive for a payer to "double spend" since a reorg does not give any money back to the miner And some disadvantages: - low power clients will have difficulty mining (but one can optionally mine in advance and/or with a faster machine) - payment is "random", so a server might go a long time without a block before getting one - a public node's overall expected payment may be small Public nodes are expected to compete to find a suitable level for cost of service. The daemon can be set up this way to require payment for RPC services: monerod --rpc-payment-address 4xxxxxx \ --rpc-payment-credits 250 --rpc-payment-difficulty 1000 These values are an example only. The --rpc-payment-difficulty switch selects how hard each "share" should be, similar to a mining pool. The higher the difficulty, the fewer shares a client will find. The --rpc-payment-credits switch selects how many credits are awarded for each share a client finds. Considering both options, clients will be awarded credits/difficulty credits for every hash they calculate. For example, in the command line above, 0.25 credits per hash. A client mining at 100 H/s will therefore get an average of 25 credits per second. For reference, in the current implementation, a credit is enough to sync 20 blocks, so a 100 H/s client that's just starting to use Monero and uses this daemon will be able to sync 500 blocks per second. The wallet can be set to automatically mine if connected to a daemon which requires payment for RPC usage. It will try to keep a balance of 50000 credits, stopping mining when it's at this level, and starting again as credits are spent. With the example above, a new client will mine this much credits in about half an hour, and this target is enough to sync 500000 blocks (currently about a third of the monero blockchain). There are three new settings in the wallet: - credits-target: this is the amount of credits a wallet will try to reach before stopping mining. The default of 0 means 50000 credits. - auto-mine-for-rpc-payment-threshold: this controls the minimum credit rate which the wallet considers worth mining for. If the daemon credits less than this ratio, the wallet will consider mining to be not worth it. In the example above, the rate is 0.25 - persistent-rpc-client-id: if set, this allows the wallet to reuse a client id across runs. This means a public node can tell a wallet that's connecting is the same as one that connected previously, but allows a wallet to keep their credit balance from one run to the other. Since the wallet only mines to keep a small credit balance, this is not normally worth doing. However, someone may want to mine on a fast server, and use that credit balance on a low power device such as a phone. If left unset, a new client ID is generated at each wallet start, for privacy reasons. To mine and use a credit balance on two different devices, you can use the --rpc-client-secret-key switch. A wallet's client secret key can be found using the new rpc_payments command in the wallet. Note: anyone knowing your RPC client secret key is able to use your credit balance. The wallet has a few new commands too: - start_mining_for_rpc: start mining to acquire more credits, regardless of the auto mining settings - stop_mining_for_rpc: stop mining to acquire more credits - rpc_payments: display information about current credits with the currently selected daemon The node has an extra command: - rpc_payments: display information about clients and their balances The node will forget about any balance for clients which have been inactive for 6 months. Balances carry over on node restart.
* Properly format multiline logsmoneromooo-monero2019-09-161-1/+1
| | | | | As a side effect, colouring on Windows should now work regardless of version
* simplewallet: lock console on inactivitymoneromooo-monero2019-08-282-0/+164
|
* Merge pull request #5525luigi11112019-08-142-0/+19
|\ | | | | | | | | | | 0605406 daemon: sort alt chains by height (moneromooo-monero) 4228ee0 daemon: add optional arguments to alt_chain_info (moneromooo-monero) 880ebfd daemon: add more chain specific info in alt_chain_info (moneromooo-monero)
| * daemon: add more chain specific info in alt_chain_infomoneromooo-monero2019-06-012-0/+19
| |
* | Remove Xiala.net from the list of dns resolverstobtoht2019-06-211-1/+0
| | | | | | | | It is down permanently. See: https://xiala.net/ "Ende November 2018 werden alle Dienste von xiala.net abgeschaltet."
* | Add ssl_options support to monerod's rpc mode.Lee Clagett2019-05-221-1/+3
| |
* | password: do not use line input on windowsmoneromooo-monero2019-05-101-5/+1
|/ | | | | | This keeps its builtin command editing away Thanks iDunk for testing on Windows
* Windows: fix a build error in MSYS2 with boost 1.70.0iDunk54002019-04-181-0/+3
|
* Merge pull request #5408Riccardo Spagni2019-04-151-0/+1
|\ | | | | | | c4f8a8a6 build fix: combinator.h stdexcept missing include (Dusan Klinec)
| * build fix: combinator.h stdexcept missing includeDusan Klinec2019-04-071-0/+1
| |
* | Merge pull request #5392Riccardo Spagni2019-04-151-5/+2
|\ \ | | | | | | | | | a2195b9b crypto: replace rand<T>()%N idiom with unbiased rand_idx(N) (stoffu)
| * | crypto: replace rand<T>()%N idiom with unbiased rand_idx(N)stoffu2019-04-041-5/+2
| | |
* | | Merge pull request #5367Riccardo Spagni2019-04-112-5/+5
|\ \ \ | |_|/ |/| | | | | 07b716bf util: name replace_file arguments better (moneromooo-monero)
| * | util: name replace_file arguments bettermoneromooo-monero2019-03-292-5/+5
| | | | | | | | | | | | It was confusing unless you read code and the rename(2) man page.
* | | Merge pull request #5342Riccardo Spagni2019-04-061-3/+3
|\ \ \ | |_|/ |/| | | | | 849a768f perf_timer: move some debug levels to info for consistency (moneromooo-monero)
| * | perf_timer: move some debug levels to info for consistencymoneromooo-monero2019-03-241-3/+3
| |/
* | Merge pull request #5327Riccardo Spagni2019-04-012-0/+38
|\ \ | | | | | | | | | c23ea796 New interactive daemon command 'print_net_stats': Global traffic stats (rbrunner7)
| * | New interactive daemon command 'print_net_stats': Global traffic statsrbrunner72019-03-242-0/+38
| | |
* | | Merge pull request #5306Riccardo Spagni2019-04-011-5/+5
|\ \ \ | |_|/ |/| | | | | 8a97563a Use threadpool instead of new threads for DNS queries (Howard Chu)
| * | Use threadpool instead of new threads for DNS queriesHoward Chu2019-03-171-5/+5
| | |
* | | dns_utils: really add default DNSSEC servers on failuremoneromooo-monero2019-03-201-3/+2
| |/ |/| | | | | Coverity 196597
* | Merge pull request #5198Riccardo Spagni2019-03-191-6/+34
|\ \ | | | | | | | | | 9c4d403a dns_utils: use fallback if the default resolver does not support DNSSEC (moneromooo-monero)
| * | dns_utils: use fallback if the default resolver does not support DNSSECmoneromooo-monero2019-02-271-6/+34
| | |
* | | Merge pull request #5192Riccardo Spagni2019-03-171-2/+2
|\ \ \ | | | | | | | | | | | | | | | | d0e07b3d performance_tests: fix NetBSD build (moneromooo-monero) 7d88d8f2 discontinue use of alloca (moneromooo-monero)
| * | | discontinue use of allocamoneromooo-monero2019-02-251-2/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NetBSD emits: warning: Warning: reference to the libc supplied alloca(3); this most likely will not work. Please use the compiler provided version of alloca(3), by supplying the appropriate compiler flags (e.g. not -std=c89). and man 3 alloca says: Normally, gcc(1) translates calls to alloca() with inlined code. This is not done when either the -ansi, -std=c89, -std=c99, or the -std=c11 option is given and the header <alloca.h> is not included. Otherwise, (without an -ansi or -std=c* option) the glibc version of <stdlib.h> includes <alloca.h> and that contains the lines: #ifdef __GNUC__ #define alloca(size) __builtin_alloca (size) #endif It looks like alloca is a bad idea in modern C/C++, so we use VLAs for C and std::vector for C++.
* | | Merge pull request #5179Riccardo Spagni2019-03-171-4/+4
|\ \ \ | | | | | | | | | | | | 7c09882a dns_utils: remove MoneroPulse/checkpoints mention in TXT record code (moneromooo-monero)
| * | | dns_utils: remove MoneroPulse/checkpoints mention in TXT record codemoneromooo-monero2019-02-211-4/+4
| |/ / | | | | | | | | | This code is used for more than just these
* | | Merge pull request #5061Riccardo Spagni2019-03-1735-35/+35
|\ \ \ | | | | | | | | | | | | 1f2930ce Update 2019 copyright (binaryFate)
| * | | Update 2019 copyrightbinaryFate2019-03-0535-35/+35
| | |/ | |/|
* / | timings: fix errno.h mispelt as error.hmoneromooo-monero2019-03-071-1/+1
|/ /
* | Merge pull request #5146Riccardo Spagni2019-03-041-1/+1
|\ \ | | | | | | | | | 4a9257b4 Support docker for gitian builds (TheCharlatan)
| * | Support docker for gitian buildsTheCharlatan2019-02-141-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | Building with docker is arguably easier and more familiar to most people than either kvm, or lxc. This commit also relaxes the back compat requirement a bit. 32 bit linux now uses glibc version 2.0. Also, the docker shell could not handle gcc arguments containing spaces, so the explicit '-DFELT_TYPE' declaration was dropped. Lastly, this removes some packages from the osx descriptor.
* | Merge pull request #5102Riccardo Spagni2019-03-044-0/+162
|\ \ | | | | | | | | | 1eef0565 performance_tests: better stats, and keep track of timing history (moneromooo-monero)
| * | performance_tests: better stats, and keep track of timing historymoneromooo-monero2019-01-284-0/+162
| | |
* | | Merge pull request #4054Riccardo Spagni2019-03-041-2/+2
|\ \ \ | | | | | | | | | | | | 24569454 epee: add SSL support (moneromooo-monero)
| * | | epee: add SSL supportmoneromooo-monero2019-02-021-2/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RPC connections now have optional tranparent SSL. An optional private key and certificate file can be passed, using the --{rpc,daemon}-ssl-private-key and --{rpc,daemon}-ssl-certificate options. Those have as argument a path to a PEM format private private key and certificate, respectively. If not given, a temporary self signed certificate will be used. SSL can be enabled or disabled using --{rpc}-ssl, which accepts autodetect (default), disabled or enabled. Access can be restricted to particular certificates using the --rpc-ssl-allowed-certificates, which takes a list of paths to PEM encoded certificates. This can allow a wallet to connect to only the daemon they think they're connected to, by forcing SSL and listing the paths to the known good certificates. To generate long term certificates: openssl genrsa -out /tmp/KEY 4096 openssl req -new -key /tmp/KEY -out /tmp/REQ openssl x509 -req -days 999999 -sha256 -in /tmp/REQ -signkey /tmp/KEY -out /tmp/CERT /tmp/KEY is the private key, and /tmp/CERT is the certificate, both in PEM format. /tmp/REQ can be removed. Adjust the last command to set expiration date, etc, as needed. It doesn't make a whole lot of sense for monero anyway, since most servers will run with one time temporary self signed certificates anyway. SSL support is transparent, so all communication is done on the existing ports, with SSL autodetection. This means you can start using an SSL daemon now, but you should not enforce SSL yet or nothing will talk to you.
* / | notify: fix tokenizing being too strictmoneromooo-monero2019-03-041-1/+1
|/ /
* | notify: handle arbitrary tagsmoneromooo-monero2019-01-282-4/+20
| |
* | notify: warn if the spec contains one of '"\moneromooo-monero2019-01-281-0/+2
| | | | | | | | These aren't processed as a shell does, so this may surprise users
* | common: set MONERO_DEFAULT_LOG_CATEGORY for notify and spawnmoneromooo-monero2019-01-282-0/+6
|/
* Pruningmoneromooo-monero2019-01-224-1/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The blockchain prunes seven eighths of prunable tx data. This saves about two thirds of the blockchain size, while keeping the node useful as a sync source for an eighth of the blockchain. No other data is currently pruned. There are three ways to prune a blockchain: - run monerod with --prune-blockchain - run "prune_blockchain" in the monerod console - run the monero-blockchain-prune utility The first two will prune in place. Due to how LMDB works, this will not reduce the blockchain size on disk. Instead, it will mark parts of the file as free, so that future data will use that free space, causing the file to not grow until free space grows scarce. The third way will create a second database, a pruned copy of the original one. Since this is a new file, this one will be smaller than the original one. Once the database is pruned, it will stay pruned as it syncs. That is, there is no need to use --prune-blockchain again, etc.
* i18n: filter LANG/LC_LANG for valid characters, and handle @moneromooo-monero2019-01-081-0/+14
| | | | | If there are more valid characters, add them in, I did not find an actual list.
* Merge pull request #4954Riccardo Spagni2019-01-062-9/+41
|\ | | | | | | | | | | 93c59b29 perf_timer: check allowed categories before logging (moneromooo-monero) 6a507dab perf_timer: add a way to get and reset the current time (moneromooo-monero) c1581a5b perf_timer: only log to file (moneromooo-monero)
| * perf_timer: check allowed categories before loggingmoneromooo-monero2018-12-071-8/+21
| |
| * perf_timer: add a way to get and reset the current timemoneromooo-monero2018-12-072-2/+18
| |
| * perf_timer: only log to filemoneromooo-monero2018-12-071-3/+6
| |
* | Merge pull request #4960luigi11112018-12-311-0/+4
|\ \ | | | | | | | | | b56b5b5 ignore child process when exec (jtgrassie)
| * | ignore child process when execJethro Grassie2018-12-081-0/+4
| |/
* | Merge pull request #4957luigi11112018-12-311-1/+1
|\ \ | | | | | | | | | 0e2f5cb perf_timer: make all logs Info level (moneromooo-monero)