aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
Commit message (Collapse)AuthorAgeFilesLines
...
| * | cryptonote: untangle dependency from miner to blockchainmoneromooo-monero2019-10-311-1/+3
| |/ | | | | | | It causes link errors at least on mac
* / daemon: always use bootstrap daemon (if set) in '--no-sync' modexiphon2019-10-281-3/+5
|/
* Merge pull request #6017luigi11112019-10-251-1/+1
|\ | | | | | | 5734686 rpc: Include tag in get_info version string (ndorf)
| * rpc: Include tag in get_info version stringNathan Dorfman2019-10-241-1/+1
| |
* | rpc: fix PRIx64 build error on some systemsmoneromooo-monero2019-10-261-1/+1
| |
* | rpc: add a flush_cache RPCmoneromooo-monero2019-10-253-1/+34
| | | | | | | | | | | | | | 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-253-3/+6
| | | | | | | | Lists nodes exposing their RPC port for public use
* | daemon, wallet: new pay for RPC use systemmoneromooo-monero2019-10-2511-431/+1929
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | add a quick early out to get_blocks.bin when up to datemoneromooo-monero2019-10-241-1/+15
|/
* Merge pull request #5964luigi11112019-10-221-1/+0
|\ | | | | | | fd48461 Print cdifficulty and don't serialize miner tx hash twice (Doy-lee)
| * Print cdifficulty and don't serialize miner tx hash twiceDoyle2019-10-071-1/+0
| |
* | Merge pull request #5943luigi11112019-10-142-4/+4
|\ \ | | | | | | | | | d4d2b5c p2p+rpc: don't skip p2p or rpc port bind failure by default (xiphon)
| * | p2p+rpc: don't skip p2p or rpc port bind failure by defaultxiphon2019-10-132-4/+4
| | |
* | | Merge pull request #5933luigi11112019-10-142-3/+3
|\ \ \ | |/ / |/| | | | | 3455efa ban peers sending bad pow outright (moneromooo-monero)
| * | ban peers sending bad pow outrightmoneromooo-monero2019-09-252-3/+3
| | | | | | | | | | | | PoW is expensive to verify, so be strict
* | | Merge pull request #5915luigi11112019-10-082-7/+8
|\ \ \ | |_|/ |/| | | | | 8330e77 monerod can now sync from pruned blocks (moneromooo-monero)
| * | monerod can now sync from pruned blocksmoneromooo-monero2019-09-272-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the peer (whether pruned or not itself) supports sending pruned blocks to syncing nodes, the pruned version will be sent along with the hash of the pruned data and the block weight. The original tx hashes can be reconstructed from the pruned txes and theur prunable data hash. Those hashes and the block weights are hashes and checked against the set of precompiled hashes, ensuring the data we received is the original data. It is currently not possible to use this system when not using the set of precompiled hashes, since block weights can not otherwise be checked for validity. This is off by default for now, and is enabled by --sync-pruned-blocks
* | | Merge pull request #5893luigi11112019-09-302-2/+2
|\ \ \ | | | | | | | | | | | | Coverity fixes [3a81639, 1bd962d, 2825f07, d099658, d46f701, cd57a10] (anonimal)
| * | | bootstrap_daemon: resolve CID 203915 (UNCAUGHT_EXCEPT)anonimal2019-09-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue is triggered by the captured `this` in RPC server, which passes reference to throwable `core_rpc_server`: `core_rpc_server.cpp:164: m_bootstrap_daemon.reset(new bootstrap_daemon([this]{ return get_random_public_node(); }));` The solution is to simply remove noexcept from the remaining `bootstrap_daemon` constructors because noexcept is false in this context. >"An exception of type "boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::asio::invalid_service_owner>>" is thrown but the throw list "noexcept" doesn't allow it to be thrown. This will cause a call to unexpected() which usually calls terminate()."
* | | | RandomX integrationHoward Chu2019-09-252-2/+19
| |_|/ |/| | | | | | | | Support RandomX PoW algorithm
* | | Merge pull request #5916luigi11112019-09-241-3/+3
|\ \ \ | | | | | | | | | | | | 7b076d5 p2p: fix bans taking port into account (moneromooo-monero)
| * | | p2p: fix bans taking port into accountmoneromooo-monero2019-09-161-3/+3
| | | |
* | | | Merge pull request #5877luigi11112019-09-241-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | 2cd4fd8 Changed the use of boost:value_initialized for C++ list initializer (JesusRami) 4ad191f Removed unused boost/value_init header (whyamiroot) 928f4be Make null hash constants constexpr (whyamiroot)
| * | | | Changed the use of boost:value_initialized for C++ list initializerJesus Ramirez2019-09-021-1/+1
| | | | |
* | | | | functional_tests: add get_transaction_pool_statsmoneromooo-monero2019-09-171-3/+3
| |/ / / |/| | | | | | | | | | | | | | | Also fix part of the RPC results being returned as binary. This makes the RPC backward incompatible.
* | | | Merge pull request #5818luigi11112019-09-143-71/+87
|\ \ \ \ | | | | | | | | | | | | | | | f91a06c Dropping cppzmq dependency; adding some zmq utils (vtnerd)
| * | | | Dropping cppzmq dependency; adding some zmq utilsLee Clagett2019-07-223-71/+87
| | |/ / | |/| |
* | | | Merge pull request #5872luigi11112019-09-141-1/+2
|\ \ \ \ | | | | | | | | | | | | | | | 495a7e5 rpc: don't include an address in mining_status when not mining (moneromooo-monero)
| * | | | rpc: don't include an address in mining_status when not miningmoneromooo-monero2019-08-281-1/+2
| | |/ / | |/| | | | | | | | | | | | | | Best case is an address mined previously and it'll get returned, worst case it was never initialized in the first place
* | | | Merge pull request #5866luigi11112019-09-141-50/+0
|\ \ \ \ | |_|_|/ |/| | | | | | | 21f6c80 rpc: move a leftover light wallet RPC out of daemon RPC (moneromooo-monero)
| * | | rpc: move a leftover light wallet RPC out of daemon RPCmoneromooo-monero2019-08-281-50/+0
| |/ /
* | | Merge pull request #5833luigi11112019-09-081-0/+1
|\ \ \ | |_|/ |/| | | | | 289d215 rpc: fix unitialized 'core_rpc_server::m_was_bootstrap_ever_used' (xiphon)
| * | rpc: fix unitialized 'core_rpc_server::m_was_bootstrap_ever_used'xiphon2019-08-201-0/+1
| | |
* | | Merge pull request #5799luigi11112019-09-045-35/+246
|\ \ \ | |_|/ |/| | | | | 082730b daemon: automatic public nodes discovering and bootstrap daemon switching (xiphon)
| * | daemon: automatic public nodes discovering and bootstrap daemon switchingxiphon2019-08-275-35/+246
| | |
* | | wallet, rpc: add a release field to get_versionmoneromooo-monero2019-08-262-1/+4
|/ / | | | | | | | | | | | | It does not leak much since you can make a fair guess by RPC version already, and some people want to avoid non release clients when using third parties' nodes (because they'd never lie about it)
* | Merge pull request #5696luigi11112019-08-202-7/+14
|\ \ | | | | | | | | | fd60d05 daemon: fix print_pl only printing public zone peers (moneromooo-monero)
| * | daemon: fix print_pl only printing public zone peersmoneromooo-monero2019-08-192-7/+14
| | |
* | | Merge pull request #5636luigi11112019-08-191-1/+3
|\ \ \ | | | | | | | | | | | | b712ae0 rpc: work around a GCC 7.4.0 (at least) bug (moneromooo-monero)
| * | | rpc: work around a GCC 7.4.0 (at least) bugmoneromooo-monero2019-06-121-1/+3
| | | | | | | | | | | | | | | | | | | | In static member function ‘static boost::optional<cryptonote::rpc::output_distribution_data> cryptonote::rpc::RpcHandler::get_output_distribution(const std::function<bool(long unsigned int, long unsigned int, long unsigned int, long unsigned int&, std::vector<long unsigned int>&, long unsigned int&)>&, uint64_t, uint64_t, uint64_t, const std::function<crypto::hash(long unsigned int)>&, bool, uint64_t)’: cc1plus: warning: ‘void* __builtin_memset(void*, int, long unsigned int)’: specified size 18446744073709551536 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
* | | | Merge pull request #5728luigi11112019-08-192-1/+27
|\ \ \ \ | | | | | | | | | | | | | | | 6560bfa rpc: get_block_template add optional extra_nonce (jtgrassie)
| * | | | rpc: get_block_template add optional extra_nonceJethro Grassie2019-07-032-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Circumvents the need to create a new blockhashing blob when you already know the data you want to set in the extra_nonce (so use this instead of reserve_size).
* | | | | Merge pull request #5725luigi11112019-08-191-1/+1
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | dc8b7a8 zmq: MacPorts latest fix (jtgrassie)
| * | | | zmq: MacPorts latest fixJethro Grassie2019-07-011-1/+1
| |/ / /
* | | | Merge pull request #5689luigi11112019-08-151-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | 1db5357 rpc headers fix (malbit)
| * | | | rpc headers fixMichal vel m@lbit2019-06-251-1/+1
| | | | |
* | | | | Merge pull request #5649luigi11112019-08-152-0/+24
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | a182df2 Bans for RPC connections (hyc)
| * | | | | Bans for RPC connectionsHoward Chu2019-06-162-0/+24
| |/ / / / | | | | | | | | | | | | | | | | | | | | Make bans control RPC sessions too. And auto-ban some bad requests. Drops HTTP connections whenever response code is 500.
* | | | | Merge pull request #5634luigi11112019-08-141-1/+2
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 1488109 rpc: fix get_transactions getting v1 txes from the txpool (moneromooo-monero)
| * | | | | rpc: fix get_transactions getting v1 txes from the txpoolmoneromooo-monero2019-06-121-1/+2
| | |_|/ / | |/| | | | | | | | | | | | | It would try to get their prunable hash, but v1 txes don't have one