Commit Graph

236 Commits

Author SHA1 Message Date
wowario 952b0492d9 initial commit 2021-08-29 23:56:47 +03:00
Alexander Blair cbeaeb904b
Merge pull request #7174
5c3e84b6a restrict public node checks a little (moneromooo-monero)
2020-12-26 13:59:09 -08:00
xiphon 07b50c42dd rpc: get_info - add 'synchronized' field 2020-12-23 10:43:47 +00:00
moneromooo-monero 5c3e84b6ae
restrict public node checks a little
do not include blocked hosts in peer lists or public node lists by default,
warn about no https on clearnet and about untrusted peers likely being spies
2020-12-22 23:39:19 +00:00
moneromooo-monero a4cdcd9bd0
rpc: add a busy_syncing field to get_info
true if and pretty much only if new blocks are being added
2020-12-17 18:11:56 +00:00
TheCharlatan 80e535c95a
wallet2: adapt to deterministic unlock time 2020-09-15 11:40:31 +00:00
SomaticFanatic 5ef0607da6 Update copyright year to 2020
Update copyright year to 2020
2020-05-06 22:36:54 -04:00
xiphon 6d6af701ec cryptonote_basic: drop unused verification_context::m_not_rct field 2020-03-31 21:58:25 +00:00
Alexander Blair 4371ac4265
Merge pull request #6225
987c3139 print_coinbase_tx_sum now supports 128 bits sums (moneromooo-monero)
2020-02-28 19:48:11 -08:00
Alexander Blair 4da37daf67
Merge pull request #6211
5985c5af rpc: add bad-blocks to flush_cache RPC (moneromooo-monero)
2020-02-28 19:36:16 -08:00
Alexander Blair 9658f5d7fc
Merge pull request #6040
2f8f3a94 rpc: base flush_cache request/response on the new base structs (moneromooo-monero)
2020-02-06 00:26:34 -08:00
moneromooo-monero 987c3139dc
print_coinbase_tx_sum now supports 128 bits sums
The tail emission will bring the total above 64 bits
2019-12-12 01:56:59 +00:00
moneromooo-monero 5985c5afe8
rpc: add bad-blocks to flush_cache RPC
Flushes m_invalid_blocks in Blockchain.
2019-12-02 18:53:30 +00:00
moneromooo-monero d7cf872767
rpc: add received_timestamp for pool txes in gettransactions 2019-11-22 15:53:40 +00:00
moneromooo-monero 2f8f3a9432
rpc: base flush_cache request/response on the new base structs 2019-10-27 16:14:28 +00:00
moneromooo-monero a4dc575ccb
rpc: add a flush_cache RPC
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)
2019-10-25 18:41:54 +00:00
moneromooo-monero ffa46026b5
simplewallet: add public_nodes command
Lists nodes exposing their RPC port for public use
2019-10-25 09:34:41 +00:00
moneromooo-monero 2899379791
daemon, wallet: new pay for RPC use system
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.
2019-10-25 09:34:38 +00:00
Howard Chu 81c2ad6d5b
RandomX integration
Support RandomX PoW algorithm
2019-09-25 21:29:42 +01:00
moneromooo-monero d53a55204f
functional_tests: add get_transaction_pool_stats
Also fix part of the RPC results being returned as binary.
This makes the RPC backward incompatible.
2019-09-17 11:38:29 +00:00
moneromooo-monero 21f6c80fcd
rpc: move a leftover light wallet RPC out of daemon RPC 2019-08-28 15:51:28 +00:00
moneromooo-monero 33e91e1a1e
wallet, rpc: add a release field to get_version
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)
2019-08-26 19:28:25 +00:00
luigi1111 c9df9d683a
Merge pull request #5696
fd60d05 daemon: fix print_pl only printing public zone peers (moneromooo-monero)
2019-08-20 01:50:10 -05:00
moneromooo-monero fd60d05d5d
daemon: fix print_pl only printing public zone peers 2019-08-19 23:39:51 +00:00
luigi1111 56b98c7003
Merge pull request #5728
6560bfa rpc: get_block_template add optional extra_nonce (jtgrassie)
2019-08-19 17:33:08 -05:00
luigi1111 0e986a86d5
Merge pull request #5607
52cd2fa rpc: implement get_public_nodes command (xiphon)
2019-08-14 15:34:14 -05:00
luigi1111 564bb1da3a
Merge pull request #5525
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)
2019-08-14 15:31:52 -05:00
luigi1111 2258551ef9
Merge pull request #5487
df83ed7 consensus: from v12, enforce >= 2 outputs (moneromooo-monero)
2019-08-14 15:26:55 -05:00
Thomas Winget 155475d971
Add IPv6 support
new cli options (RPC ones also apply to wallet):
  --p2p-bind-ipv6-address (default = "::")
  --p2p-bind-port-ipv6    (default same as ipv4 port for given nettype)
  --rpc-bind-ipv6-address (default = "::1")

  --p2p-use-ipv6          (default false)
  --rpc-use-ipv6          (default false)

  --p2p-require-ipv4      (default true, if ipv4 bind fails and this is
                           true, will not continue even if ipv6 bind
                           successful)
  --rpc-require-ipv4      (default true, description as above)

ipv6 addresses are to be specified as "[xx:xx:xx::xx:xx]:port" except
in the cases of the cli args for bind address.  For those the square
braces can be omitted.
2019-07-31 20:04:57 -04:00
xiphon 52cd2fa0af rpc: implement get_public_nodes command 2019-07-29 10:51:15 +00:00
luigi1111 d4d5a4433d
Merge pull request #5623
b8cfa92 rpc: implement set_bootstrap_daemon method (xiphon)
2019-07-24 14:38:15 -05:00
luigi1111 e05873d873
Merge pull request #5606
cf8cb68 rpc: use ip address string representation for peer::host field (xiphon)
2019-07-24 14:31:59 -05:00
luigi1111 e241a6280d
Merge pull request #5582
fcfcc3a rpc: in/out peers can now return the setting's value (moneromooo-monero)
2019-07-24 14:18:09 -05:00
luigi1111 e579fe4ae0
Merge pull request #5530
6abaaaa remove obsolete save_graph skeleton code (moneromooo-monero)
2019-07-24 14:07:29 -05:00
moneromooo-monero 65c4004963
allow blocking whole subnets 2019-07-16 11:35:53 +00:00
Jethro Grassie 6560bfa64c
rpc: get_block_template add optional extra_nonce
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).
2019-07-03 07:57:36 -04:00
xiphon b8cfa92b7e rpc: implement set_bootstrap_daemon method 2019-06-10 21:10:08 +00:00
xiphon cf8cb6873a rpc: use ip address string representation for peer::host field 2019-06-04 19:33:35 +00:00
moneromooo-monero 880ebfdeea
daemon: add more chain specific info in alt_chain_info 2019-06-01 15:43:52 +00:00
moneromooo-monero fcfcc3ac86
rpc: in/out peers can now return the setting's value 2019-05-30 12:13:31 +00:00
moneromooo-monero 6abaaaa994
remove obsolete save_graph skeleton code 2019-05-10 14:17:18 +00:00
moneromooo-monero 0605406714
daemon: sort alt chains by height 2019-05-09 09:12:49 +00:00
moneromooo-monero df83ed74e4
consensus: from v12, enforce >= 2 outputs 2019-04-23 22:09:35 +00:00
Riccardo Spagni 1b092f3a44
Merge pull request #5452
c30d93fc rpc: add a pruned bool to the prune_blockchain call (moneromooo-monero)
2019-04-16 22:48:50 +02:00
Riccardo Spagni f376cd5605
Merge pull request #5446
7d79222f daemon: remove debug info (moneromooo-monero)
8fec0f98 functional_tests: add sweep_single test (moneromooo-monero)
9880d61b wallet_rpc_server: remove unused code (moneromooo-monero)
8a61b33d rpc: omit irrelevant fields for pool txes in gettransactions (moneromooo-monero)
56508524 rpc: add relayed in get_transaction output (moneromooo-monero)
82e510f1 rpc: set default log category in core_rpc_server.h (moneromooo-monero)
2019-04-16 22:46:29 +02:00
moneromooo-monero c30d93fcd9
rpc: add a pruned bool to the prune_blockchain call 2019-04-16 15:15:14 +00:00
moneromooo-monero 8a61b33d8e
rpc: omit irrelevant fields for pool txes in gettransactions 2019-04-15 09:11:54 +00:00
moneromooo-monero 565085245a
rpc: add relayed in get_transaction output 2019-04-15 09:11:50 +00:00
moneromooo-monero ccb996afc6
rpc: new sanity check on relayed transactions
This will weed out some transactions with silly rings
2019-04-12 20:22:09 +00:00
moneromooo-monero 064ab12340
functional_tests: add more blockchain related tests
Related to emission, reorgs, getting tx data back, output
distribution and histogram
2019-04-11 11:07:58 +00:00