Commit Graph

126 Commits

Author SHA1 Message Date
Jonas Schnelli
d014114d67 Remove JSON Spirit wrapper, remove JSON Spirit leftovers
- implement find_value() function for UniValue
- replace all Array/Value/Object types with UniValues, remove JSON Spirit to UniValue wrapper
- remove JSON Spirit sources
2017-02-10 00:35:24 +00:00
Jonas Schnelli
851f58f94e remove JSON Spirit UniValue wrapper 2017-02-10 00:35:24 +00:00
Jonas Schnelli
38fc4b7090 expicit set UniValue type to avoid empty values 2017-02-10 00:35:24 +00:00
Jeff Garzik
ed21d5bd4b Convert tree to using univalue. Eliminate all json_spirit uses. 2017-02-10 00:35:24 +00:00
Jack Grigg
8e8b6d701b Switch miner to P2PKH, add -mineraddress option
Closes #945 and #1955.
2017-02-06 11:54:58 +00:00
Jack Grigg
2cc0a252ad Add compile flag to disable compilation of mining code 2017-01-30 21:14:46 +01:00
zkbot
94f427a211 Auto merge of #1999 - str4d:1950-random-cookie-rpc-auth, r=ebfull
rpc: Implement random-cookie based authentication

Cherry-picked from bitcoin/bitcoin#6388.

Closes #1950.
2017-01-18 14:20:25 +00:00
Wladimir J. van der Laan
e957192c54 rpc: Implement random-cookie based authentication
When no `-rpcpassword` is specified, use a special 'cookie' file for
authentication. This file is generated with random content when the
daemon starts, and deleted when it exits. Read access to this file
controls who can access through RPC. By default this file is stored in
the data directory but it be overriden with `-rpccookiefile`.

This is similar to Tor CookieAuthentication: see
https://www.torproject.org/docs/tor-manual.html.en

Alternative to #6258. Like that pull, this allows running bitcoind
without any manual configuration. However, daemons should ideally never write to
their configuration files, so I prefer this solution.
2017-01-09 17:57:05 +01:00
Jack Grigg
f3e4968626 Only enable getblocktemplate when wallet is enabled 2016-12-16 10:44:04 +13:00
Jack Grigg
000499ae64 Add getlocalsolps and getnetworksolps RPC calls, show them in getmininginfo 2016-11-16 22:02:49 +13:00
Simon
f4404d7b5b Closes #1680, temporary fix for rpc deadlock inherited from upstream. 2016-11-15 00:31:24 -08:00
Simon
4e16a7249c Closes #1746. Add rpc call z_validateaddress to validate zaddrs. 2016-10-31 20:05:48 -07:00
Sean Bowe
58c4c0bba3 Change some Bitcoin strings to Zcash strings. 2016-10-26 13:29:05 -06:00
Simon
6c41028f7c Add z_listreceivedbyaddress RPC call 2016-09-08 21:46:15 -07:00
Simon
6d2d045c6b Disable z_sendmany in safe mode 2016-09-08 21:46:15 -07:00
Simon
a0a3334c4d Add z_getbalance and z_gettotalbalance RPC calls to close #1201. 2016-09-08 21:46:14 -07:00
Simon
f86f625dce Update RPCServer to use AsyncRPCQueue's shared queue. 2016-09-08 21:46:14 -07:00
Simon
008fccfa48 Disable option to allow multiple async rpc workers. 2016-09-08 21:46:13 -07:00
Simon
c1eae2806c Closes #1293 by adding z_getoperationresult and making z_getoperationstatus idempotent. 2016-09-08 21:46:13 -07:00
Simon
3b54bf5813 Refactoring and small improvements to async rpc operations.
Added AsyncRPCQueue::closeAndWait() so rpcserver can block on worker threads when shutting down.
AsyncRPCOperation is no longer copyable - copy constructor and assignment operators now private.
Refactoring: renamed methods, renamed member variables
Tidy up: comments, const, size_t, braces
2016-09-08 21:46:13 -07:00
Simon
34f0001ccc Implement RPC call z_listoperationids and update z_getoperationstatus to take a list parameter. 2016-09-08 21:46:13 -07:00
Simon
8d08172d0d Add config option 'rpcasyncthreads' to specify number of async rpc workers. Default is 1. 2016-09-08 21:46:13 -07:00
Simon
fc72c078be Add async RPC queue and operation classes.
Add z_getoperationstatus RPC command.
Add z_sendmany RPC command (dummy implementation, does not send actual
coins).
2016-09-08 21:46:13 -07:00
Simon
e709997ff2 Implemented z_listaddresses to return all the zaddr in the wallet. 2016-08-24 11:19:33 -07:00
Simon
92444edc00 Add z_importwallet and z_exportwallet to handle keys for both
taddr and zaddr.  Restore behaviour of dumpwallet and importwallet
to only handle taddr.
2016-08-24 11:19:33 -07:00
Simon
c1c4594371 Implemented RPC calls z_importkey, z_exportkey, z_getnewaddress.
Modified RPC calls dumpwallet and importwallet to include spending keys.
2016-08-24 11:19:33 -07:00
Gaurav Rana
6c7cc8ebea update zcash-cli stop message
changed "Bitcoin server stopping" to "Zcash server stopping"
2016-08-20 12:27:12 +00:00
Sean Bowe
1737627c4e Introduce zcsamplejoinsplit for creating a raw joinsplit description, and use it to construct the joinsplit for the performance tests that verify joinsplits. 2016-07-19 15:49:11 -06:00
Sean Bowe
b7e4abd6f7 Rename some usage of 'pour'. 2016-07-18 10:06:18 -06:00
Simon
1b114e54c4 Add getblocksubsidy RPC command to return the block reward for a given
block, taking into account the mining slow start.
2016-06-27 13:04:33 -07:00
Jack Grigg
3985a40d1f Change default ports 2016-06-17 00:21:58 +12:00
Taylor Hornby
6962bb3df0 Add automated performance measurement system. 2016-04-11 08:15:25 -06:00
Sean Bowe
a8ac403db0 Added mapAnchors consensus rules, finished zcrawpour/zcrawreceive.
Some specifics on consensus changes:
* Transactions must be anchored to a real anchor in the chain.
* Anchors are pushed and popped during ConnectBlock/DisconnectBlock as appropriate.
* DisconnectTip triggers evictions, under some circumstances, of transactions in the
  mempool which are anchored to roots that are no longer valid.
* Commitments append to the tree at the current best root during ConnectBlock.
2016-01-19 14:36:04 -07:00
Sean Bowe
730790f7a4 Added primitive zcrawkeygen/zcrawpour implementations 2016-01-19 14:36:04 -07:00
Veres Lajos
45bfa137ef PARTIAL: typofixes (found by misspell_fixer)
Upstream: 9f68ed6b6d1a9c6436ce37913666165f2b180ee3 (PR #6539)
2015-09-22 00:43:15 +00:00
Wladimir J. van der Laan
7ff9d122e4 Make sure LogPrintf strings are line-terminated
Fix the cases where LogPrint[f] was accidentally called without line
terminator, which resulted in concatenated log lines.

(see e.g. #6492)
2015-09-22 00:43:11 +00:00
Wladimir J. van der Laan
1fd2d39529 Merge pull request #5420
6b4feb8 [QA] rest.py RPC test: change setgenerate() to generate() (Jonas Schnelli)
97ee866 [REST] getutxos REST command (based on Bip64) (Jonas Schnelli)
2015-05-06 16:50:05 +02:00
Luke Dashjr
b05a89b2de Non-grammatical language improvements 2015-05-02 15:23:59 +00:00
Matt Corallo
59ed61b389 Add RPC call to generate and verify merkle blocks 2015-04-23 17:50:39 -07:00
Jonas Schnelli
97ee866549 [REST] getutxos REST command (based on Bip64)
has parts of @mhearn #4351
* allows querying the utxos over REST
* same binary input and outputs as mentioned in Bip64
* input format = output format
* various rpc/rest regtests
2015-04-21 20:26:49 +02:00
Jonas Schnelli
b9fb692d04 Push down RPC reqWallet flag 2015-04-12 19:37:29 +02:00
Pieter Wuille
6b04508e37 Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
Gavin Andresen
0f5954c434 Regression test for ResendWalletTransactions
Adds a regression test for the wallet's ResendWalletTransactions function, which uses a new, hidden RPC command "resendwallettransactions."

I refactored main's Broadcast signal so it is passed the best-block time, which let me remove a global variable shared between main.cpp and the wallet (nTimeBestReceived).

I also manually tested the "rebroadcast unconfirmed every half hour or so" functionality by:

1. Running bitcoind -connect=0.0.0.0:8333
2. Creating a couple of send-to-self transactions
3. Connect to a peer using -addnode
4. Waited a while, monitoring debug.log, until I see:
```2015-03-23 18:48:10 ResendWalletTransactions: rebroadcast 2 unconfirmed transactions```

One last change: don't bother putting ResendWalletTransactions messages in debug.log unless unconfirmed transactions were actually rebroadcast.
2015-03-24 15:29:20 -04:00
Jonas Schnelli
50c72f23ad [Move Only] Move wallet related things to src/wallet/
could once be renamed from /src/wallet to /src/legacywallet.
2015-03-12 14:13:02 +01:00
Gregory Maxwell
28d4cff0ed Sanitize command strings before logging them.
Normally bitcoin core does not display any network originated strings without
 sanitizing or hex encoding.  This wasn't done for strcommand in many places.

This could be used to play havoc with a terminal displaying the logs,
 especially with printtoconsole in use.

Thanks to Evil-Knievel for reporting this issue.
2015-02-08 19:58:59 +00:00
Wladimir J. van der Laan
5ebe0956b3 Trim RPC command table
- invalidateblock and reconsiderblock were defined doubly
- remove no-longer-used threadSafe, as locks have been pushed down
2015-01-28 07:41:54 +01:00
Eric Lombrozo
4401b2d7c5 Removed main.h dependency from rpcserver.cpp
Rebased by @laanwj:

- update for RPC methods added since 84d13ee: setmocktime,
  invalidateblock, reconsiderblock. Only the first, setmocktime, required a change,
  the other two are thread safe.
2015-01-28 07:41:54 +01:00
Wladimir J. van der Laan
40e96a3016 Merge pull request #5599
0cc0d8d Get rid of the internal miner's hashmeter (jtimon)
2015-01-24 16:00:40 +01:00
Gregory Maxwell
7d2cb48511 Restore RPC HTTP keepalives to default.
This avoids a regression for issues like #334 where high speed
 repeated connections eventually run the HTTP client out of
 sockets because all of theirs end up in time_wait.

Maybe the trade-off here is suboptimal, but if both choices will
 fail then we prefer fewer changes until the root cause is solved.
2015-01-16 05:59:36 -08:00
Gregory Maxwell
16a5c18cea Add a -rpckeepalive and disable RPC use of HTTP persistent connections.
It turns out that some miners have been staying with old versions of
 Bitcoin Core because their software  behaves poorly with persistent
 connections and the Bitcoin Core thread and connection limits.

What happens is that underlying  HTTP libraries leave connections open
 invisibly to their users and then the user runs into the default four
 thread limit.  This looks like Bitcoin Core is unresponsive to RPC.

There are many things that should be improved in Bitcoin Core's behavior
 here, e.g. supporting more concurrent connections, not tying up threads
 for idle connections, disconnecting kept-alive  connections when limits
 are reached, etc. All are fairly big, risky changes.

Disabling keep-alive is a simple workaround. It's often not easy to turn
 off the keep-alive support in the client where it may be buried in some
 platform library.

If you are one of the few who really needs persistent connections you
 probably know that you want them and can find a switch; while if you
 don't and the misbehavior is hitting you it is hard to discover the
 source of your problems is keepalive related.  Given that it is best
 to default to off until they're handled better.
2015-01-14 09:49:57 -08:00