aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.h
Commit message (Collapse)AuthorAgeFilesLines
* rpc: restrict get_alt_blocks_hashesselsta2026-05-151-1/+1
|
* Set response limits on http server connectionsLee *!* Clagett2025-02-141-1/+4
|
* epee: update 'http_server_handlers_map2.h' macros to use fully qualified namesJeffrey Ryan2025-02-131-4/+0
| | | | quick patch which fixes the issue where if you use some macros from `http_server_handlers_map2.h` you have to be in the `epee` namespace or it doesn't compile. Now can remove `using namespace epee;` from header file `core_rpc_server.h`, which caused a couple of name qualifying mistakes
* Copyright: Update to 2022mj-xmr2022-03-041-1/+1
|
* Add calcpow RPCHoward Chu2021-11-201-0/+2
| | | | Calculate PoW hash for a block candidate
* Merge pull request #7891luigi11112021-09-231-0/+2
|\ | | | | | | dfee15e RPC and ZeroMQ APIs to support p2pool (SChernykh)
| * RPC and ZeroMQ APIs to support p2poolSChernykh2021-09-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the following: - "get_miner_data" to RPC API - "json-miner-data" to ZeroMQ subscriber contexts Both provide the necessary data to create a custom block template. They are used by p2pool. Data provided: - major fork version - current height - previous block id - RandomX seed hash - network difficulty - median block weight - coins mined by the network so far - mineable mempool transactions
* | daemon: allow proxy configurationanon2021-08-201-1/+3
|/ | | | | Co-authored-by: selsta <selsta@sent.at> Co-authored-by: tobtoht <thotbot@protonmail.com>
* Merge pull request #7326luigi11112021-03-291-2/+9
|\ | | | | | | cf266d6 bootstrap_daemon: proxy configuration support (xiphon)
| * bootstrap_daemon: proxy configuration supportxiphon2021-01-211-2/+9
| |
* | New add_aux_pow RPC to support merge miningmoneromooo-monero2021-02-091-0/+2
|/
* Update copyright year to 2020SomaticFanatic2020-05-061-1/+1
| | | | Update copyright year to 2020
* Merge pull request #6357luigi11112020-04-041-1/+1
|\ | | | | | | 42a7a4d daemon: auto public nodes - cache and prioritize most stable nodes (xiphon)
| * daemon: auto public nodes - cache and prioritize most stable nodesxiphon2020-02-281-1/+1
| |
* | rpc: add --rpc-payment-allow-free-loopbackmoneromooo-monero2020-03-121-0/+2
| | | | | | | | | | | | | | This allows RPC coming from the loopback interface to not have to pay for service. This makes it possible to run an externally accessible RPC server for payment while also having a local RPC server that can be run unrestricted and payment free.
* | Merge pull request #6215Alexander Blair2020-02-281-0/+1
|\ \ | | | | | | | | | a2578892 --disable-ban-rpc option to prevent RPC users from banning (naughtyfox)
| * | --disable-ban-rpc option to prevent RPC users from banningnaughtyfox2019-12-041-0/+1
| |/
* / daemon: run with -rpc-payment-address and --rpc-restricted-bind-portmoneromooo-monero2019-11-291-1/+2
|/
* rpc: add a flush_cache RPCmoneromooo-monero2019-10-251-0/+2
| | | | | | | This allows flushing internal caches (for now, the bad tx cache, which will allow debugging a stuck monerod after it has failed to verify a transaction in a block, since it would otherwise not try again, making subsequent log changes pointless)
* simplewallet: add public_nodes commandmoneromooo-monero2019-10-251-1/+1
| | | | Lists nodes exposing their RPC port for public use
* daemon, wallet: new pay for RPC use systemmoneromooo-monero2019-10-251-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* ban peers sending bad pow outrightmoneromooo-monero2019-09-251-1/+1
| | | | PoW is expensive to verify, so be strict
* daemon: automatic public nodes discovering and bootstrap daemon switchingxiphon2019-08-271-2/+5
|
* Merge pull request #5649luigi11112019-08-151-0/+3
|\ | | | | | | a182df2 Bans for RPC connections (hyc)
| * Bans for RPC connectionsHoward Chu2019-06-161-0/+3
| | | | | | | | | | Make bans control RPC sessions too. And auto-ban some bad requests. Drops HTTP connections whenever response code is 500.
* | rpc: implement get_public_nodes commandxiphon2019-07-291-0/+2
| |
* | Merge pull request #5623luigi11112019-07-241-0/+4
|\ \ | | | | | | | | | b8cfa92 rpc: implement set_bootstrap_daemon method (xiphon)
| * | rpc: implement set_bootstrap_daemon methodxiphon2019-06-101-0/+4
| |/
* | Merge pull request #5530luigi11112019-07-241-4/+0
|\ \ | | | | | | | | | 6abaaaa remove obsolete save_graph skeleton code (moneromooo-monero)
| * | remove obsolete save_graph skeleton codemoneromooo-monero2019-05-101-4/+0
| |/
* / allow blocking whole subnetsmoneromooo-monero2019-07-161-0/+2
|/
* rpc: set default log category in core_rpc_server.hmoneromooo-monero2019-04-151-0/+3
|
* Change SSL certificate file list to OpenSSL builtin load_verify_locationLee Clagett2019-04-061-1/+1
| | | | | | | | | | | | | Specifying SSL certificates for peer verification does an exact match, making it a not-so-obvious alias for the fingerprints option. This changes the checks to OpenSSL which loads concatenated certificate(s) from a single file and does a certificate-authority (chain of trust) check instead. There is no drop in security - a compromised exact match fingerprint has the same worse case failure. There is increased security in allowing separate long-term CA key and short-term SSL server keys. This also removes loading of the system-default CA files if a custom CA file or certificate fingerprint is specified.
* New interactive daemon command 'print_net_stats': Global traffic statsrbrunner72019-03-241-0/+2
|
* Merge pull request #5190Riccardo Spagni2019-03-171-0/+1
|\ | | | | | | 551104fb daemon: add --public-node mode, RPC port propagation over P2P (xiphon)
| * daemon: add --public-node mode, RPC port propagation over P2Pxiphon2019-02-251-0/+1
| |
* | Update 2019 copyrightbinaryFate2019-03-051-1/+1
| |
* | epee: add SSL supportMartijn Otto2019-03-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | epee: add SSL supportmoneromooo-monero2019-02-021-0/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* rpc: fix internal daemon calls in restricted rpc getting partial datamoneromooo-monero2019-01-281-60/+60
|
* Pruningmoneromooo-monero2019-01-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #4903Riccardo Spagni2018-12-121-0/+2
|\ | | | | | | dc1c1252 add command pop_blocks (Jason Wong)
| * add command pop_blocksJason Wong2018-11-281-0/+2
| | | | | | | | | | | | add new public method to Blockchain and update according to code review update after review: better lock/unlock, try catch and coding style
* | Merge pull request #4859Riccardo Spagni2018-12-041-2/+1
|\ \ | |/ |/| | | 6f2497bc Don't cache nettype in core_rpc_server use m_core (doy-lee)
| * Don't cache nettype in core_rpc_server use m_coredoy-lee2018-11-161-2/+1
| | | | | | | | | | | | | | This can go out of sync with m_core's nettype if you run in fakechain mode since entering fakechain mode is done through code not the command line and core_rpc_server only looks at the command line to figure out the nettype.
* | rpc: speedup get_output_distributionmoneromooo-monero2018-11-201-0/+2
|/ | | | and decrease the amount of data carried around
* remove obsolete daemon selection of fake outs and old tx constructionmoneromooo-monero2018-09-141-6/+0
|
* v8: per byte fee, pad bulletproofs, fixed 11 ring sizemoneromooo-monero2018-09-111-2/+2
|
* Merge pull request #4033luigi11112018-07-191-1/+3
|\ | | | | | | 3e46db9 rpc: add a non binary get_transaction_pool_hashes RPC (moneromooo-monero)
| * rpc: add a non binary get_transaction_pool_hashes RPCmoneromooo-monero2018-06-211-1/+3
| |