aboutsummaryrefslogtreecommitdiff
path: root/src/rpcserver.h
AgeCommit message (Collapse)Author
2015-09-03Implement RPCTimerHandler for Qt RPC consoleWladimir J. van der Laan
Implement RPCTimerHandler for Qt RPC console, so that `walletpassphrase` works with GUI and `-server=0`. Also simplify HTTPEvent-related code by using boost::function directly.
2015-09-03evhttpd implementationWladimir J. van der Laan
- *Replace usage of boost::asio with [libevent2](http://libevent.org/)*. boost::asio is not part of C++11, so unlike other boost there is no forwards-compatibility reason to stick with it. Together with #4738 (convert json_spirit to UniValue), this rids Bitcoin Core of the worst offenders with regard to compile-time slowness. - *Replace spit-and-duct-tape http server with evhttp*. Front-end http handling is handled by libevent, a work queue (with configurable depth and parallelism) is used to handle application requests. - *Wrap HTTP request in C++ class*; this makes the application code mostly HTTP-server-neutral - *Refactor RPC to move all http-specific code to a separate file*. Theoreticaly this can allow building without HTTP server but with another RPC backend, e.g. Qt's debug console (currently not implemented) or future RPC mechanisms people may want to use. - *HTTP dispatch mechanism*; services (e.g., RPC, REST) register which URL paths they want to handle. By using a proven, high-performance asynchronous networking library (also used by Tor) and HTTP server, problems such as #5674, #5655, #344 should be avoided. What works? bitcoind, bitcoin-cli, bitcoin-qt. Unit tests and RPC/REST tests pass. The aim for now is everything but SSL support. Configuration options: - `-rpcthreads`: repurposed as "number of work handler threads". Still defaults to 4. - `-rpcworkqueue`: maximum depth of work queue. When this is reached, new requests will return a 500 Internal Error. - `-rpctimeout`: inactivity time, in seconds, after which to disconnect a client. - `-debug=http`: low-level http activity logging
2015-07-20Add importpubkey method to import a watch-only pubkeyMatt Corallo
2015-07-02Merge pull request #6247Wladimir J. van der Laan
076badb Add getblockheader RPC call (Peter Todd)
2015-06-23Merge pull request #6088Wladimir J. van der Laan
2085895 fundrawtransaction tests (Jonas Schnelli) 21bbd92 Add fundrawtransaction RPC method (Matt Corallo) 1e0d1a2 Add FundTransaction method to wallet (Matt Corallo) 2d84e22 Small tweaks to CCoinControl for fundrawtransaction (Matt Corallo) 9b4e7d9 Add DummySignatureCreator which just creates zeroed sigs (Pieter Wuille)
2015-06-17setban: rewrite to UniValue, allow absolute bantimeJonas Schnelli
2015-06-17[RPC] add setban/listbanned/clearbanned RPC commandsJonas Schnelli
2015-06-16New RPC command disconnectnodeAlex van der Peet
2015-06-11Add fundrawtransaction RPC methodMatt Corallo
2015-06-05Add getblockheader RPC callPeter Todd
Alternative to getblock that works even when the block itself has been pruned, returning all available information.
2015-06-04use const references where appropriatePhilip Kaufmann
2015-06-04Remove JSON Spirit wrapper, remove JSON Spirit leftoversJonas Schnelli
- implement find_value() function for UniValue - replace all Array/Value/Object types with UniValues, remove JSON Spirit to UniValue wrapper - remove JSON Spirit sources
2015-06-04remove JSON Spirit UniValue wrapperJonas Schnelli
2015-06-04Convert tree to using univalue. Eliminate all json_spirit uses.Jeff Garzik
2015-05-06Merge pull request #5420Wladimir J. van der Laan
6b4feb8 [QA] rest.py RPC test: change setgenerate() to generate() (Jonas Schnelli) 97ee866 [REST] getutxos REST command (based on Bip64) (Jonas Schnelli)
2015-04-23Add RPC call to generate and verify merkle blocksMatt Corallo
2015-04-21[REST] getutxos REST command (based on Bip64)Jonas Schnelli
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-12Push down RPC reqWallet flagJonas Schnelli
2015-04-01Introduce separate 'generate' RPC callPieter Wuille
2015-03-24Regression test for ResendWalletTransactionsGavin Andresen
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-01-28Trim RPC command tableWladimir J. van der Laan
- invalidateblock and reconsiderblock were defined doubly - remove no-longer-used threadSafe, as locks have been pushed down
2015-01-28Removed main.h dependency from rpcserver.cppEric Lombrozo
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-24Merge pull request #5599Wladimir J. van der Laan
0cc0d8d Get rid of the internal miner's hashmeter (jtimon)
2015-01-04Get rid of the internal miner's hashmeterjtimon
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-16Make pass-by-ref arguments const.Daniel Kraft
Make some of the arguments in rest.cpp, that are passed by reference but never modified, const to emphasise that.
2014-11-26Add 'invalidateblock' and 'reconsiderblock' RPC commands.Pieter Wuille
These can be used for testing reorganizations or for manual intervention in case of chain forks.
2014-11-26[REST] give an appropriate response in warmup phaseJonas Schnelli
2014-11-20Update comments in src/rpc* to be doxygen compatibleMichael Ford
2014-11-18Merge pull request #5280Gavin Andresen
3c30f27 travis: disable rpc tests for windows until they're not so flaky (Cory Fields) daf03e7 RPC tests: create initial chain with specific timestamps (Gavin Andresen) a8b2ce5 regression test only setmocktime RPC call (Gavin Andresen)
2014-11-17regression test only setmocktime RPC callGavin Andresen
2014-11-11Add unauthenticated HTTP REST interface to public blockchain data.Jeff Garzik
2014-11-04Add "warmup mode" for RPC server.Daniel Kraft
Start the RPC server before doing all the (expensive) startup initialisations like loading the block index. Until the node is ready, return all calls immediately with a new error signalling "in warmup" with an appropriate status message (similar to the init message). This is useful for RPC clients to know that the server is there (e. g., they don't have to start it) but not yet available. It is used in Namecoin and Huntercoin already for some time, and there exists a UI hooked onto the RPC interface that actively uses this to its advantage.
2014-11-03Fix all header definesPavel Janík
2014-10-31minor cleanup: include orders, end comments etc.Philip Kaufmann
- no code changes
2014-10-30Update comments in rpcserver to be doxygen compatibleMichael Ford
2014-09-26Use a typedef for monetary valuesMark Friedenbach
2014-08-28add missing header end commentsPhilip Kaufmann
- ensures a consistent usage in header files - also add a blank line after the copyright header where missing - also remove orphan new-lines at the end of some files
2014-08-14Closely track mempool byte total. Add "getmempoolinfo" RPC.Jeff Garzik
Goal: Gain live insight into the mempool. Groundwork for future work that caps mempool size.
2014-08-11Categorize rpc help overviewCozz Lovan
Conflicts: src/rpcserver.cpp Github-Pull: #4539 Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com> Rebased-From: df3d321
2014-08-03Implement "getchaintips" RPC command to monitor blockchain forks.Daniel Kraft
Port over https://github.com/chronokings/huntercoin/pull/19 from Huntercoin: This implements a new RPC command "getchaintips" that can be used to find all currently active chain heads. This is similar to the -printblocktree startup option, but it can be used without restarting just via the RPC interface on a running daemon.
2014-07-11getblocktemplate: longpolling supportLuke Dashjr
2014-07-02Add support for watch-only addressesPieter Wuille
Changes: * Add Add/Have WatchOnly methods to CKeyStore, and implementations in CBasicKeyStore. * Add similar methods to CWallet, and support entries for it in CWalletDB. * Make IsMine in script/wallet return a new enum 'isminetype', rather than a boolean. This allows distinguishing between spendable and unspendable coins. * Add a field fSpendable to COutput (GetAvailableCoins' return type). * Mark watchonly coins in listunspent as 'watchonly': true. * Add 'watchonly' to validateaddress, suppressing script/pubkey/... in this case. Based on a patch by Eric Lombrozo. Conflicts: src/qt/walletmodel.cpp src/rpcserver.cpp src/wallet.cpp
2014-06-28Replace HexBits with strprintfjtimon
2014-06-27Move AcceptedConnection class to rpcserver.h.Jeff Garzik
Also, add parens to HTTPReply() to assist readability.
2014-06-26JSON-RPC method: prioritisetransaction <txid> <priority delta> <priority tx fee>Luke Dashjr
Accepts the transaction into mined blocks at a higher (or lower) priority
2014-06-21Remove getwork() RPC callPieter Wuille
2014-06-06estimatefee / estimatepriority RPC methodsGavin Andresen
New RPC methods: return an estimate of the fee (or priority) a transaction needs to be likely to confirm in a given number of blocks. Mike Hearn created the first version of this method for estimating fees. It works as follows: For transactions that took 1 to N (I picked N=25) blocks to confirm, keep N buckets with at most 100 entries in each recording the fees-per-kilobyte paid by those transactions. (separate buckets are kept for transactions that confirmed because they are high-priority) The buckets are filled as blocks are found, and are saved/restored in a new fee_estiamtes.dat file in the data directory. A few variations on Mike's initial scheme: To estimate the fee needed for a transaction to confirm in X buckets, all of the samples in all of the buckets are used and a median of all of the data is used to make the estimate. For example, imagine 25 buckets each containing the full 100 entries. Those 2,500 samples are sorted, and the estimate of the fee needed to confirm in the very next block is the 50'th-highest-fee-entry in that sorted list; the estimate of the fee needed to confirm in the next two blocks is the 150'th-highest-fee-entry, etc. That algorithm has the nice property that estimates of how much fee you need to pay to get confirmed in block N will always be greater than or equal to the estimate for block N+1. It would clearly be wrong to say "pay 11 uBTC and you'll get confirmed in 3 blocks, but pay 12 uBTC and it will take LONGER". A single block will not contribute more than 10 entries to any one bucket, so a single miner and a large block cannot overwhelm the estimates.
2014-05-09Add tests for BoostAsioToCNetAddrWladimir J. van der Laan
2014-05-06rpc: add `getblockchaininfo` and `getnetworkinfo`Wladimir J. van der Laan
Adds two new info query commands that take over information from hodge-podge `getinfo`. Also some new information is added: - `getblockchaininfo` - `chain`: (string) current chain (main, testnet3, regtest) - `verificationprogress: (numeric) estimated verification progress - `chainwork` - `getnetworkinfo` - `localaddresses`: (array) local addresses, from mapLocalHost (fixes #1734)