From 4e63bef33b31279ddb96f3e618daa21378fc2eb8 Mon Sep 17 00:00:00 2001 From: Brannon King Date: Thu, 19 Aug 2021 14:41:48 -0400 Subject: [PATCH] [lbry] docs: update docs for LBRY Co-authored-by: Roy Lee --- CHANGES | 1230 ----------------- LICENSE | 1 + README.md | 168 +-- blockchain/README.md | 68 +- blockchain/fullblocktests/README.md | 6 +- blockchain/indexers/README.md | 6 +- btcec/README.md | 61 +- btcjson/README.md | 64 +- chaincfg/README.md | 81 +- chaincfg/chainhash/README.md | 6 +- connmgr/README.md | 20 +- database/README.md | 30 +- database/ffldb/README.md | 4 +- database/internal/treap/README.md | 4 +- doc.go | 6 +- docs/code_contribution_guidelines.md | 319 ----- docs/configuration.md | 110 +- docs/configuring_tor.md | 34 +- docs/contact.md | 15 - docs/controlling.md | 12 +- docs/developer_resources.md | 37 - docs/index.md | 48 +- docs/installation.md | 76 - docs/json_rpc_api.md | 1160 ++++++++-------- docs/mining.md | 16 +- docs/table_of_content.md | 13 - docs/update.md | 8 - docs/using_docker.md | 160 --- docs/wallet.md | 5 - integration/README.md | 7 +- integration/rpctest/README.md | 14 - mempool/README.md | 18 - mining/README.md | 15 +- mining/cpuminer/README.md | 6 +- netsync/README.md | 12 - peer/README.md | 23 +- release/README.md | 181 --- rpcclient/README.md | 37 +- rpcclient/examples/bitcoincorehttp/README.md | 4 +- .../examples/bitcoincorehttpbulk/README.md | 4 +- rpcclient/examples/btcdwebsockets/README.md | 4 +- .../examples/btcwalletwebsockets/README.md | 4 +- rpcclient/examples/customcommand/README.md | 4 +- rpcclient/examples/customcommand/main.go | 4 +- sample-btcd.conf => sample-lbcd.conf | 44 +- txscript/README.md | 58 +- wire/README.md | 43 +- 47 files changed, 836 insertions(+), 3414 deletions(-) delete mode 100644 CHANGES delete mode 100644 docs/code_contribution_guidelines.md delete mode 100644 docs/contact.md delete mode 100644 docs/developer_resources.md delete mode 100644 docs/installation.md delete mode 100644 docs/table_of_content.md delete mode 100644 docs/update.md delete mode 100644 docs/using_docker.md delete mode 100644 docs/wallet.md delete mode 100644 release/README.md rename sample-btcd.conf => sample-lbcd.conf (94%) diff --git a/CHANGES b/CHANGES deleted file mode 100644 index fd59a886..00000000 --- a/CHANGES +++ /dev/null @@ -1,1230 +0,0 @@ -============================================================================ -User visible changes for btcd - A full-node bitcoin implementation written in Go -============================================================================ - -Changes in 0.22.0 (Tue Jun 01 2021) - - Protocol and network-related changes: - - Add support for witness tx and block in notfound msg (#1625) - - Add support for receiving sendaddrv2 messages from a peer (#1670) - - Fix bug in peer package causing last block height to go backwards - (#1606) - - Add chain parameters for connecting to the public Signet network - (#1692, #1718) - - Crypto changes: - - Fix bug causing panic due to bad R and S signature components in - btcec.RecoverCompact (#1691) - - Set the name (secp256k1) in the CurveParams of the S256 curve - (#1565) - - Notable developer-related package changes: - - Remove unknown block version warning in the blockchain package, - due to false positives triggered by AsicBoost (#1463) - - Add chaincfg.RegisterHDKeyID function to populate HD key ID pairs - (#1617) - - Add new method mining.AddWitnessCommitment to add the witness - commitment as an OP_RETURN output within the coinbase transaction. - (#1716) - - RPC changes: - - Support Batch JSON-RPC in rpcclient and server (#1583) - - Add rpcclient method to invoke getdescriptorinfo JSON-RPC command - (#1578) - - Update the rpcserver handler for validateaddress JSON-RPC command to - have parity with the bitcoind 0.20.0 interface (#1613) - - Add rpcclient method to invoke getblockfilter JSON-RPC command - (#1579) - - Add signmessagewithprivkey JSON-RPC command in rpcserver (#1585) - - Add rpcclient method to invoke importmulti JSON-RPC command (#1579) - - Add watchOnly argument in rpcclient method to invoke - listtransactions JSON-RPC command (#1628) - - Update btcjson.ListTransactionsResult for compatibility with Bitcoin - Core 0.20.0 (#1626) - - Support nullable optional JSON-RPC parameters (#1594) - - Add rpcclient and server method to invoke getnodeaddresses JSON-RPC - command (#1590) - - Add rpcclient methods to invoke PSBT JSON-RPC commands (#1596) - - Add rpcclient method to invoke listsinceblock with the - include_watchonly parameter enabled (#1451) - - Add rpcclient method to invoke deriveaddresses JSON-RPC command - (#1631) - - Add rpcclient method to invoke getblocktemplate JSON-RPC command - (#1629) - - Add rpcclient method to invoke getaddressinfo JSON-RPC command - (#1633) - - Add rpcclient method to invoke getwalletinfo JSON-RPC command - (#1638) - - Fix error message in rpcserver when an unknown RPC command is - encountered (#1695) - - Fix error message returned by estimatefee when the number of blocks - exceeds the max depth (#1678) - - Update btcjson.GetBlockChainInfoResult to include new fields in - Bitcoin Core (#1676) - - Add ExtraHeaders in rpcclient.ConnConfig struct (#1669) - - Fix bitcoind compatibility issue with the sendrawtransaction - JSON-RPC command (#1659) - - Add new JSON-RPC errors to btcjson package, and documented them - (#1648) - - Add rpcclient method to invoke createwallet JSON-RPC command - (#1650) - - Add rpcclient methods to invoke backupwallet, dumpwallet, loadwallet - and unloadwallet JSON-RPC commands (#1645) - - Fix unmarshalling error in getmininginfo JSON-RPC command, for valid - integers in scientific notation (#1644) - - Add rpcclient method to invoke gettxoutsetinfo JSON-RPC command - (#1641) - - Add rpcclient method to invoke signrawtransactionwithwallet JSON-RPC - command (#1642) - - Add txid to getblocktemplate response of rpcserver (#1639) - - Fix monetary unit used in createrawtransaction JSON-RPC command in - rpcserver (#1614) - - Add rawtx field to btcjson.GetBlockVerboseTxResult to provide - backwards compatibility with older versions of Bitcoin Core (#1677) - - Misc changes: - - Update btcutil dependency (#1704) - - Add Dockerfile to build and run btcd on Docker (#1465) - - Rework documentation and publish on https://btcd.readthedocs.io (#1468) - - Add support for Go 1.15 (#1619) - - Add Go 1.14 as the minimum supported version of Golang (#1621) - - Contributors (alphabetical order): - - 10gic - - Andrew Tugarinov - - Anirudha Bose - - Appelberg-s - - Armando Ochoa - - Aurèle Oulès - - Calvin Kim - - Christian Lehmann - - Conner Fromknecht - - Dan Cline - - David Mazary - - Elliott Minns - - Federico Bond - - Friedger Müffke - - Gustavo Chain - - Hanjun Kim - - Henry Fisher - - Iskander Sharipov - - Jake Sylvestre - - Johan T. Halseth - - John C. Vernaleo - - Liran Sharir - - Mikael Lindlof - - Olaoluwa Osuntokun - - Oliver Gugger - - Rjected - - Steven Kreuzer - - Torkel Rogstad - - Tristyn - - Victor Lavaud - - Vinayak Borkar - - Wilmer Paulino - - Yaacov Akiba Slama - - ebiiim - - ipriver - - wakiyamap - - yyforyongyu - -Changes in 0.21.0 (Thu Aug 27 2020) - - Network-related changes: - - Handle notfound messages from peers in netsync package (#1603) - - RPC changes: - - Add compatibility for getblock RPC changes in bitcoind 0.15.0 (#1529) - - Add new optional Params field to rpcclient.ConnConfig (#1467) - - Add new error code ErrRPCInWarmup in btcjson (#1541) - - Add compatibility for changes to getmempoolentry response in bitcoind - 0.19.0 (#1524) - - Add rpcclient methods for estimatesmartfee and generatetoaddress - commands (#1500) - - Add rpcclient method for getblockstats command (#1500) - - Parse serialized transaction from createrawtransaction command using - both segwit, and legacy format (#1502) - - Support cookie-based authentication in rpcclient (#1460) - - Add rpcclient method for getchaintxstats command (#1571) - - Add rpcclient method for fundrawtransaction command (#1553) - - Add rpcclient method for getbalances command (#1595) - - Add new method rpcclient.GetTransactionWatchOnly (#1592) - - Crypto changes: - - Fix panic in fieldVal.SetByteSlice when called with large values, and - improve the method to be 35% faster (#1602) - - btcctl changes: - - Add -regtest mode to btcctl (#1556) - - Misc changes: - - Fix a bug due to a deadlock in connmgr's dynamic ban scoring (#1509) - - Add blockchain.NewUtxoEntry() to directly create entries for - UtxoViewpoint (#1588) - - Replace LRU cache implementation in peer package with a generic one - from decred/dcrd (#1599) - - Contributors (alphabetical order): - - Anirudha Bose - - Antonin Hildebrand - - Dan Cline - - Daniel McNally - - David Hill - - Federico Bond - - George Tankersley - - Henry - - Henry Harder - - Iskander Sharipov - - Ivan Kuznetsov - - Jake Sylvestre - - Javed Khan - - JeremyRand - - Jin - - John C. Vernaleo - - Kulpreet Singh - - Mikael Lindlof - - Murray Nesbitt - - Nisen - - Olaoluwa Osuntokun - - Oliver Gugger - - Steven Roose - - Torkel Rogstad - - Tyler Chambers - - Wilmer Paulino - - Yash Bhutwala - - adiabat - - jalavosus - - mohanson - - qqjettkgjzhxmwj - - qshuai - - shuai.qi - - tpkeeper - -Changes in v0.20.1 (Wed Nov 13 2019) - - RPC changes: - - Add compatibility for bitcoind v0.19.0 in rpcclient and btcjson - packages (#1484) - - Contributors (alphabetical order): - - Eugene Zeigel - - Olaoluwa Osuntokun - - Wilmer Paulino - -Changes in v0.20.0 (Tue Oct 15 2019) - - Significant changes made since 0.12.0. See git log or refer to release - notes on GitHub for full details. - - Contributors (alphabetical order): - - Albert Puigsech Galicia - - Alex Akselrod - - Alex Bosworth - - Alex Manuskin - - Alok Menghrajani - - Anatoli Babenia - - Andy Weidenbaum - - Calvin McAnarney - - Chris Martin - - Chris Pacia - - Chris Shepherd - - Conner Fromknecht - - Craig Sturdy - - Cédric Félizard - - Daniel Krawisz - - Daniel Martí - - Daniel McNally - - Dario Nieuwenhuis - - Dave Collins - - David Hill - - David de Kloet - - GeertJohan - - Grace Noah - - Gregory Trubetskoy - - Hector Jusforgues - - Iskander (Alex) Sharipov - - Janus Troelsen - - Jasper - - Javed Khan - - Jeremiah Goyette - - Jim Posen - - Jimmy Song - - Johan T. Halseth - - John C. Vernaleo - - Jonathan Gillham - - Josh Rickmar - - Jon Underwood - - Jonathan Zeppettini - - Jouke Hofman - - Julian Meyer - - Kai - - Kamil Slowikowski - - Kefkius - - Leonardo Lazzaro - - Marco Peereboom - - Marko Bencun - - Mawueli Kofi Adzoe - - Michail Kargakis - - Mitchell Paull - - Nathan Bass - - Nicola 'tekNico' Larosa - - Olaoluwa Osuntokun - - Pedro Martelletto - - Ricardo Velhote - - Roei Erez - - Ruben de Vries - - Rune T. Aune - - Sad Pencil - - Shuai Qi - - Steven Roose - - Tadge Dryja - - Tibor Bősze - - Tomás Senart - - Tzu-Jung Lee - - Vadym Popov - - Waldir Pimenta - - Wilmer Paulino - - benma - - danda - - dskloet - - esemplastic - - jadeblaquiere - - nakagawa - - preminem - - qshuai - -Changes in 0.12.0 (Fri Nov 20 2015) - - Protocol and network related changes: - - Add a new checkpoint at block height 382320 (#555) - - Implement BIP0065 which includes support for version 4 blocks, a new - consensus opcode (OP_CHECKLOCKTIMEVERIFY) that enforces transaction - lock times, and a double-threshold switchover mechanism (#535, #459, - #455) - - Implement BIP0111 which provides a new bloom filter service flag and - hence provides support for protocol version 70011 (#499) - - Add a new parameter --nopeerbloomfilters to allow disabling bloom - filter support (#499) - - Reject non-canonically encoded variable length integers (#507) - - Add mainnet peer discovery DNS seed (seed.bitcoin.jonasschnelli.ch) - (#496) - - Correct reconnect handling for persistent peers (#463, #464) - - Ignore requests for block headers if not fully synced (#444) - - Add CLI support for specifying the zone id on IPv6 addresses (#538) - - Fix a couple of issues where the initial block sync could stall (#518, - #229, #486) - - Fix an issue which prevented the --onion option from working as - intended (#446) - - Transaction relay (memory pool) changes: - - Require transactions to only include signatures encoded with the - canonical 'low-s' encoding (#512) - - Add a new parameter --minrelaytxfee to allow the minimum transaction - fee in BTC/kB to be overridden (#520) - - Retain memory pool transactions when they redeem another one that is - removed when a block is accepted (#539) - - Do not send reject messages for a transaction if it is valid but - causes an orphan transaction which depends on it to be determined - as invalid (#546) - - Refrain from attempting to add orphans to the memory pool multiple - times when the transaction they redeem is added (#551) - - Modify minimum transaction fee calculations to scale based on bytes - instead of full kilobyte boundaries (#521, #537) - - Implement signature cache: - - Provides a limited memory cache of validated signatures which is a - huge optimization when verifying blocks for transactions that are - already in the memory pool (#506) - - Add a new parameter '--sigcachemaxsize' which allows the size of the - new cache to be manually changed if desired (#506) - - Mining support changes: - - Notify getblocktemplate long polling clients when a block is pushed - via submitblock (#488) - - Speed up getblocktemplate by making use of the new signature cache - (#506) - - RPC changes: - - Implement getmempoolinfo command (#453) - - Implement getblockheader command (#461) - - Modify createrawtransaction command to accept a new optional parameter - 'locktime' (#529) - - Modify listunspent result to include the 'spendable' field (#440) - - Modify getinfo command to include 'errors' field (#511) - - Add timestamps to blockconnected and blockdisconnected notifications - (#450) - - Several modifications to searchrawtranscations command: - - Accept a new optional parameter 'vinextra' which causes the results - to include information about the outputs referenced by a transaction's - inputs (#485, #487) - - Skip entries in the mempool too (#495) - - Accept a new optional parameter 'reverse' to return the results in - reverse order (most recent to oldest) (#497) - - Accept a new optional parameter 'filteraddrs' which causes the - results to only include inputs and outputs which involve the - provided addresses (#516) - - Change the notification order to notify clients about mined - transactions (recvtx, redeemingtx) before the blockconnected - notification (#449) - - Update verifymessage RPC to use the standard algorithm so it is - compatible with other implementations (#515) - - Improve ping statistics by pinging on an interval (#517) - - Websocket changes: - - Implement session command which returns a per-session unique id (#500, - #503) - - btcctl utility changes: - - Add getmempoolinfo command (#453) - - Add getblockheader command (#461) - - Add getwalletinfo command (#471) - - Notable developer-related package changes: - - Introduce a new peer package which acts a common base for creating and - concurrently managing bitcoin network peers (#445) - - Various cleanup of the new peer package (#528, #531, #524, #534, - #549) - - Blocks heights now consistently use int32 everywhere (#481) - - The BlockHeader type in the wire package now provides the BtcDecode - and BtcEncode methods (#467) - - Update wire package to recognize BIP0064 (getutxo) service bit (#489) - - Export LockTimeThreshold constant from txscript package (#454) - - Export MaxDataCarrierSize constant from txscript package (#466) - - Provide new IsUnspendable function from the txscript package (#478) - - Export variable length string functions from the wire package (#514) - - Export DNS Seeds for each network from the chaincfg package (#544) - - Preliminary work towards separating the memory pool into a separate - package (#525, #548) - - Misc changes: - - Various documentation updates (#442, #462, #465, #460, #470, #473, - #505, #530, #545) - - Add installation instructions for gentoo (#542) - - Ensure an error is shown if OS limits can't be set at startup (#498) - - Tighten the standardness checks for multisig scripts (#526) - - Test coverage improvement (#468, #494, #527, #543, #550) - - Several optimizations (#457, #474, #475, #476, #508, #509) - - Minor code cleanup and refactoring (#472, #479, #482, #519, #540) - - Contributors (alphabetical order): - - Ben Echols - - Bruno Clermont - - danda - - Daniel Krawisz - - Dario Nieuwenhuis - - Dave Collins - - David Hill - - Javed Khan - - Jonathan Gillham - - Joseph Becher - - Josh Rickmar - - Justus Ranvier - - Mawuli Adzoe - - Olaoluwa Osuntokun - - Rune T. Aune - -Changes in 0.11.1 (Wed May 27 2015) - - Protocol and network related changes: - - Use correct sub-command in reject message for rejected transactions - (#436, #437) - - Add a new parameter --torisolation which forces new circuits for each - connection when using tor (#430) - - Transaction relay (memory pool) changes: - - Reduce the default number max number of allowed orphan transactions - to 1000 (#419) - - Add a new parameter --maxorphantx which allows the maximum number of - orphan transactions stored in the mempool to be specified (#419) - - RPC changes: - - Modify listtransactions result to include the 'involveswatchonly' and - 'vout' fields (#427) - - Update getrawtransaction result to omit the 'confirmations' field - when it is 0 (#420, #422) - - Update signrawtransaction result to include errors (#423) - - btcctl utility changes: - - Add gettxoutproof command (#428) - - Add verifytxoutproof command (#428) - - Notable developer-related package changes: - - The btcec package now provides the ability to perform ECDH - encryption and decryption (#375) - - The block and header validation in the blockchain package has been - split to help pave the way toward concurrent downloads (#386) - - Misc changes: - - Minor peer optimization (#433) - - Contributors (alphabetical order): - - Dave Collins - - David Hill - - Federico Bond - - Ishbir Singh - - Josh Rickmar - -Changes in 0.11.0 (Wed May 06 2015) - - Protocol and network related changes: - - **IMPORTANT: Update is required due to the following point** - - Correct a few corner cases in script handling which could result in - forking from the network on non-standard transactions (#425) - - Add a new checkpoint at block height 352940 (#418) - - Optimized script execution (#395, #400, #404, #409) - - Fix a case that could lead stalled syncs (#138, #296) - - Network address manager changes: - - Implement eclipse attack countermeasures as proposed in - http://cs-people.bu.edu/heilman/eclipse (#370, #373) - - Optional address indexing changes: - - Fix an issue where a reorg could cause an orderly shutdown when the - address index is active (#340, #357) - - Transaction relay (memory pool) changes: - - Increase maximum allowed space for nulldata transactions to 80 bytes - (#331) - - Implement support for the following rules specified by BIP0062: - - The S value in ECDSA signature must be at most half the curve order - (rule 5) (#349) - - Script execution must result in a single non-zero value on the stack - (rule 6) (#347) - - NOTE: All 7 rules of BIP0062 are now implemented - - Use network adjusted time in finalized transaction checks to improve - consistency across nodes (#332) - - Process orphan transactions on acceptance of new transactions (#345) - - RPC changes: - - Add support for a limited RPC user which is not allowed admin level - operations on the server (#363) - - Implement node command for more unified control over connected peers - (#79, #341) - - Implement generate command for regtest/simnet to support - deterministically mining a specified number of blocks (#362, #407) - - Update searchrawtransactions to return the matching transactions in - order (#354) - - Correct an issue with searchrawtransactions where it could return - duplicates (#346, #354) - - Increase precision of 'difficulty' field in getblock result to 8 - (#414, #415) - - Omit 'nextblockhash' field from getblock result when it is empty - (#416, #417) - - Add 'id' and 'timeoffset' fields to getpeerinfo result (#335) - - Websocket changes: - - Implement new commands stopnotifyspent, stopnotifyreceived, - stopnotifyblocks, and stopnotifynewtransactions to allow clients to - cancel notification registrations (#122, #342) - - btcctl utility changes: - - A single dash can now be used as an argument to cause that argument to - be read from stdin (#348) - - Add generate command - - Notable developer-related package changes: - - The new version 2 btcjson package has now replaced the deprecated - version 1 package (#368) - - The btcec package now performs all signing using RFC6979 deterministic - signatures (#358, #360) - - The txscript package has been significantly cleaned up and had a few - API changes (#387, #388, #389, #390, #391, #392, #393, #395, #396, - #400, #403, #404, #405, #406, #408, #409, #410, #412) - - A new PkScriptLocs function has been added to the wire package MsgTx - type which provides callers that deal with scripts optimization - opportunities (#343) - - Misc changes: - - Minor wire hashing optimizations (#366, #367) - - Other minor internal optimizations - - Contributors (alphabetical order): - - Alex Akselrod - - Arne Brutschy - - Chris Jepson - - Daniel Krawisz - - Dave Collins - - David Hill - - Jimmy Song - - Jonas Nick - - Josh Rickmar - - Olaoluwa Osuntokun - - Oleg Andreev - -Changes in 0.10.0 (Sun Mar 01 2015) - - Protocol and network related changes: - - Add a new checkpoint at block height 343185 - - Implement BIP066 which includes support for version 3 blocks, a new - consensus rule which prevents non-DER encoded signatures, and a - double-threshold switchover mechanism - - Rather than announcing all known addresses on getaddr requests which - can possibly result in multiple messages, randomize the results and - limit them to the max allowed by a single message (1000 addresses) - - Add more reserved IP spaces to the address manager - - Transaction relay (memory pool) changes: - - Make transactions which contain reserved opcodes nonstandard - - No longer accept or relay free and low-fee transactions that have - insufficient priority to be mined in the next block - - Implement support for the following rules specified by BIP0062: - - ECDSA signature must use strict DER encoding (rule 1) - - The signature script must only contain push operations (rule 2) - - All push operations must use the smallest possible encoding (rule 3) - - All stack values interpreted as a number must be encoding using the - shortest possible form (rule 4) - - NOTE: Rule 1 was already enforced, however the entire script now - evaluates to false rather than only the signature verification as - required by BIP0062 - - Allow transactions with nulldata transaction outputs to be treated as - standard - - Mining support changes: - - Modify the getblocktemplate RPC to generate and return block templates - for version 3 blocks which are compatible with BIP0066 - - Allow getblocktemplate to serve blocks when the current time is - less than the minimum allowed time for a generated block template - (https://github.com/btcsuite/btcd/issues/209) - - Crypto changes: - - Optimize scalar multiplication by the base point by using a - pre-computed table which results in approximately a 35% speedup - (https://github.com/btcsuite/btcec/issues/2) - - Optimize general scalar multiplication by using the secp256k1 - endomorphism which results in approximately a 17-20% speedup - (https://github.com/btcsuite/btcec/issues/1) - - Optimize general scalar multiplication by using non-adjacent form - which results in approximately an additional 8% speedup - (https://github.com/btcsuite/btcec/issues/3) - - Implement optional address indexing: - - Add a new parameter --addrindex which will enable the creation of an - address index which can be queried to determine all transactions which - involve a given address - (https://github.com/btcsuite/btcd/issues/190) - - Add a new logging subsystem for address index related operations - - Support new searchrawtransactions RPC - (https://github.com/btcsuite/btcd/issues/185) - - RPC changes: - - Require TLS version 1.2 as the minimum version for all TLS connections - - Provide support for disabling TLS when only listening on localhost - (https://github.com/btcsuite/btcd/pull/192) - - Modify help output for all commands to provide much more consistent - and detailed information - - Correct case in getrawtransaction which would refuse to serve certain - transactions with invalid scripts - (https://github.com/btcsuite/btcd/issues/210) - - Correct error handling in the getrawtransaction RPC which could lead - to a crash in rare cases - (https://github.com/btcsuite/btcd/issues/196) - - Update getinfo RPC to include the appropriate 'timeoffset' calculated - from the median network time - - Modify listreceivedbyaddress result type to include txids field so it - is compatible - - Add 'iswatchonly' field to validateaddress result - - Add 'startingpriority' and 'currentpriority' fields to getrawmempool - (https://github.com/btcsuite/btcd/issues/178) - - Don't omit the 'confirmations' field from getrawtransaction when it is - zero - - Websocket changes: - - Modify the behavior of the rescan command to automatically register - for notifications about transactions paying to rescanned addresses - or spending outputs from the final rescan utxo set when the rescan - is through the best block in the chain - - btcctl utility changes: - - Make the list of commands available via the -l option rather than - dumping the entire list on usage errors - - Alphabetize and categorize the list of commands by chain and wallet - - Make the help option only show the help options instead of also - dumping all of the commands - - Make the usage syntax much more consistent and correct a few cases of - misnamed fields - (https://github.com/btcsuite/btcd/issues/305) - - Improve usage errors to show the specific parameter number, reason, - and error code - - Only show the usage for specific command is shown when a valid command - is provided with invalid parameters - - Add support for a SOCK5 proxy - - Modify output for integer fields (such as timestamps) to display - normally instead in scientific notation - - Add invalidateblock command - - Add reconsiderblock command - - Add createnewaccount command - - Add renameaccount command - - Add searchrawtransactions command - - Add importaddress command - - Add importpubkey command - - showblock utility changes: - - Remove utility in favor of the RPC getblock method - - Notable developer-related package changes: - - Many of the core packages have been relocated into the btcd repository - (https://github.com/btcsuite/btcd/issues/214) - - A new version of the btcjson package that has been completely - redesigned from the ground up based based upon how the project has - evolved and lessons learned while using it since it was first written - is now available in the btcjson/v2/btcjson directory - - This will ultimately replace the current version so anyone making - use of this package will need to update their code accordingly - - The btcec package now provides better facilities for working directly - with its public and private keys without having to mix elements from - the ecdsa package - - Update the script builder to ensure all rules specified by BIP0062 are - adhered to when creating scripts - - The blockchain package now provides a MedianTimeSource interface and - concrete implementation for providing time samples from remote peers - and using that data to calculate an offset against the local time - - Misc changes: - - Fix a slow memory leak due to tickers not being stopped - (https://github.com/btcsuite/btcd/issues/189) - - Fix an issue where a mix of orphans and SPV clients could trigger a - condition where peers would no longer be served - (https://github.com/btcsuite/btcd/issues/231) - - The RPC username and password can now contain symbols which previously - conflicted with special symbols used in URLs - - Improve handling of obtaining random nonces to prevent cases where it - could error when not enough entropy was available - - Improve handling of home directory creation errors such as in the case - of unmounted symlinks (https://github.com/btcsuite/btcd/issues/193) - - Improve the error reporting for rejected transactions to include the - inputs which are missing and/or being double spent - - Update sample config file with new options and correct a comment - regarding the fact the RPC server only listens on localhost by default - (https://github.com/btcsuite/btcd/issues/218) - - Update the continuous integration builds to run several tools which - help keep code quality high - - Significant amount of internal code cleanup and improvements - - Other minor internal optimizations - - Code Contributors (alphabetical order): - - Beldur - - Ben Holden-Crowther - - Dave Collins - - David Evans - - David Hill - - Guilherme Salgado - - Javed Khan - - Jimmy Song - - John C. Vernaleo - - Jonathan Gillham - - Josh Rickmar - - Michael Ford - - Michail Kargakis - - kac - - Olaoluwa Osuntokun - -Changes in 0.9.0 (Sat Sep 20 2014) - - Protocol and network related changes: - - Add a new checkpoint at block height 319400 - - Add support for BIP0037 bloom filters - (https://github.com/conformal/btcd/issues/132) - - Implement BIP0061 reject handling and hence support for protocol - version 70002 (https://github.com/conformal/btcd/issues/133) - - Add testnet DNS seeds for peer discovery (testnet-seed.alexykot.me - and testnet-seed.bitcoin.schildbach.de) - - Add mainnet DNS seed for peer discovery (seeds.bitcoin.open-nodes.org) - - Make multisig transactions with non-null dummy data nonstandard - (https://github.com/conformal/btcd/issues/131) - - Make transactions with an excessive number of signature operations - nonstandard - - Perform initial DNS lookups concurrently which allows connections - more quickly - - Improve the address manager to significantly reduce memory usage and - add tests - - Remove orphan transactions when they appear in a mined block - (https://github.com/conformal/btcd/issues/166) - - Apply incremental back off on connection retries for persistent peers - that give invalid replies to mirror the logic used for failed - connections (https://github.com/conformal/btcd/issues/103) - - Correct rate-limiting of free and low-fee transactions - - Mining support changes: - - Implement getblocktemplate RPC with the following support: - (https://github.com/conformal/btcd/issues/124) - - BIP0022 Non-Optional Sections - - BIP0022 Long Polling - - BIP0023 Basic Pool Extensions - - BIP0023 Mutation coinbase/append - - BIP0023 Mutations time, time/increment, and time/decrement - - BIP0023 Mutation transactions/add - - BIP0023 Mutations prevblock, coinbase, and generation - - BIP0023 Block Proposals - - Implement built-in concurrent CPU miner - (https://github.com/conformal/btcd/issues/137) - NOTE: CPU mining on mainnet is pointless. This has been provided - for testing purposes such as for the new simulation test network - - Add --generate flag to enable CPU mining - - Deprecate the --getworkkey flag in favor of --miningaddr which - specifies which addresses generated blocks will choose from to pay - the subsidy to - - RPC changes: - - Implement gettxout command - (https://github.com/conformal/btcd/issues/141) - - Implement validateaddress command - - Implement verifymessage command - - Mark getunconfirmedbalance RPC as wallet-only - - Mark getwalletinfo RPC as wallet-only - - Update getgenerate, setgenerate, gethashespersec, and getmininginfo - to return the appropriate information about new CPU mining status - - Modify getpeerinfo pingtime and pingwait field types to float64 so - they are compatible - - Improve disconnect handling for normal HTTP clients - - Make error code returns for invalid hex more consistent - - Websocket changes: - - Switch to a new more efficient websocket package - (https://github.com/conformal/btcd/issues/134) - - Add rescanfinished notification - - Modify the rescanprogress notification to include block hash as well - as height (https://github.com/conformal/btcd/issues/151) - - btcctl utility changes: - - Accept --simnet flag which automatically selects the appropriate port - and TLS certificates needed to communicate with btcd and btcwallet on - the simulation test network - - Fix createrawtransaction command to send amounts denominated in BTC - - Add estimatefee command - - Add estimatepriority command - - Add getmininginfo command - - Add getnetworkinfo command - - Add gettxout command - - Add lockunspent command - - Add signrawtransaction command - - addblock utility changes: - - Accept --simnet flag which automatically selects the appropriate port - and TLS certificates needed to communicate with btcd and btcwallet on - the simulation test network - - Notable developer-related package changes: - - Provide a new bloom package in btcutil which allows creating and - working with BIP0037 bloom filters - - Provide a new hdkeychain package in btcutil which allows working with - BIP0032 hierarchical deterministic key chains - - Introduce a new btcnet package which houses network parameters - - Provide new simnet network (--simnet) which is useful for private - simulation testing - - Enforce low S values in serialized signatures as detailed in BIP0062 - - Return errors from all methods on the btcdb.Db interface - (https://github.com/conformal/btcdb/issues/5) - - Allow behavior flags to alter btcchain.ProcessBlock - (https://github.com/conformal/btcchain/issues/5) - - Provide a new SerializeSize API for blocks - (https://github.com/conformal/btcwire/issues/19) - - Several of the core packages now work with Google App Engine - - Misc changes: - - Correct an issue where the database could corrupt under certain - circumstances which would require a new chain download - - Slightly optimize deserialization - - Use the correct IP block for he.net - - Fix an issue where it was possible the block manager could hang on - shutdown - - Update sample config file so the comments are on a separate line - rather than the end of a line so they are not interpreted as settings - (https://github.com/conformal/btcd/issues/135) - - Correct an issue where getdata requests were not being properly - throttled which could lead to larger than necessary memory usage - - Always show help when given the help flag even when the config file - contains invalid entries - - General code cleanup and minor optimizations - -Changes in 0.8.0-beta (Sun May 25 2014) - - Btcd is now Beta (https://github.com/conformal/btcd/issues/130) - - Add a new checkpoint at block height 300255 - - Protocol and network related changes: - - Lower the minimum transaction relay fee to 1000 satoshi to match - recent reference client changes - (https://github.com/conformal/btcd/issues/100) - - Raise the maximum signature script size to support standard 15-of-15 - multi-signature pay-to-sript-hash transactions with compressed pubkeys - to remain compatible with the reference client - (https://github.com/conformal/btcd/issues/128) - - Reduce max bytes allowed for a standard nulldata transaction to 40 for - compatibility with the reference client - - Introduce a new btcnet package which houses all of the network params - for each network (mainnet, testnet3, regtest) to ultimately enable - easier addition and tweaking of networks without needing to change - several packages - - Fix several script discrepancies found by reference client test data - - Add new DNS seed for peer discovery (seed.bitnodes.io) - - Reduce the max known inventory cache from 20000 items to 1000 items - - Fix an issue where unknown inventory types could lead to a hung peer - - Implement inventory rebroadcast handler for sendrawtransaction - (https://github.com/conformal/btcd/issues/99) - - Update user agent to fully support BIP0014 - (https://github.com/conformal/btcwire/issues/10) - - Implement initial mining support: - - Add a new logging subsystem for mining related operations - - Implement infrastructure for creating block templates - - Provide options to control block template creation settings - - Support the getwork RPC - - Allow address identifiers to apply to more than one network since both - testnet3 and the regression test network unfortunately use the same - identifier - - RPC changes: - - Set the content type for HTTP POST RPC connections to application/json - (https://github.com/conformal/btcd/issues/121) - - Modified the RPC server startup so it only requires at least one valid - listen interface - - Correct an error path where it was possible certain errors would not - be returned - - Implement getwork command - (https://github.com/conformal/btcd/issues/125) - - Update sendrawtransaction command to reject orphans - - Update sendrawtransaction command to include the reason a transaction - was rejected - - Update getinfo command to populate connection count field - - Update getinfo command to include relay fee field - (https://github.com/conformal/btcd/issues/107) - - Allow transactions submitted with sendrawtransaction to bypass the - rate limiter - - Allow the getcurrentnet and getbestblock extensions to be accessed via - HTTP POST in addition to Websockets - (https://github.com/conformal/btcd/issues/127) - - Websocket changes: - - Rework notifications to ensure they are delivered in the order they - occur - - Rename notifynewtxs command to notifyreceived (funds received) - - Rename notifyallnewtxs command to notifynewtransactions - - Rename alltx notification to txaccepted - - Rename allverbosetx notification to txacceptedverbose - (https://github.com/conformal/btcd/issues/98) - - Add rescan progress notification - - Add recvtx notification - - Add redeemingtx notification - - Modify notifyspent command to accept an array of outpoints - (https://github.com/conformal/btcd/issues/123) - - Significantly optimize the rescan command to yield up to a 60x speed - increase - - btcctl utility changes: - - Add createencryptedwallet command - - Add getblockchaininfo command - - Add importwallet command - - Add addmultisigaddress command - - Add setgenerate command - - Accept --testnet and --wallet flags which automatically select - the appropriate port and TLS certificates needed to communicate - with btcd and btcwallet (https://github.com/conformal/btcd/issues/112) - - Allow path expansion from config file entries - (https://github.com/conformal/btcd/issues/113) - - Minor refactor simplify handling of options - - addblock utility changes: - - Improve logging by making it consistent with the logging provided by - btcd (https://github.com/conformal/btcd/issues/90) - - Improve several package APIs for developers: - - Add new amount type for consistently handling monetary values - - Add new coin selector API - - Add new WIF (Wallet Import Format) API - - Add new crypto types for private keys and signatures - - Add new API to sign transactions including script merging and hash - types - - Expose function to extract all pushed data from a script - (https://github.com/conformal/btcscript/issues/8) - - Misc changes: - - Optimize address manager shuffling to do 67% less work on average - - Resolve a couple of benign data races found by the race detector - (https://github.com/conformal/btcd/issues/101) - - Add IP address to all peer related errors to clarify which peer is the - cause (https://github.com/conformal/btcd/issues/102) - - Fix a UPNP case issue that prevented the --upnp option from working - with some UPNP servers - - Update documentation in the sample config file regarding debug levels - - Adjust some logging levels to improve debug messages - - Improve the throughput of query messages to the block manager - - Several minor optimizations to reduce GC churn and enhance speed - - Other minor refactoring - - General code cleanup - -Changes in 0.7.0 (Thu Feb 20 2014) - - Fix an issue when parsing scripts which contain a multi-signature script - which require zero signatures such as testnet block - 000000001881dccfeda317393c261f76d09e399e15e27d280e5368420f442632 - (https://github.com/conformal/btcscript/issues/7) - - Add check to ensure all transactions accepted to mempool only contain - canonical data pushes (https://github.com/conformal/btcscript/issues/6) - - Fix an issue causing excessive memory consumption - - Significantly rework and improve the websocket notification system: - - Each client is now independent so slow clients no longer limit the - speed of other connected clients - - Potentially long-running operations such as rescans are now run in - their own handler and rate-limited to one operation at a time without - preventing simultaneous requests from the same client for the faster - requests or notifications - - A couple of scenarios which could cause shutdown to hang have been - resolved - - Update notifynewtx notifications to support all address types instead - of only pay-to-pubkey-hash - - Provide a --rpcmaxwebsockets option to allow limiting the number of - concurrent websocket clients - - Add a new websocket command notifyallnewtxs to request notifications - (https://github.com/conformal/btcd/issues/86) (thanks @flammit) - - Improve btcctl utility in the following ways: - - Add getnetworkhashps command - - Add gettransaction command (wallet-specific) - - Add signmessage command (wallet-specific) - - Update getwork command to accept - - Continue cleanup and work on implementing the RPC API: - - Implement getnettotals command - (https://github.com/conformal/btcd/issues/84) - - Implement networkhashps command - (https://github.com/conformal/btcd/issues/87) - - Update getpeerinfo to always include syncnode field even when false - - Remove help addenda for getpeerinfo now that it supports all fields - - Close standard RPC connections on auth failure - - Provide a --rpcmaxclients option to allow limiting the number of - concurrent RPC clients (https://github.com/conformal/btcd/issues/68) - - Include IP address in RPC auth failure log messages - - Resolve a rather harmless data races found by the race detector - (https://github.com/conformal/btcd/issues/94) - - Increase block priority size and max standard transaction size to 50k - and 100k, respectively (https://github.com/conformal/btcd/issues/71) - - Add rate limiting of free transactions to the memory pool to prevent - penny flooding (https://github.com/conformal/btcd/issues/40) - - Provide a --logdir option (https://github.com/conformal/btcd/issues/95) - - Change the default log file path to include the network - - Add a new ScriptBuilder interface to btcscript to support creation of - custom scripts (https://github.com/conformal/btcscript/issues/5) - - General code cleanup - -Changes in 0.6.0 (Tue Feb 04 2014) - - Fix an issue when parsing scripts which contain invalid signatures that - caused a chain fork on block - 0000000000000001e4241fd0b3469a713f41c5682605451c05d3033288fb2244 - - Correct an issue which could lead to an error in removeBlockNode - (https://github.com/conformal/btcchain/issues/4) - - Improve addblock utility as follows: - - Check imported blocks against all chain rules and checkpoints - - Skip blocks which are already known so you can stop and restart the - import or start the import after you have already downloaded a portion - of the chain - - Correct an issue where the utility did not shutdown cleanly after - processing all blocks - - Add error on attempt to import orphan blocks - - Improve error handling and reporting - - Display statistics after input file has been fully processed - - Rework, optimize, and improve headers-first mode: - - Resuming the chain sync from any point before the final checkpoint - will now use headers-first mode - (https://github.com/conformal/btcd/issues/69) - - Verify all checkpoints as opposed to only the final one - - Reduce and bound memory usage - - Rollback to the last known good point when a header does not match a - checkpoint - - Log information about what is happening with headers - - Improve btcctl utility in the following ways: - - Add getaddednodeinfo command - - Add getnettotals command - - Add getblocktemplate command (wallet-specific) - - Add getwork command (wallet-specific) - - Add getnewaddress command (wallet-specific) - - Add walletpassphrasechange command (wallet-specific) - - Add walletlock command (wallet-specific) - - Add sendfrom command (wallet-specific) - - Add sendmany command (wallet-specific) - - Add settxfee command (wallet-specific) - - Add listsinceblock command (wallet-specific) - - Add listaccounts command (wallet-specific) - - Add keypoolrefill command (wallet-specific) - - Add getreceivedbyaccount command (wallet-specific) - - Add getrawchangeaddress command (wallet-specific) - - Add gettxoutsetinfo command (wallet-specific) - - Add listaddressgroupings command (wallet-specific) - - Add listlockunspent command (wallet-specific) - - Add listlock command (wallet-specific) - - Add listreceivedbyaccount command (wallet-specific) - - Add validateaddress command (wallet-specific) - - Add verifymessage command (wallet-specific) - - Add sendtoaddress command (wallet-specific) - - Continue cleanup and work on implementing the RPC API: - - Implement submitblock command - (https://github.com/conformal/btcd/issues/61) - - Implement help command - - Implement ping command - - Implement getaddednodeinfo command - (https://github.com/conformal/btcd/issues/78) - - Implement getinfo command - - Update getpeerinfo to support bytesrecv and bytessent - (https://github.com/conformal/btcd/issues/83) - - Improve and correct several RPC server and websocket areas: - - Change the connection endpoint for websockets from /wallet to /ws - (https://github.com/conformal/btcd/issues/80) - - Implement an alternative authentication for websockets so clients - such as javascript from browsers that don't support setting HTTP - headers can authenticate (https://github.com/conformal/btcd/issues/77) - - Add an authentication deadline for RPC connections - (https://github.com/conformal/btcd/issues/68) - - Use standard authentication failure responses for RPC connections - - Make automatically generated certificate more standard so it works - from client such as node.js and Firefox - - Correct some minor issues which could prevent the RPC server from - shutting down in an orderly fashion - - Make all websocket notifications require registration - - Change the data sent over websockets to text since it is JSON-RPC - - Allow connections that do not have an Origin header set - - Expose and track the number of bytes read and written per peer - (https://github.com/conformal/btcwire/issues/6) - - Correct an issue with sendrawtransaction when invoked via websockets - which prevented a minedtx notification from being added - - Rescan operations issued from remote wallets are no stopped when - the wallet disconnects mid-operation - (https://github.com/conformal/btcd/issues/66) - - Several optimizations related to fetching block information from the - database - - General code cleanup - -Changes in 0.5.0 (Mon Jan 13 2014) - - Optimize initial block download by introducing a new mode which - downloads the block headers first (up to the final checkpoint) - - Improve peer handling to remove the potential for slow peers to cause - sluggishness amongst all peers - (https://github.com/conformal/btcd/issues/63) - - Fix an issue where the initial block sync could stall when the sync peer - disconnects (https://github.com/conformal/btcd/issues/62) - - Correct an issue where --externalip was doing a DNS lookup on the full - host:port instead of just the host portion - (https://github.com/conformal/btcd/issues/38) - - Fix an issue which could lead to a panic on chain switches - (https://github.com/conformal/btcd/issues/70) - - Improve btcctl utility in the following ways: - - Show getdifficulty output as floating point to 6 digits of precision - - Show all JSON object replies formatted as standard JSON - - Allow btcctl getblock to accept optional params - - Add getaccount command (wallet-specific) - - Add getaccountaddress command (wallet-specific) - - Add sendrawtransaction command - - Continue cleanup and work on implementing RPC API calls - - Update getrawmempool to support new optional verbose flag - - Update getrawtransaction to match the reference client - - Update getblock to support new optional verbose flag - - Update raw transactions to fully match the reference client including - support for all transaction types and address types - - Correct getrawmempool fee field to return BTC instead of Satoshi - - Correct getpeerinfo service flag to return 8 digit string so it - matches the reference client - - Correct verifychain to return a boolean - - Implement decoderawtransaction command - - Implement createrawtransaction command - - Implement decodescript command - - Implement gethashespersec command - - Allow RPC handler overrides when invoked via a websocket versus - legacy connection - - Add new DNS seed for peer discovery - - Display user agent on new valid peer log message - (https://github.com/conformal/btcd/issues/64) - - Notify wallet when new transactions that pay to registered addresses - show up in the mempool before being mined into a block - - Support a tor-specific proxy in addition to a normal proxy - (https://github.com/conformal/btcd/issues/47) - - Remove deprecated sqlite3 imports from utilities - - Remove leftover profile write from addblock utility - - Quite a bit of code cleanup and refactoring to improve maintainability - -Changes in 0.4.0 (Thu Dec 12 2013) - - Allow listen interfaces to be specified via --listen instead of only the - port (https://github.com/conformal/btcd/issues/33) - - Allow listen interfaces for the RPC server to be specified via - --rpclisten instead of only the port - (https://github.com/conformal/btcd/issues/34) - - Only disable listening when --connect or --proxy are used when no - --listen interface are specified - (https://github.com/conformal/btcd/issues/10) - - Add several new standard transaction checks to transaction memory pool: - - Support nulldata scripts as standard - - Only allow a max of one nulldata output per transaction - - Enforce a maximum of 3 public keys in multi-signature transactions - - The number of signatures in multi-signature transactions must not - exceed the number of public keys - - The number of inputs to a signature script must match the expected - number of inputs for the script type - - The number of inputs pushed onto the stack by a redeeming signature - script must match the number of inputs consumed by the referenced - public key script - - When a block is connected, remove any transactions from the memory pool - which are now double spends as a result of the newly connected - transactions - - Don't relay transactions resurrected during a chain switch since - other peers will also be switching chains and therefore already know - about them - - Cleanup a few cases where rejected transactions showed as an error - rather than as a rejected transaction - - Ignore the default configuration file when --regtest (regression test - mode) is specified - - Implement TLS support for RPC including automatic certificate generation - - Support HTTP authentication headers for web sockets - - Update address manager to recognize and properly work with Tor - addresses (https://github.com/conformal/btcd/issues/36) and - (https://github.com/conformal/btcd/issues/37) - - Improve btcctl utility in the following ways: - - Add the ability to specify a configuration file - - Add a default entry for the RPC cert to point to the location - it will likely be in the btcd home directory - - Implement --version flag - - Provide a --notls option to support non-TLS configurations - - Fix a couple of minor races found by the Go race detector - - Improve logging - - Allow logging level to be specified on a per subsystem basis - (https://github.com/conformal/btcd/issues/48) - - Allow logging levels to be dynamically changed via RPC - (https://github.com/conformal/btcd/issues/15) - - Implement a rolling log file with a max of 10MB per file and a - rotation size of 3 which results in a max logging size of 30 MB - - Correct a minor issue with the rescanning websocket call - (https://github.com/conformal/btcd/issues/54) - - Fix a race with pushing address messages that could lead to a panic - (https://github.com/conformal/btcd/issues/58) - - Improve which external IP address is reported to peers based on which - interface they are connected through - (https://github.com/conformal/btcd/issues/35) - - Add --externalip option to allow an external IP address to be specified - for cases such as tor hidden services or advanced network configurations - (https://github.com/conformal/btcd/issues/38) - - Add --upnp option to support automatic port mapping via UPnP - (https://github.com/conformal/btcd/issues/51) - - Update Ctrl+C interrupt handler to properly sync address manager and - remove the UPnP port mapping (if needed) - - Continue cleanup and work on implementing RPC API calls - - Add importprivkey (import private key) command to btcctl - - Update getrawtransaction to provide addresses properly, support - new verbose param, and match the reference implementation with the - exception of MULTISIG (thanks @flammit) - - Update getblock with new verbose flag (thanks @flammit) - - Add listtransactions command to btcctl - - Add getbalance command to btcctl - - Add basic support for btcd to run as a native Windows service - (https://github.com/conformal/btcd/issues/42) - - Package addblock utility with Windows MSIs - - Add support for TravisCI (continuous build integration) - - Cleanup some documentation and usage - - Several other minor bug fixes and general code cleanup - -Changes in 0.3.3 (Wed Nov 13 2013) - - Significantly improve initial block chain download speed - (https://github.com/conformal/btcd/issues/20) - - Add a new checkpoint at block height 267300 - - Optimize most recently used inventory handling - (https://github.com/conformal/btcd/issues/21) - - Optimize duplicate transaction input check - (https://github.com/conformal/btcchain/issues/2) - - Optimize transaction hashing - (https://github.com/conformal/btcd/issues/25) - - Rework and optimize wallet listener notifications - (https://github.com/conformal/btcd/issues/22) - - Optimize serialization and deserialization - (https://github.com/conformal/btcd/issues/27) - - Add support for minimum transaction fee to memory pool acceptance - (https://github.com/conformal/btcd/issues/29) - - Improve leveldb database performance by removing explicit GC call - - Fix an issue where Ctrl+C was not always finishing orderly database - shutdown - - Fix an issue in the script handling for OP_CHECKSIG - - Impose max limits on all variable length protocol entries to prevent - abuse from malicious peers - - Enforce DER signatures for transactions allowed into the memory pool - - Separate the debug profile http server from the RPC server - - Rework of the RPC code to improve performance and make the code cleaner - - The getrawtransaction RPC call now properly checks the memory pool - before consulting the db (https://github.com/conformal/btcd/issues/26) - - Add support for the following RPC calls: getpeerinfo, getconnectedcount, - addnode, verifychain - (https://github.com/conformal/btcd/issues/13) - (https://github.com/conformal/btcd/issues/17) - - Implement rescan websocket extension to allow wallet rescans - - Use correct paths for application data storage for all supported - operating systems (https://github.com/conformal/btcd/issues/30) - - Add a default redirect to the http profiling page when accessing the - http profile server - - Add a new --cpuprofile option which can be used to generate CPU - profiling data on platforms that support it - - Several other minor performance optimizations - - Other minor bug fixes and general code cleanup - -Changes in 0.3.2 (Tue Oct 22 2013) - - Fix an issue that could cause the download of the block chain to stall - (https://github.com/conformal/btcd/issues/12) - - Remove deprecated sqlite as an available database backend - - Close sqlite compile issue as sqlite has now been removed - (https://github.com/conformal/btcd/issues/11) - - Change default RPC ports to 8334 (mainnet) and 18334 (testnet) - - Continue cleanup and work on implementing RPC API calls - - Add support for the following RPC calls: getrawmempool, - getbestblockhash, decoderawtransaction, getdifficulty, - getconnectioncount, getpeerinfo, and addnode - - Improve the btcctl utility that is used to issue JSON-RPC commands - - Fix an issue preventing btcd from cleanly shutting down with the RPC - stop command - - Add a number of database interface tests to ensure backends implement - the expected interface - - Expose some additional information from btcscript to be used for - identifying "standard"" transactions - - Add support for plan9 - thanks @mischief - (https://github.com/conformal/btcd/pull/19) - - Other minor bug fixes and general code cleanup - -Changes in 0.3.1-alpha (Tue Oct 15 2013) - - Change default database to leveldb - NOTE: This does mean you will have to redownload the block chain. Since we - are still in alpha, we didn't feel writing a converter was worth the time as - it would take away from more important issues at this stage - - Add a warning if there are multiple block chain databases of different types - - Fix issue with unexpected EOF in leveldb -- https://github.com/conformal/btcd/issues/18 - - Fix issue preventing block 21066 on testnet -- https://github.com/conformal/btcchain/issues/1 - - Fix issue preventing block 96464 on testnet -- https://github.com/conformal/btcscript/issues/1 - - Optimize transaction lookups - - Correct a few cases of list removal that could result in improper cleanup - of no longer needed orphans - - Add functionality to increase ulimits on non-Windows platforms - - Add support for mempool command which allows remote peers to query the - transaction memory pool via the bitcoin protocol - - Clean up logging a bit - - Add a flag to disable checkpoints for developers - - Add a lot of useful debug logging such as message summaries - - Other minor bug fixes and general code cleanup - -Initial Release 0.3.0-alpha (Sat Oct 05 2013): - - Initial release diff --git a/LICENSE b/LICENSE index 53ba0c56..fa218625 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,6 @@ ISC License +Copyright (c) 2021 The LBRY developers Copyright (c) 2013-2017 The btcsuite developers Copyright (c) 2015-2016 The Decred developers diff --git a/README.md b/README.md index 5ec1454f..16800c6f 100644 --- a/README.md +++ b/README.md @@ -1,121 +1,133 @@ -btcd -==== +# lbcd -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) -[![Coverage Status](https://coveralls.io/repos/github/btcsuite/btcd/badge.svg?branch=master)](https://coveralls.io/github/btcsuite/btcd?branch=master) +[![Build Status](https://github.com/lbryio/lbcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/lbryio/lbcd/actions) +[![Coverage Status](https://coveralls.io/repos/github/lbryio/lbcd/badge.svg?branch=master)](https://coveralls.io/github/lbryio/lbcd?branch=master) [![ISC License](https://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd) + -btcd is an alternative full node bitcoin implementation written in Go (golang). +`lbcd` is a full node implementation of LBRY's blockchain written in Go (golang). -This project is currently under active development and is in a Beta state. It -is extremely stable and has been in production use since October 2013. +This project is currently under active development and is in a Beta state while +we ensure it matches LBRYcrd's functionality. The intention is that it properly +downloads, validates, and serves the block chain using the exact rules +(including consensus bugs) for block acceptance as LBRYcrd. +We have taken great care to avoid lbcd causing a fork to the blockchain. -It properly downloads, validates, and serves the block chain using the exact -rules (including consensus bugs) for block acceptance as Bitcoin Core. We have -taken great care to avoid btcd causing a fork to the block chain. It includes a -full block validation testing framework which contains all of the 'official' -block acceptance tests (and some additional ones) that is run on every pull -request to help ensure it properly follows consensus. Also, it passes all of -the JSON test data in the Bitcoin Core code. +Note: `lbcd` does *NOT* include wallet functionality. That functionality is provided by the +[lbcwallet](https://github.com/lbryio/lbcwallet) and the [LBRY SDK](https://github.com/lbryio/lbry-sdk). -It also properly relays newly mined blocks, maintains a transaction pool, and -relays individual transactions that have not yet made it into a block. It -ensures all individual transactions admitted to the pool follow the rules -required by the block chain and also includes more strict checks which filter -transactions based on miner requirements ("standard" transactions). +## Security -One key difference between btcd and Bitcoin Core is that btcd does *NOT* include -wallet functionality and this was a very intentional design decision. See the -blog entry [here](https://web.archive.org/web/20171125143919/https://blog.conformal.com/btcd-not-your-moms-bitcoin-daemon) -for more details. This means you can't actually make or receive payments -directly with btcd. That functionality is provided by the -[btcwallet](https://github.com/btcsuite/btcwallet) and -[Paymetheus](https://github.com/btcsuite/Paymetheus) (Windows-only) projects -which are both under active development. +We take security seriously. Please contact [security](mailto:security@lbry.com) regarding any security issues. +Our PGP key is [here](https://lbry.com/faq/pgp-key) if you need it. + +We maintain a mailing list for notifications of upgrades, security issues, +and soft/hard forks. To join, visit [fork list](https://lbry.com/forklist) ## Requirements -[Go](http://golang.org) 1.16 or newer. +All common operating systems are supported. lbcd requires at least 8GB of RAM +and at least 100GB of disk storage. Both RAM and disk requirements increase slowly over time. +Using a fast NVMe disk is recommended. + +`lbcd` is not immune to data loss. It expects a clean shutdown via SIGINT or +SIGTERM. SIGKILL, immediate VM kills, and sudden power loss can cause data +corruption, thus requiring chain resynchronization for recovery. + +For compilation, [Go](http://golang.org) 1.16 or newer is required. ## Installation -https://github.com/btcsuite/btcd/releases +Acquire binary files from [releases](https://github.com/lbryio/lbcd/releases) -#### Linux/BSD/MacOSX/POSIX - Build from Source +### To build from Source on Linux/BSD/MacOSX/POSIX -- Install Go according to the installation instructions here: - http://golang.org/doc/install +Install Go according to its [installation instructions](http://golang.org/doc/install). -- Ensure Go was installed properly and is a supported version: +``` sh +git clone https://github.com/lbryio/lbcd +cd lbcd -```bash -$ go version -$ go env GOROOT GOPATH +# Build lbcd +go build . + +# Build lbcctl +go build ./cmd/lbcctl ``` -NOTE: The `GOROOT` and `GOPATH` above must not be the same path. It is -recommended that `GOPATH` is set to a directory in your home directory such as -`~/goprojects` to avoid write permission issues. It is also recommended to add -`$GOPATH/bin` to your `PATH` at this point. +Both [GoLand](https://www.jetbrains.com/go/) +and [VS Code](https://code.visualstudio.com/docs/languages/go) IDEs are supported. -- Run the following commands to obtain btcd, all dependencies, and install it: +## Usage -```bash -$ cd $GOPATH/src/github.com/btcsuite/btcd -$ GO111MODULE=on go install -v . ./cmd/... +By default, data and logs are stored in ``: + +- Linux: `~/.lbcd/` +- MacOS: `/Users//Library/Application Support/Lbcd/` + +To enable RPC access a username and password is required. Example: + +``` sh +./lbcd --txindex --rpcuser=rpcuser --rpcpass=rpcpass ``` -- btcd (and utilities) will now be installed in ```$GOPATH/bin```. If you did - not already add the bin directory to your system path during Go installation, - we recommend you do so now. +Interact with lbcd via RPC using `lbcctl` -## Updating - -#### Linux/BSD/MacOSX/POSIX - Build from Source - -- Run the following commands to update btcd, all dependencies, and install it: - -```bash -$ cd $GOPATH/src/github.com/btcsuite/btcd -$ git pull -$ GO111MODULE=on go install -v . ./cmd/... +``` sh +./lbcctl --rpcuser=rpcuser --rpcpass=rpcpass getblockcount +./lbcctl --rpcuser=rpcuser --rpcpass=rpcpass getblocktemplate ``` -## Getting Started +By default, the RPCs are served over TLS. `lbcd` generates (if not exists) `rpc.cert` and +`rpc.key` under `` where `lbcctl` would search and use them. -btcd has several configuration options available to tweak how it runs, but all -of the basic operations described in the intro section work with zero -configuration. +The RPCs can also be served without TLS *(on localhost only)* using (`--notls`) -#### Linux/BSD/POSIX/Source - -```bash -$ ./btcd +``` sh +./lbcd --txindex --rpcuser=rpcuser --rpcpass=rpcpass --notls +./lbcctl --rpcuser=rpcuser --rpcpass=rpcpass --notls getblockcount ``` -## IRC +## Working with Different Networks -- irc.libera.chat -- channel #btcd -- [webchat](https://web.libera.chat/gamja/?channels=btcd) +By default, `lbcd` and `lbcctl` use the following ports for different networks respectively: -## Issue Tracker +| Network | RPC Port | Network Port | +| ------- | -------- | ------------ | +| mainnet | 9245 | 9246 | +| testnet | 19245 | 19246 | +| regtest | 29245 | 29246 | -The [integrated github issue tracker](https://github.com/btcsuite/btcd/issues) -is used for this project. +Running `lbcd` and `lbcctl` with `--testnet` or `--regtest` would use different chain params as well as default RPC and Network ports. -## Documentation +``` sh +./lbcd --txindex --rpcuser=rpcuser --rpcpass=rpcpass --regtest +./lbcctl --rpcuser=rpcuser --rpcpass=rpcpass --regtest getblockcount +``` -The documentation is a work-in-progress. It is located in the [docs](https://github.com/btcsuite/btcd/tree/master/docs) folder. +The default Network and RPC ports of `lbcd` can be overriden using `--listen` and `--rpclisten` +`lbcctl` can also connect to RPC server specified by `--rpcserver` -## Release Verification +``` sh +./lbcd --txindex --rpcuser=rpcuser --rpcpass=rpcpass --regtest --listen=127.0.0.1:29248 --rpclisten=127.0.0.1:29247 +./lbcctl --rpcuser=rpcuser --rpcpass=rpcpass --regtest --rpcserver=127.0.0.1:29247 getblockcount +``` +Note: Wallet related RPCs are provided by [lbcwallet](https://github.com/lbryio/lbcwallet). + +## Contributing + +Contributions to this project are welcome, encouraged, and compensated. +The [integrated github issue tracker](https://github.com/lbryio/lbcd/issues) +is used for this project. All pull requests will be considered. + + ## License -btcd is licensed under the [copyfree](http://copyfree.org) ISC License. +lbcd is licensed under the [copyfree](http://copyfree.org) ISC License. diff --git a/blockchain/README.md b/blockchain/README.md index 2237780c..cb9ddb45 100644 --- a/blockchain/README.md +++ b/blockchain/README.md @@ -1,30 +1,9 @@ blockchain ========== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/blockchain) -Package blockchain implements bitcoin block handling and chain selection rules. -The test coverage is currently only around 60%, but will be increasing over -time. See `test_coverage.txt` for the gocov coverage report. Alternatively, if -you are running a POSIX OS, you can run the `cov_report.sh` script for a -real-time report. Package blockchain is licensed under the liberal ISC license. - -There is an associated blog post about the release of this package -[here](https://blog.conformal.com/btcchain-the-bitcoin-chain-package-from-bctd/). - -This package has intentionally been designed so it can be used as a standalone -package for any projects needing to handle processing of blocks into the bitcoin -block chain. - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/blockchain -``` - -## Bitcoin Chain Processing Overview +### Bitcoin Chain Processing Overview Before a block is allowed into the block chain, it must go through an intensive series of validation rules. The following list serves as a general outline of @@ -57,47 +36,4 @@ is by no means exhaustive: transaction values - Run the transaction scripts to verify the spender is allowed to spend the coins - - Insert the block into the block database - -## Examples - -* [ProcessBlock Example](https://pkg.go.dev/github.com/btcsuite/btcd/blockchain#example-BlockChain-ProcessBlock) - Demonstrates how to create a new chain instance and use ProcessBlock to - attempt to add a block to the chain. This example intentionally - attempts to insert a duplicate genesis block to illustrate how an invalid - block is handled. - -* [CompactToBig Example](https://pkg.go.dev/github.com/btcsuite/btcd/blockchain#example-CompactToBig) - Demonstrates how to convert the compact "bits" in a block header which - represent the target difficulty to a big integer and display it using the - typical hex notation. - -* [BigToCompact Example](https://pkg.go.dev/github.com/btcsuite/btcd/blockchain#example-BigToCompact) - Demonstrates how to convert a target difficulty into the - compact "bits" in a block header which represent that target difficulty. - -## GPG Verification Key - -All official release tags are signed by Conformal so users can ensure the code -has not been tampered with and is coming from the btcsuite developers. To -verify the signature perform the following: - -- Download the public key from the Conformal website at - https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt - -- Import the public key into your GPG keyring: - ```bash - gpg --import GIT-GPG-KEY-conformal.txt - ``` - -- Verify the release tag with the following command where `TAG_NAME` is a - placeholder for the specific tag: - ```bash - git tag -v TAG_NAME - ``` - -## License - - -Package blockchain is licensed under the [copyfree](http://copyfree.org) ISC -License. + - Insert the block into the block database \ No newline at end of file diff --git a/blockchain/fullblocktests/README.md b/blockchain/fullblocktests/README.md index 943989be..de7781dc 100644 --- a/blockchain/fullblocktests/README.md +++ b/blockchain/fullblocktests/README.md @@ -1,9 +1,9 @@ fullblocktests ============== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) +[![Build Status](https://github.com/lbryio/lbcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/lbryio/lbcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/blockchain/fullblocktests) +[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/lbryio/lbcd/blockchain/fullblocktests) Package fullblocktests provides a set of full block tests to be used for testing the consensus validation rules. The tests are intended to be flexible enough to @@ -20,7 +20,7 @@ of blocks that exercise the consensus validation rules. ## Installation and Updating ```bash -$ go get -u github.com/btcsuite/btcd/blockchain/fullblocktests +$ go get -u github.com/lbryio/lbcd/blockchain/fullblocktests ``` ## License diff --git a/blockchain/indexers/README.md b/blockchain/indexers/README.md index f4849152..989cb555 100644 --- a/blockchain/indexers/README.md +++ b/blockchain/indexers/README.md @@ -1,9 +1,9 @@ indexers ======== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) +[![Build Status](https://github.com/lbryio/lbcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/lbryio/lbcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://pkg.go.dev/github.com/btcsuite/btcd/blockchain/indexers?status.png)](https://pkg.go.dev/github.com/btcsuite/btcd/blockchain/indexers) +[![GoDoc](https://pkg.go.dev/github.com/lbryio/lbcd/blockchain/indexers?status.png)](https://pkg.go.dev/github.com/lbryio/lbcd/blockchain/indexers) Package indexers implements optional block chain indexes. @@ -23,7 +23,7 @@ via an RPC interface. ## Installation ```bash -$ go get -u github.com/btcsuite/btcd/blockchain/indexers +$ go get -u github.com/lbryio/lbcd/blockchain/indexers ``` ## License diff --git a/btcec/README.md b/btcec/README.md index a6dd2cf2..0cf57a80 100644 --- a/btcec/README.md +++ b/btcec/README.md @@ -1,68 +1,11 @@ btcec ===== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://pkg.go.dev/github.com/btcsuite/btcd/btcec?status.png)](https://pkg.go.dev/github.com/btcsuite/btcd/btcec) -Package btcec implements elliptic curve cryptography needed for working with +btcec implements elliptic curve cryptography needed for working with Bitcoin (secp256k1 only for now). It is designed so that it may be used with the standard crypto/ecdsa packages provided with go. A comprehensive suite of test is provided to ensure proper functionality. Package btcec was originally based on work from ThePiachu which is licensed under the same terms as Go, but it has -signficantly diverged since then. The btcsuite developers original is licensed -under the liberal ISC license. - -Although this package was primarily written for btcd, it has intentionally been -designed so it can be used as a standalone package for any projects needing to -use secp256k1 elliptic curve cryptography. - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/btcec -``` - -## Examples - -* [Sign Message](https://pkg.go.dev/github.com/btcsuite/btcd/btcec#example-package--SignMessage) - Demonstrates signing a message with a secp256k1 private key that is first - parsed form raw bytes and serializing the generated signature. - -* [Verify Signature](https://pkg.go.dev/github.com/btcsuite/btcd/btcec#example-package--VerifySignature) - Demonstrates verifying a secp256k1 signature against a public key that is - first parsed from raw bytes. The signature is also parsed from raw bytes. - -* [Encryption](https://pkg.go.dev/github.com/btcsuite/btcd/btcec#example-package--EncryptMessage) - Demonstrates encrypting a message for a public key that is first parsed from - raw bytes, then decrypting it using the corresponding private key. - -* [Decryption](https://pkg.go.dev/github.com/btcsuite/btcd/btcec#example-package--DecryptMessage) - Demonstrates decrypting a message using a private key that is first parsed - from raw bytes. - -## GPG Verification Key - -All official release tags are signed by Conformal so users can ensure the code -has not been tampered with and is coming from the btcsuite developers. To -verify the signature perform the following: - -- Download the public key from the Conformal website at - https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt - -- Import the public key into your GPG keyring: - ```bash - gpg --import GIT-GPG-KEY-conformal.txt - ``` - -- Verify the release tag with the following command where `TAG_NAME` is a - placeholder for the specific tag: - ```bash - git tag -v TAG_NAME - ``` - -## License - -Package btcec is licensed under the [copyfree](http://copyfree.org) ISC License -except for btcec.go and btcec_test.go which is under the same license as Go. - +signficantly diverged since then. \ No newline at end of file diff --git a/btcjson/README.md b/btcjson/README.md index 48f32263..9d981333 100644 --- a/btcjson/README.md +++ b/btcjson/README.md @@ -1,70 +1,8 @@ btcjson ======= -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/btcjson) Package btcjson implements concrete types for marshalling to and from the bitcoin JSON-RPC API. A comprehensive suite of tests is provided to ensure -proper functionality. - -Although this package was primarily written for the btcsuite, it has -intentionally been designed so it can be used as a standalone package for any -projects needing to marshal to and from bitcoin JSON-RPC requests and responses. - -Note that although it's possible to use this package directly to implement an -RPC client, it is not recommended since it is only intended as an infrastructure -package. Instead, RPC clients should use the -[btcrpcclient](https://github.com/btcsuite/btcrpcclient) package which provides -a full blown RPC client with many features such as automatic connection -management, websocket support, automatic notification re-registration on -reconnect, and conversion from the raw underlying RPC types (strings, floats, -ints, etc) to higher-level types with many nice and useful properties. - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/btcjson -``` - -## Examples - -* [Marshal Command](https://pkg.go.dev/github.com/btcsuite/btcd/btcjson#example-MarshalCmd) - Demonstrates how to create and marshal a command into a JSON-RPC request. - -* [Unmarshal Command](https://pkg.go.dev/github.com/btcsuite/btcd/btcjson#example-UnmarshalCmd) - Demonstrates how to unmarshal a JSON-RPC request and then unmarshal the - concrete request into a concrete command. - -* [Marshal Response](https://pkg.go.dev/github.com/btcsuite/btcd/btcjson#example-MarshalResponse) - Demonstrates how to marshal a JSON-RPC response. - -* [Unmarshal Response](https://pkg.go.dev/github.com/btcsuite/btcd/btcjson#example-package--UnmarshalResponse) - Demonstrates how to unmarshal a JSON-RPC response and then unmarshal the - result field in the response to a concrete type. - -## GPG Verification Key - -All official release tags are signed by Conformal so users can ensure the code -has not been tampered with and is coming from the btcsuite developers. To -verify the signature perform the following: - -- Download the public key from the Conformal website at - https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt - -- Import the public key into your GPG keyring: - ```bash - gpg --import GIT-GPG-KEY-conformal.txt - ``` - -- Verify the release tag with the following command where `TAG_NAME` is a - placeholder for the specific tag: - ```bash - git tag -v TAG_NAME - ``` - -## License - -Package btcjson is licensed under the [copyfree](http://copyfree.org) ISC -License. +proper functionality. \ No newline at end of file diff --git a/chaincfg/README.md b/chaincfg/README.md index 72fac2e7..da3254c7 100644 --- a/chaincfg/README.md +++ b/chaincfg/README.md @@ -1,85 +1,8 @@ chaincfg ======== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/chaincfg) Package chaincfg defines chain configuration parameters for the three standard -Bitcoin networks and provides the ability for callers to define their own custom -Bitcoin networks. - -Although this package was primarily written for btcd, it has intentionally been -designed so it can be used as a standalone package for any projects needing to -use parameters for the standard Bitcoin networks or for projects needing to -define their own network. - -## Sample Use - -```Go -package main - -import ( - "flag" - "fmt" - "log" - - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcd/chaincfg" -) - -var testnet = flag.Bool("testnet", false, "operate on the testnet Bitcoin network") - -// By default (without -testnet), use mainnet. -var chainParams = &chaincfg.MainNetParams - -func main() { - flag.Parse() - - // Modify active network parameters if operating on testnet. - if *testnet { - chainParams = &chaincfg.TestNet3Params - } - - // later... - - // Create and print new payment address, specific to the active network. - pubKeyHash := make([]byte, 20) - addr, err := btcutil.NewAddressPubKeyHash(pubKeyHash, chainParams) - if err != nil { - log.Fatal(err) - } - fmt.Println(addr) -} -``` - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/chaincfg -``` - -## GPG Verification Key - -All official release tags are signed by Conformal so users can ensure the code -has not been tampered with and is coming from the btcsuite developers. To -verify the signature perform the following: - -- Download the public key from the Conformal website at - https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt - -- Import the public key into your GPG keyring: - ```bash - gpg --import GIT-GPG-KEY-conformal.txt - ``` - -- Verify the release tag with the following command where `TAG_NAME` is a - placeholder for the specific tag: - ```bash - git tag -v TAG_NAME - ``` - -## License - -Package chaincfg is licensed under the [copyfree](http://copyfree.org) ISC -License. +LBRY networks and provides the ability for callers to define their own custom +LBRY networks. \ No newline at end of file diff --git a/chaincfg/chainhash/README.md b/chaincfg/chainhash/README.md index b7ddf19e..da54f734 100644 --- a/chaincfg/chainhash/README.md +++ b/chaincfg/chainhash/README.md @@ -1,9 +1,9 @@ chainhash ========= -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) +[![Build Status](https://github.com/lbryio/lbcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/lbryio/lbcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/chaincfg/chainhash) +[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/lbryio/lbcd/chaincfg/chainhash) ======= chainhash provides a generic hash type and associated functions that allows the @@ -12,7 +12,7 @@ specific hash algorithm to be abstracted. ## Installation and Updating ```bash -$ go get -u github.com/btcsuite/btcd/chaincfg/chainhash +$ go get -u github.com/lbryio/lbcd/chaincfg/chainhash ``` ## GPG Verification Key diff --git a/connmgr/README.md b/connmgr/README.md index b1aa3cc7..5237bf46 100644 --- a/connmgr/README.md +++ b/connmgr/README.md @@ -1,13 +1,11 @@ connmgr ======= -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/connmgr) -Package connmgr implements a generic Bitcoin network connection manager. +Package connmgr implements a generic network connection manager. -## Overview +### Overview Connection Manager handles all the general connection concerns such as maintaining a set number of outbound connections, sourcing peers, banning, @@ -18,20 +16,10 @@ connection requests from a source or a set of given addresses, dial them and notify the caller on connections. The main intended use is to initialize a pool of active connections and maintain them to remain connected to the P2P network. -In addition the connection manager provides the following utilities: +In addition, the connection manager provides the following utilities: - Notifications on connections or disconnections - Handle failures and retry new addresses from the source - Connect only to specified addresses - Permanent connections with increasing backoff retry timers -- Disconnect or Remove an established connection - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/connmgr -``` - -## License - -Package connmgr is licensed under the [copyfree](http://copyfree.org) ISC License. +- Disconnect or Remove an established connection \ No newline at end of file diff --git a/database/README.md b/database/README.md index 21563d1a..6e937304 100644 --- a/database/README.md +++ b/database/README.md @@ -1,9 +1,7 @@ database ======== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/database) Package database provides a block and metadata storage database. @@ -13,8 +11,8 @@ one entity can have the database open at a time (for most database backends), and that entity will be btcd. When a client wants programmatic access to the data provided by btcd, they'll -likely want to use the [rpcclient](https://github.com/btcsuite/btcd/tree/master/rpcclient) -package which makes use of the [JSON-RPC API](https://github.com/btcsuite/btcd/tree/master/docs/json_rpc_api.md). +likely want to use the [rpcclient](https://github.com/lbryio/lbcd/tree/master/rpcclient) +package which makes use of the [JSON-RPC API](https://github.com/lbryio/lbcd/tree/master/docs/json_rpc_api.md). However, this package could be extremely useful for any applications requiring Bitcoin block storage capabilities. @@ -32,26 +30,4 @@ storage, and strict checksums in key areas to ensure data integrity. - Nested buckets - Iteration support including cursors with seek capability - Supports registration of backend databases -- Comprehensive test coverage - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/database -``` - -## Examples - -* [Basic Usage Example](https://pkg.go.dev/github.com/btcsuite/btcd/database#example-package--BasicUsage) - Demonstrates creating a new database and using a managed read-write - transaction to store and retrieve metadata. - -* [Block Storage and Retrieval Example](https://pkg.go.dev/github.com/btcsuite/btcd/database#example-package--BlockStorageAndRetrieval) - Demonstrates creating a new database, using a managed read-write transaction - to store a block, and then using a managed read-only transaction to fetch the - block. - -## License - -Package database is licensed under the [copyfree](http://copyfree.org) ISC -License. +- Comprehensive test coverage \ No newline at end of file diff --git a/database/ffldb/README.md b/database/ffldb/README.md index 5b855faa..4a43fb73 100644 --- a/database/ffldb/README.md +++ b/database/ffldb/README.md @@ -1,9 +1,9 @@ ffldb ===== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) +[![Build Status](https://github.com/lbryio/lbcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/lbryio/lbcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://pkg.go.dev/github.com/btcsuite/btcd/database/ffldb?status.png)](https://pkg.go.dev/github.com/btcsuite/btcd/database/ffldb) +[![GoDoc](https://pkg.go.dev/github.com/lbryio/lbcd/database/ffldb?status.png)](https://pkg.go.dev/github.com/lbryio/lbcd/database/ffldb) ======= Package ffldb implements a driver for the database package that uses leveldb for diff --git a/database/internal/treap/README.md b/database/internal/treap/README.md index 14c3159a..28f0c810 100644 --- a/database/internal/treap/README.md +++ b/database/internal/treap/README.md @@ -1,9 +1,9 @@ treap ===== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) +[![Build Status](https://github.com/lbryio/lbcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/lbryio/lbcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://pkg.go.dev/github.com/btcsuite/btcd/database/internal/treap?status.png)](https://pkg.go.dev/github.com/btcsuite/btcd/database/internal/treap) +[![GoDoc](https://pkg.go.dev/github.com/lbryio/lbcd/database/internal/treap?status.png)](https://pkg.go.dev/github.com/lbryio/lbcd/database/internal/treap) Package treap implements a treap data structure that is used to hold ordered key/value pairs using a combination of binary search tree and heap semantics. diff --git a/doc.go b/doc.go index ce62a7cc..ee4a9405 100644 --- a/doc.go +++ b/doc.go @@ -71,8 +71,8 @@ Application Options: fee to the given amount in thousands of bytes per minute (default: 15) --listen= Add an interface/port to listen for connections - (default all interfaces port: 8333, testnet: - 18333, signet: 38333) + (default all interfaces port: 9246, testnet: + 19246, regtest: 29246, signet: 39246) --logdir= Directory to log output --maxorphantx= Max number of orphan transactions to keep in memory (default: 100) @@ -123,7 +123,7 @@ Application Options: --rpclimitpass= Password for limited RPC connections --rpclimituser= Username for limited RPC connections --rpclisten= Add an interface/port to listen for RPC - connections (default port: 8334, testnet: 18334) + connections (default port: 9245, testnet: 19245, regtest: 29245) --rpcmaxclients= Max number of RPC clients for standard connections (default: 10) --rpcmaxconcurrentreqs= Max number of concurrent RPC requests that may be diff --git a/docs/code_contribution_guidelines.md b/docs/code_contribution_guidelines.md deleted file mode 100644 index c0a7eecc..00000000 --- a/docs/code_contribution_guidelines.md +++ /dev/null @@ -1,319 +0,0 @@ -# Code contribution guidelines - -Developing cryptocurrencies is an exciting endeavor that touches a wide variety -of areas such as wire protocols, peer-to-peer networking, databases, -cryptography, language interpretation (transaction scripts), RPC, and -websockets. They also represent a radical shift to the current fiscal system -and as a result provide an opportunity to help reshape the entire financial -system. There are few projects that offer this level of diversity and impact -all in one code base. - -However, as exciting as it is, one must keep in mind that cryptocurrencies -represent real money and introducing bugs and security vulnerabilities can have -far more dire consequences than in typical projects where having a small bug is -minimal by comparison. In the world of cryptocurrencies, even the smallest bug -in the wrong area can cost people a significant amount of money. For this -reason, the btcd suite has a formalized and rigorous development process which -is outlined on this page. - -We highly encourage code contributions, however it is imperative that you adhere -to the guidelines established on this page. - -## Minimum Recommended Skillset - -The following list is a set of core competencies that we recommend you possess -before you really start attempting to contribute code to the project. These are -not hard requirements as we will gladly accept code contributions as long as -they follow the guidelines set forth on this page. That said, if you don't have -the following basic qualifications you will likely find it quite difficult to -contribute. - -- A reasonable understanding of bitcoin at a high level (see the - [Required Reading](#ReqReading) section for the original white paper) -- Experience in some type of C-like language -- An understanding of data structures and their performance implications -- Familiarity with unit testing -- Debugging experience -- Ability to understand not only the area you are making a change in, but also - the code your change relies on, and the code which relies on your changed code - -Building on top of those core competencies, the recommended skill set largely -depends on the specific areas you are looking to contribute to. For example, -if you wish to contribute to the cryptography code, you should have a good -understanding of the various aspects involved with cryptography such as the -security and performance implications. - -## Required Reading - -- [Effective Go](http://golang.org/doc/effective_go.html) - The entire btcd - suite follows the guidelines in this document. For your code to be accepted, - it must follow the guidelines therein. -- [Original Satoshi Whitepaper](http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCkQFjAA&url=http%3A%2F%2Fbitcoin.org%2Fbitcoin.pdf&ei=os3VUuH8G4SlsASV74GoAg&usg=AFQjCNEipPLigou_1MfB7DQjXCNdlylrBg&sig2=FaHDuT5z36GMWDEnybDJLg&bvm=bv.59378465,d.b2I) - This is the white paper that started it all. Having a solid - foundation to build on will make the code much more comprehensible. - -## Development Practices - -Developers are expected to work in their own trees and submit pull requests when -they feel their feature or bug fix is ready for integration into the master -branch. - -## Share Early, Share Often - -We firmly believe in the share early, share often approach. The basic premise -of the approach is to announce your plans **before** you start work, and once -you have started working, craft your changes into a stream of small and easily -reviewable commits. - -This approach has several benefits: - -- Announcing your plans to work on a feature **before** you begin work avoids - duplicate work -- It permits discussions which can help you achieve your goals in a way that is - consistent with the existing architecture -- It minimizes the chances of you spending time and energy on a change that - might not fit with the consensus of the community or existing architecture and - potentially be rejected as a result -- Incremental development helps ensure you are on the right track with regards - to the rest of the community -- The quicker your changes are merged to master, the less time you will need to - spend rebasing and otherwise trying to keep up with the main code base - -## Testing - -One of the major design goals of all core btcd packages is to aim for complete -test coverage. This is financial software so bugs and regressions can cost -people real money. For this reason every effort must be taken to ensure the -code is as accurate and bug-free as possible. Thorough testing is a good way to -help achieve that goal. - -Unless a new feature you submit is completely trivial, it will probably be -rejected unless it is also accompanied by adequate test coverage for both -positive and negative conditions. That is to say, the tests must ensure your -code works correctly when it is fed correct data as well as incorrect data -(error paths). - -Go provides an excellent test framework that makes writing test code and -checking coverage statistics straight forward. For more information about the -test coverage tools, see the [golang cover blog post](http://blog.golang.org/cover). - -A quick summary of test practices follows: - -- All new code should be accompanied by tests that ensure the code behaves - correctly when given expected values, and, perhaps even more importantly, that - it handles errors gracefully -- When you fix a bug, it should be accompanied by tests which exercise the bug - to both prove it has been resolved and to prevent future regressions - -## Code Documentation and Commenting - -- At a minimum every function must be commented with its intended purpose and - any assumptions that it makes - - Function comments must always begin with the name of the function per - [Effective Go](http://golang.org/doc/effective_go.html) - - Function comments should be complete sentences since they allow a wide - variety of automated presentations such as [go.dev](https://go.dev) - - The general rule of thumb is to look at it as if you were completely - unfamiliar with the code and ask yourself, would this give me enough - information to understand what this function does and how I'd probably want - to use it? -- Exported functions should also include detailed information the caller of the - function will likely need to know and/or understand: - -**WRONG** - -```Go -// convert a compact uint32 to big.Int -func CompactToBig(compact uint32) *big.Int { -``` - -**RIGHT** - -```Go -// CompactToBig converts a compact representation of a whole number N to a -// big integer. The representation is similar to IEEE754 floating point -// numbers. -// -// Like IEEE754 floating point, there are three basic components: the sign, -// the exponent, and the mantissa. They are broken out as follows: -// -// * the most significant 8 bits represent the unsigned base 256 exponent -// * bit 23 (the 24th bit) represents the sign bit -// * the least significant 23 bits represent the mantissa -// -// ------------------------------------------------- -// | Exponent | Sign | Mantissa | -// ------------------------------------------------- -// | 8 bits [31-24] | 1 bit [23] | 23 bits [22-00] | -// ------------------------------------------------- -// -// The formula to calculate N is: -// N = (-1^sign) * mantissa * 256^(exponent-3) -// -// This compact form is only used in bitcoin to encode unsigned 256-bit numbers -// which represent difficulty targets, thus there really is not a need for a -// sign bit, but it is implemented here to stay consistent with bitcoind. -func CompactToBig(compact uint32) *big.Int { -``` - -- Comments in the body of the code are highly encouraged, but they should - explain the intention of the code as opposed to just calling out the - obvious - -**WRONG** - -```Go -// return err if amt is less than 5460 -if amt < 5460 { - return err -} -``` - -**RIGHT** - -```Go -// Treat transactions with amounts less than the amount which is considered dust -// as non-standard. -if amt < 5460 { - return err -} -``` - -**NOTE:** The above should really use a constant as opposed to a magic number, -but it was left as a magic number to show how much of a difference a good -comment can make. - -## Model Git Commit Messages - -This project prefers to keep a clean commit history with well-formed commit -messages. This section illustrates a model commit message and provides a bit -of background for it. This content was originally created by Tim Pope and made -available on his website, however that website is no longer active, so it is -being provided here. - -Here’s a model Git commit message: - -```text -Short (50 chars or less) summary of changes - -More detailed explanatory text, if necessary. Wrap it to about 72 -characters or so. In some contexts, the first line is treated as the -subject of an email and the rest of the text as the body. The blank -line separating the summary from the body is critical (unless you omit -the body entirely); tools like rebase can get confused if you run the -two together. - -Write your commit message in the present tense: "Fix bug" and not "Fixed -bug." This convention matches up with commit messages generated by -commands like git merge and git revert. - -Further paragraphs come after blank lines. - -- Bullet points are okay, too -- Typically a hyphen or asterisk is used for the bullet, preceded by a - single space, with blank lines in between, but conventions vary here -- Use a hanging indent -``` - -Prefix the summary with the subsystem/package when possible. Many other -projects make use of the code and this makes it easier for them to tell when -something they're using has changed. Have a look at [past -commits](https://github.com/btcsuite/btcd/commits/master) for examples of -commit messages. - -Here are some of the reasons why wrapping your commit messages to 72 columns is -a good thing. - -- git log doesn’t do any special special wrapping of the commit messages. With - the default pager of less -S, this means your paragraphs flow far off the edge - of the screen, making them difficult to read. On an 80 column terminal, if we - subtract 4 columns for the indent on the left and 4 more for symmetry on the - right, we’re left with 72 columns. -- git format-patch --stdout converts a series of commits to a series of emails, - using the messages for the message body. Good email netiquette dictates we - wrap our plain text emails such that there’s room for a few levels of nested - reply indicators without overflow in an 80 column terminal. - -## Code Approval Process - -This section describes the code approval process that is used for code -contributions. This is how to get your changes into btcd. - -## Code Review - -All code which is submitted will need to be reviewed before inclusion into the -master branch. This process is performed by the project maintainers and usually -other committers who are interested in the area you are working in as well. - -## Code Review Timeframe - -The timeframe for a code review will vary greatly depending on factors such as -the number of other pull requests which need to be reviewed, the size and -complexity of the contribution, how well you followed the guidelines presented -on this page, and how easy it is for the reviewers to digest your commits. For -example, if you make one monolithic commit that makes sweeping changes to things -in multiple subsystems, it will obviously take much longer to review. You will -also likely be asked to split the commit into several smaller, and hence more -manageable, commits. - -Keeping the above in mind, most small changes will be reviewed within a few -days, while large or far reaching changes may take weeks. This is a good reason -to stick with the [Share Early, Share Often](#ShareOften) development practice -outlined above. - -## What is the review looking for? - -The review is mainly ensuring the code follows the [Development Practices](#DevelopmentPractices) -and [Code Contribution Standards](#Standards). However, there are a few other -checks which are generally performed as follows: - -- The code is stable and has no stability or security concerns -- The code is properly using existing APIs and generally fits well into the - overall architecture -- The change is not something which is deemed inappropriate by community - consensus - -## Rework Code (if needed) - -After the code review, the change will be accepted immediately if no issues are -found. If there are any concerns or questions, you will be provided with -feedback along with the next steps needed to get your contribution merged with -master. In certain cases the code reviewer(s) or interested committers may help -you rework the code, but generally you will simply be given feedback for you to -make the necessary changes. - -This process will continue until the code is finally accepted. - -## Acceptance - -Once your code is accepted, it will be integrated with the master branch. -Typically it will be rebased and fast-forward merged to master as we prefer to -keep a clean commit history over a tangled weave of merge commits. However, -regardless of the specific merge method used, the code will be integrated with -the master branch and the pull request will be closed. - -Rejoice as you will now be listed as a [contributor](https://github.com/btcsuite/btcd/graphs/contributors)! - -## Contribution Standards - -## Contribution Checklist - -- [  ] All changes are Go version 1.3 compliant -- [  ] The code being submitted is commented according to the - [Code Documentation and Commenting](#CodeDocumentation) section -- [  ] For new code: Code is accompanied by tests which exercise both - the positive and negative (error paths) conditions (if applicable) -- [  ] For bug fixes: Code is accompanied by new tests which trigger - the bug being fixed to prevent regressions -- [  ] Any new logging statements use an appropriate subsystem and - logging level -- [  ] Code has been formatted with `go fmt` -- [  ] Running `go test` does not fail any tests -- [  ] Running `go vet` does not report any issues -- [  ] Running [golint](https://github.com/golang/lint) does not - report any **new** issues that did not already exist - -## Licensing of Contributions - -All contributions must be licensed with the -[ISC license](https://github.com/btcsuite/btcd/blob/master/LICENSE). This is -the same license as all of the code in the btcd suite. diff --git a/docs/configuration.md b/docs/configuration.md index c6f95b27..1a02007b 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1,11 +1,11 @@ # Configuration -btcd has a number of [configuration](https://pkg.go.dev/github.com/btcsuite/btcd) -options, which can be viewed by running: `$ btcd --help`. +lbcd has a number of configuration +options, which can be viewed by running: `$ lbcd --help`. ## Peer server listen interface -btcd allows you to bind to specific interfaces which enables you to setup +lbcd allows you to bind to specific interfaces which enables you to setup configurations with varying levels of complexity. The listen parameter can be specified on the command line as shown below with the -- prefix or in the configuration file without the -- prefix (as can all long command line options). @@ -16,42 +16,42 @@ interfaces as a couple of the examples below illustrate. Command Line Examples: -|Flags|Comment| -|----------|------------| -|--listen=|all interfaces on default port which is changed by `--testnet` and `--regtest` (**default**)| -|--listen=0.0.0.0|all IPv4 interfaces on default port which is changed by `--testnet` and `--regtest`| -|--listen=::|all IPv6 interfaces on default port which is changed by `--testnet` and `--regtest`| -|--listen=:8333|all interfaces on port 8333| -|--listen=0.0.0.0:8333|all IPv4 interfaces on port 8333| -|--listen=[::]:8333|all IPv6 interfaces on port 8333| -|--listen=127.0.0.1:8333|only IPv4 localhost on port 8333| -|--listen=[::1]:8333|only IPv6 localhost on port 8333| -|--listen=:8336|all interfaces on non-standard port 8336| -|--listen=0.0.0.0:8336|all IPv4 interfaces on non-standard port 8336| -|--listen=[::]:8336|all IPv6 interfaces on non-standard port 8336| -|--listen=127.0.0.1:8337 --listen=[::1]:8333|IPv4 localhost on port 8337 and IPv6 localhost on port 8333| -|--listen=:8333 --listen=:8337|all interfaces on ports 8333 and 8337| +| Flags | Comment | +| ------------------------------------------- | -------------------------------------------------------------------------------------------- | +| --listen= | all interfaces on default port which is changed by `--testnet` and `--regtest` (**default**) | +| --listen=0.0.0.0 | all IPv4 interfaces on default port which is changed by `--testnet` and `--regtest` | +| --listen=:: | all IPv6 interfaces on default port which is changed by `--testnet` and `--regtest` | +| --listen=:9246 | all interfaces on port 9246 | +| --listen=0.0.0.0:9246 | all IPv4 interfaces on port 9246 | +| --listen=[::]:9246 | all IPv6 interfaces on port 9246 | +| --listen=127.0.0.1:9246 | only IPv4 localhost on port 9246 | +| --listen=[::1]:9246 | only IPv6 localhost on port 9246 | +| --listen=:9247 | all interfaces on non-standard port 9247 | +| --listen=0.0.0.0:9247 | all IPv4 interfaces on non-standard port 9247 | +| --listen=[::]:9247 | all IPv6 interfaces on non-standard port 9247 | +| --listen=127.0.0.1:9248 --listen=[::1]:9246 | IPv4 localhost on port 9248 and IPv6 localhost on port 9246 | +| --listen=:9246 --listen=:9248 | all interfaces on ports 9246 and 9248 | -The following config file would configure btcd to only listen on localhost for both IPv4 and IPv6: +The following config file would configure lbcd to only listen on localhost for both IPv4 and IPv6: ```text [Application Options] -listen=127.0.0.1:8333 -listen=[::1]:8333 +listen=127.0.0.1:9246 +listen=[::1]:9246 ``` -In addition, if you are starting btcd with TLS and want to make it +In addition, if you are starting lbcd with TLS and want to make it available via a hostname, then you will need to generate the TLS certificates for that host. For example, ``` -gencerts --host=myhostname.example.com --directory=/home/me/.btcd/ +gencerts --host=myhostname.example.com --directory=/home/me/.lbcd/ ``` ## RPC server listen interface -btcd allows you to bind the RPC server to specific interfaces which enables you +lbcd allows you to bind the RPC server to specific interfaces which enables you to setup configurations with varying levels of complexity. The `rpclisten` parameter can be specified on the command line as shown below with the -- prefix or in the configuration file without the -- prefix (as can all long command line @@ -76,23 +76,23 @@ A few things to note regarding the RPC server: Command Line Examples: -|Flags|Comment| -|----------|------------| -|--rpclisten=|all interfaces on default port which is changed by `--testnet`| -|--rpclisten=0.0.0.0|all IPv4 interfaces on default port which is changed by `--testnet`| -|--rpclisten=::|all IPv6 interfaces on default port which is changed by `--testnet`| -|--rpclisten=:8334|all interfaces on port 8334| -|--rpclisten=0.0.0.0:8334|all IPv4 interfaces on port 8334| -|--rpclisten=[::]:8334|all IPv6 interfaces on port 8334| -|--rpclisten=127.0.0.1:8334|only IPv4 localhost on port 8334| -|--rpclisten=[::1]:8334|only IPv6 localhost on port 8334| -|--rpclisten=:8336|all interfaces on non-standard port 8336| -|--rpclisten=0.0.0.0:8336|all IPv4 interfaces on non-standard port 8336| -|--rpclisten=[::]:8336|all IPv6 interfaces on non-standard port 8336| -|--rpclisten=127.0.0.1:8337 --listen=[::1]:8334|IPv4 localhost on port 8337 and IPv6 localhost on port 8334| -|--rpclisten=:8334 --listen=:8337|all interfaces on ports 8334 and 8337| +| Flags | Comment | +| ---------------------------------------------- | ------------------------------------------------------------------- | +| --rpclisten= | all interfaces on default port which is changed by `--testnet` | +| --rpclisten=0.0.0.0 | all IPv4 interfaces on default port which is changed by `--testnet` | +| --rpclisten=:: | all IPv6 interfaces on default port which is changed by `--testnet` | +| --rpclisten=:9245 | all interfaces on port 9245 | +| --rpclisten=0.0.0.0:9245 | all IPv4 interfaces on port 9245 | +| --rpclisten=[::]:9245 | all IPv6 interfaces on port 9245 | +| --rpclisten=127.0.0.1:9245 | only IPv4 localhost on port 9245 | +| --rpclisten=[::1]:9245 | only IPv6 localhost on port 9245 | +| --rpclisten=:9247 | all interfaces on non-standard port 9247 | +| --rpclisten=0.0.0.0:9247 | all IPv4 interfaces on non-standard port 9247 | +| --rpclisten=[::]:9247 | all IPv6 interfaces on non-standard port 9247 | +| --rpclisten=127.0.0.1:9248 --listen=[::1]:9245 | IPv4 localhost on port 9248 and IPv6 localhost on port 9245 | +| --rpclisten=:9245 --listen=:9248 | all interfaces on ports 9245 and 9248 | -The following config file would configure the btcd RPC server to listen to all interfaces on the default port, including external interfaces, for both IPv4 and IPv6: +The following config file would configure the lbcd RPC server to listen to all interfaces on the default port, including external interfaces, for both IPv4 and IPv6: ```text [Application Options] @@ -102,21 +102,21 @@ rpclisten= ## Default ports -While btcd is highly configurable when it comes to the network configuration, +While lbcd is highly configurable when it comes to the network configuration, the following is intended to be a quick reference for the default ports used so port forwarding can be configured as required. -btcd provides a `--upnp` flag which can be used to automatically map the bitcoin +lbcd by default will automatically map the peer-to-peer listening port if your router supports UPnP. If your router does -not support UPnP, or you don't wish to use it, please note that only the bitcoin +not support UPnP, or you don't wish to use it, please note that only the peer-to-peer port should be forwarded unless you specifically want to allow RPC -access to your btcd from external sources such as in more advanced network -configurations. +access to your lbcd from external sources such as in more advanced network +configurations. You can disable UPnP with the `--noupnp` daemon option. -|Name|Port| -|----|----| -|Default Bitcoin peer-to-peer port|TCP 8333| -|Default RPC port|TCP 8334| +| Name | Port | +| ------------------------- | -------- | +| Default peer-to-peer port | TCP 9246 | +| Default RPC port | TCP 9245 | ## Using bootstrap.dat @@ -129,7 +129,7 @@ on the last time it was updated. See [this](https://bitcointalk.org/index.php?topic=145386.0) thread on bitcointalk for more details. -**NOTE:** Using bootstrap.dat is entirely optional. Btcd will download the +**NOTE:** Using bootstrap.dat is entirely optional. lbcd will download the block chain from other peers through the Bitcoin protocol with no extra configuration needed. @@ -165,14 +165,14 @@ checkpoints for the known-good block chain at periodic intervals. This ensures that not only is it a valid chain, but it is the same chain that everyone else is using. -### How do I use bootstrap.dat with btcd? +### How do I use bootstrap.dat with lbcd? -btcd comes with a separate utility named `addblock` which can be used to import +lbcd comes with a separate utility named `addblock` which can be used to import `bootstrap.dat`. This approach is used since the import is a one-time operation and we prefer to keep the daemon itself as lightweight as possible. -1. Stop btcd if it is already running. This is required since addblock needs to - access the database used by btcd and it will be locked if btcd is using it. +1. Stop lbcd if it is already running. This is required since addblock needs to + access the database used by lbcd and it will be locked if lbcd is using it. 2. Note the path to the downloaded bootstrap.dat file. 3. Run the addblock utility with the `-i` argument pointing to the location of boostrap.dat: @@ -180,7 +180,7 @@ and we prefer to keep the daemon itself as lightweight as possible. **Windows:** ```bat -"%PROGRAMFILES%\Btcd Suite\Btcd\addblock" -i C:\Path\To\bootstrap.dat +"%PROGRAMFILES%\lbcd Suite\lbcd\addblock" -i C:\Path\To\bootstrap.dat ``` **Linux/Unix/BSD/POSIX:** diff --git a/docs/configuring_tor.md b/docs/configuring_tor.md index ecb03bfc..84bc0efd 100644 --- a/docs/configuring_tor.md +++ b/docs/configuring_tor.md @@ -1,9 +1,9 @@ # Configuring TOR -btcd provides full support for anonymous networking via the +lbcd provides full support for anonymous networking via the [Tor Project](https://www.torproject.org/), including [client-only](#Client) and [hidden service](#HiddenService) configurations along with -[stream isolation](#TorStreamIsolation). In addition, btcd supports a hybrid, +[stream isolation](#TorStreamIsolation). In addition, lbcd supports a hybrid, [bridge mode](#Bridge) which is not anonymous, but allows it to operate as a bridge between regular nodes and hidden service nodes without routing the regular connections through Tor. @@ -15,15 +15,15 @@ hidden service for this reason. ## Client-only -Configuring btcd as a Tor client is straightforward. The first step is +Configuring lbcd as a Tor client is straightforward. The first step is obviously to install Tor and ensure it is working. Once that is done, all that -typically needs to be done is to specify the `--proxy` flag via the btcd command -line or in the btcd configuration file. Typically the Tor proxy address will be +typically needs to be done is to specify the `--proxy` flag via the lbcd command +line or in the lbcd configuration file. Typically the Tor proxy address will be 127.0.0.1:9050 (if using standalone Tor) or 127.0.0.1:9150 (if using the Tor Browser Bundle). If you have Tor configured to require a username and password, you may specify them with the `--proxyuser` and `--proxypass` flags. -By default, btcd assumes the proxy specified with `--proxy` is a Tor proxy and +By default, lbcd assumes the proxy specified with `--proxy` is a Tor proxy and hence will send all traffic, including DNS resolution requests, via the specified proxy. @@ -34,7 +34,7 @@ not be reachable for inbound connections unless you also configure a Tor ### Command line example ```bash -./btcd --proxy=127.0.0.1:9050 +./lbcd --proxy=127.0.0.1:9050 ``` ### Config file example @@ -51,7 +51,7 @@ The first step is to configure Tor to provide a hidden service. Documentation for this can be found on the Tor project website [here](https://www.torproject.org/docs/tor-hidden-service.html.en). However, there is no need to install a web server locally as the linked instructions -discuss since btcd will act as the server. +discuss since lbcd will act as the server. In short, the instructions linked above entail modifying your `torrc` file to add something similar to the following, restarting Tor, and opening the @@ -59,12 +59,12 @@ add something similar to the following, restarting Tor, and opening the address. ```text -HiddenServiceDir /var/tor/btcd -HiddenServicePort 8333 127.0.0.1:8333 +HiddenServiceDir /var/tor/lbcd +HiddenServicePort 9246 127.0.0.1:9246 ``` Once Tor is configured to provide the hidden service and you have obtained your -generated .onion address, configuring btcd as a Tor hidden service requires +generated .onion address, configuring lbcd as a Tor hidden service requires three flags: * `--proxy` to identify the Tor (SOCKS 5) proxy to use for outgoing traffic. @@ -76,7 +76,7 @@ three flags: ### Command line example ```bash -./btcd --proxy=127.0.0.1:9050 --listen=127.0.0.1 --externalip=fooanon.onion +./lbcd --proxy=127.0.0.1:9050 --listen=127.0.0.1 --externalip=fooanon.onion ``` ### Config file example @@ -91,13 +91,13 @@ externalip=fooanon.onion ## Bridge mode (not anonymous) -btcd provides support for operating as a bridge between regular nodes and hidden +lbcd provides support for operating as a bridge between regular nodes and hidden service nodes. In particular this means only traffic which is directed to or from a .onion address is sent through Tor while other traffic is sent normally. _As a result, this mode is **NOT** anonymous._ This mode works by specifying an onion-specific proxy, which is pointed at Tor, -by using the `--onion` flag via the btcd command line or in the btcd +by using the `--onion` flag via the lbcd command line or in the lbcd configuration file. If you have Tor configured to require a username and password, you may specify them with the `--onionuser` and `--onionpass` flags. @@ -111,7 +111,7 @@ routed via Tor due to the `--onion` flag. ### Command line example ```bash -./btcd --onion=127.0.0.1:9050 --externalip=fooanon.onion +./lbcd --onion=127.0.0.1:9050 --externalip=fooanon.onion ``` ### Config file example @@ -128,13 +128,13 @@ externalip=fooanon.onion Tor stream isolation forces Tor to build a new circuit for each connection making it harder to correlate connections. -btcd provides support for Tor stream isolation by using the `--torisolation` +lbcd provides support for Tor stream isolation by using the `--torisolation` flag. This option requires --proxy or --onionproxy to be set. ### Command line example ```bash -./btcd --proxy=127.0.0.1:9050 --torisolation +./lbcd --proxy=127.0.0.1:9050 --torisolation ``` ### Config file example diff --git a/docs/contact.md b/docs/contact.md deleted file mode 100644 index 1ed9fc0b..00000000 --- a/docs/contact.md +++ /dev/null @@ -1,15 +0,0 @@ -# Contact - -## IRC - -* [irc.libera.chat](irc://irc.libera.chat), channel `#btcd` - -## Mailing Lists - -* [btcd](mailto:btcd+subscribe@opensource.conformal.com): discussion of btcd and its packages. -* [btcd-commits](mailto:btcd-commits+subscribe@opensource.conformal.com): readonly mail-out of source code changes. - -## Issue Tracker - -The [integrated github issue tracker](https://github.com/btcsuite/btcd/issues) -is used for this project. diff --git a/docs/controlling.md b/docs/controlling.md index 93ab403b..a187e412 100644 --- a/docs/controlling.md +++ b/docs/controlling.md @@ -1,11 +1,11 @@ -# Controlling and querying btcd via btcctl +# Controlling and querying lbcd via lbcctl -btcctl is a command line utility that can be used to both control and query btcd -via [RPC](http://www.wikipedia.org/wiki/Remote_procedure_call). btcd does +lbcctl is a command line utility that can be used to both control and query lbcd +via [RPC](http://www.wikipedia.org/wiki/Remote_procedure_call). lbcd does **not** enable its RPC server by default; You must configure at minimum both an RPC username and password or both an RPC limited username and password: -* btcd.conf configuration file +* lbcd.conf configuration file ```bash [Application Options] @@ -15,7 +15,7 @@ rpclimituser=mylimituser rpclimitpass=Limitedp4ssw0rd ``` -* btcctl.conf configuration file +* lbcctl.conf configuration file ```bash [Application Options] @@ -31,4 +31,4 @@ rpclimituser=mylimituser rpclimitpass=Limitedp4ssw0rd ``` -For a list of available options, run: `$ btcctl --help` +For a list of available options, run: `$ lbcctl --help` diff --git a/docs/developer_resources.md b/docs/developer_resources.md deleted file mode 100644 index cec8ce99..00000000 --- a/docs/developer_resources.md +++ /dev/null @@ -1,37 +0,0 @@ -# Developer Resources - -* [Code Contribution Guidelines](https://github.com/btcsuite/btcd/tree/master/docs/code_contribution_guidelines.md) - -* [JSON-RPC Reference](https://github.com/btcsuite/btcd/tree/master/docs/json_rpc_api.md) - * [RPC Examples](https://github.com/btcsuite/btcd/tree/master/docs/json_rpc_api.md#ExampleCode) - -* The btcsuite Bitcoin-related Go Packages: - * [btcrpcclient](https://github.com/btcsuite/btcd/tree/master/rpcclient) - Implements a - robust and easy to use Websocket-enabled Bitcoin JSON-RPC client - * [btcjson](https://github.com/btcsuite/btcd/tree/master/btcjson) - Provides an extensive API - for the underlying JSON-RPC command and return values - * [wire](https://github.com/btcsuite/btcd/tree/master/wire) - Implements the - Bitcoin wire protocol - * [peer](https://github.com/btcsuite/btcd/tree/master/peer) - - Provides a common base for creating and managing Bitcoin network peers. - * [blockchain](https://github.com/btcsuite/btcd/tree/master/blockchain) - - Implements Bitcoin block handling and chain selection rules - * [blockchain/fullblocktests](https://github.com/btcsuite/btcd/tree/master/blockchain/fullblocktests) - - Provides a set of block tests for testing the consensus validation rules - * [txscript](https://github.com/btcsuite/btcd/tree/master/txscript) - - Implements the Bitcoin transaction scripting language - * [btcec](https://github.com/btcsuite/btcd/tree/master/btcec) - Implements - support for the elliptic curve cryptographic functions needed for the - Bitcoin scripts - * [database](https://github.com/btcsuite/btcd/tree/master/database) - - Provides a database interface for the Bitcoin block chain - * [mempool](https://github.com/btcsuite/btcd/tree/master/mempool) - - Package mempool provides a policy-enforced pool of unmined bitcoin - transactions. - * [btcutil](https://github.com/btcsuite/btcutil) - Provides Bitcoin-specific - convenience functions and types - * [chainhash](https://github.com/btcsuite/btcd/tree/master/chaincfg/chainhash) - - Provides a generic hash type and associated functions that allows the - specific hash algorithm to be abstracted. - * [connmgr](https://github.com/btcsuite/btcd/tree/master/connmgr) - - Package connmgr implements a generic Bitcoin network connection manager. diff --git a/docs/index.md b/docs/index.md index 9d980626..a3792a6f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,57 +1,11 @@ -# btcd +# lbcd -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd) - -btcd is an alternative full node bitcoin implementation written in Go (golang). - -This project is currently under active development and is in a Beta state. It -is extremely stable and has been in production use since October 2013. - -It properly downloads, validates, and serves the block chain using the exact -rules (including consensus bugs) for block acceptance as Bitcoin Core. We have -taken great care to avoid btcd causing a fork to the block chain. It includes a -full block validation testing framework which contains all of the 'official' -block acceptance tests (and some additional ones) that is run on every pull -request to help ensure it properly follows consensus. Also, it passes all of -the JSON test data in the Bitcoin Core code. - -It also properly relays newly mined blocks, maintains a transaction pool, and -relays individual transactions that have not yet made it into a block. It -ensures all individual transactions admitted to the pool follow the rules -required by the block chain and also includes more strict checks which filter -transactions based on miner requirements ("standard" transactions). - -One key difference between btcd and Bitcoin Core is that btcd does *NOT* include -wallet functionality and this was a very intentional design decision. See the -blog entry [here](https://web.archive.org/web/20171125143919/https://blog.conformal.com/btcd-not-your-moms-bitcoin-daemon) -for more details. This means you can't actually make or receive payments -directly with btcd. That functionality is provided by the -[btcwallet](https://github.com/btcsuite/btcwallet) and -[Paymetheus](https://github.com/btcsuite/Paymetheus) (Windows-only) projects -which are both under active development. - -## Documentation - -Documentation is a work-in-progress. It is available at [btcd.readthedocs.io](https://btcd.readthedocs.io). ## Contents -* [Installation](installation.md) -* [Update](update.md) * [Configuration](configuration.md) * [Configuring TOR](configuring_tor.md) -* [Docker](using_docker.md) * [Controlling](controlling.md) * [Mining](mining.md) -* [Wallet](wallet.md) -* [Developer resources](developer_resources.md) * [JSON RPC API](json_rpc_api.md) -* [Code contribution guidelines](code_contribution_guidelines.md) -* [Contact](contact.md) - -## License - -btcd is licensed under the [copyfree](http://copyfree.org) ISC License. - diff --git a/docs/installation.md b/docs/installation.md deleted file mode 100644 index a74db560..00000000 --- a/docs/installation.md +++ /dev/null @@ -1,76 +0,0 @@ -# Installation - -The first step is to install btcd. See one of the following sections for -details on how to install on the supported operating systems. - -## Requirements - -[Go](http://golang.org) 1.16 or newer. - -## GPG Verification Key - -All official release tags are signed by Conformal so users can ensure the code -has not been tampered with and is coming from the btcsuite developers. To -verify the signature perform the following: - -* Download the Conformal public key: - https://raw.githubusercontent.com/btcsuite/btcd/master/release/GIT-GPG-KEY-conformal.txt - -* Import the public key into your GPG keyring: - - ```bash - gpg --import GIT-GPG-KEY-conformal.txt - ``` - -* Verify the release tag with the following command where `TAG_NAME` is a - placeholder for the specific tag: - - ```bash - git tag -v TAG_NAME - ``` - -## Windows Installation - -* Install the MSI available at: [btcd windows installer](https://github.com/btcsuite/btcd/releases) -* Launch btcd from the Start Menu - -## Linux/BSD/MacOSX/POSIX Installation - -* Install Go according to the [installation instructions](http://golang.org/doc/install) -* Ensure Go was installed properly and is a supported version: - -```bash -go version -go env GOROOT GOPATH -``` - -NOTE: The `GOROOT` and `GOPATH` above must not be the same path. It is -recommended that `GOPATH` is set to a directory in your home directory such as -`~/goprojects` to avoid write permission issues. It is also recommended to add -`$GOPATH/bin` to your `PATH` at this point. - -* Run the following commands to obtain btcd, all dependencies, and install it: - -```bash -git clone https://github.com/btcsuite/btcd $GOPATH/src/github.com/btcsuite/btcd -cd $GOPATH/src/github.com/btcsuite/btcd -GO111MODULE=on go install -v . ./cmd/... -``` - -* btcd (and utilities) will now be installed in ```$GOPATH/bin```. If you did - not already add the bin directory to your system path during Go installation, - we recommend you do so now. - -## Gentoo Linux Installation - -* [Install Layman](https://gitlab.com/bitcoin/gentoo) and enable the Bitcoin overlay. -* Copy or symlink `/var/lib/layman/bitcoin/Documentation/package.keywords/btcd-live` to `/etc/portage/package.keywords/` -* Install btcd: `$ emerge net-p2p/btcd` - -## Startup - -Typically btcd will run and start downloading the block chain with no extra -configuration necessary, however, there is an optional method to use a -`bootstrap.dat` file that may speed up the initial block chain download process. - -* [Using bootstrap.dat](https://github.com/btcsuite/btcd/blob/master/docs/configuration.md#using-bootstrapdat) diff --git a/docs/json_rpc_api.md b/docs/json_rpc_api.md index db292d2b..17ccba64 100644 --- a/docs/json_rpc_api.md +++ b/docs/json_rpc_api.md @@ -27,27 +27,19 @@ ### 1. Overview -btcd provides a [JSON-RPC](http://json-rpc.org/wiki/specification) API that is +lbcd provides a [JSON-RPC](http://json-rpc.org/wiki/specification) API that is fully compatible with the original bitcoind/bitcoin-qt. There are a few key -differences between btcd and bitcoind as far as how RPCs are serviced: -* Unlike bitcoind that has the wallet and chain intermingled in the same process - which leads to several issues, btcd intentionally splits the wallet and chain - services into independent processes. See the blog post - [here](https://blog.conformal.com/btcd-not-your-moms-bitcoin-daemon/) for - further details on why they were separated. This means that if you are - talking directly to btcd, only chain-related RPCs are available. However both - chain-related and wallet-related RPCs are available via - [btcwallet](https://github.com/btcsuite/btcwallet). -* btcd is secure by default which means that the RPC connection is TLS-enabled +differences between lbcd and bitcoind as far as how RPCs are serviced: +* lbcd is secure by default which means that the RPC connection is TLS-enabled by default -* btcd provides access to the API through both +* lbcd provides access to the API through both [HTTP POST](http://en.wikipedia.org/wiki/POST_%28HTTP%29) requests and [Websockets](http://en.wikipedia.org/wiki/WebSocket) -Websockets are the preferred transport for btcd RPC and are used by applications +Websockets are the preferred transport for lbcd RPC and are used by applications such as [btcwallet](https://github.com/btcsuite/btcwallet) for inter-process -communication with btcd. The websocket connection endpoint for btcd is -`wss://your_ip_or_domain:8334/ws`. +communication with lbcd. The websocket connection endpoint for lbcd is +`wss://your_ip_or_domain:9245/ws`. In addition to the [standard API](#Methods), an [extension API](#WSExtMethods) has been developed that is exclusive to clients using Websockets. In its current @@ -64,7 +56,7 @@ The original bitcoind/bitcoin-qt JSON-RPC API documentation is available at [htt ### 2. HTTP POST Versus Websockets -The btcd RPC server supports both [HTTP POST](http://en.wikipedia.org/wiki/POST_%28HTTP%29) +The lbcd RPC server supports both [HTTP POST](http://en.wikipedia.org/wiki/POST_%28HTTP%29) requests and the preferred [Websockets](http://en.wikipedia.org/wiki/WebSocket). All of the [standard](#Methods) and [extension](#ExtensionMethods) methods described in this documentation can be accessed through both. As the name @@ -72,16 +64,16 @@ indicates, the [Websocket-specific extension](#WSExtMethods) methods can only be accessed when connected via Websockets. As mentioned in the [overview](#Overview), the websocket connection endpoint for -btcd is `wss://your_ip_or_domain:8334/ws`. +lbcd is `wss://your_ip_or_domain:9245/ws`. The most important differences between the two transports as it pertains to the JSON-RPC API are: -| |HTTP POST Requests|Websockets| -|---|------------------|----------| -|Allows multiple requests across a single connection|No|Yes| -|Supports asynchronous notifications|No|Yes| -|Scales well with large numbers of requests|No|Yes| +| | HTTP POST Requests | Websockets | +| --------------------------------------------------- | ------------------ | ---------- | +| Allows multiple requests across a single connection | No | Yes | +| Supports asynchronous notifications | No | Yes | +| Scales well with large numbers of requests | No | Yes | @@ -92,18 +84,18 @@ JSON-RPC API are: **3.1 Authentication Overview**
The following authentication details are needed before establishing a connection -to a btcd RPC server: +to a lbcd RPC server: -* **rpcuser** is the full-access username configured for the btcd RPC server -* **rpcpass** is the full-access password configured for the btcd RPC server -* **rpclimituser** is the limited username configured for the btcd RPC server -* **rpclimitpass** is the limited password configured for the btcd RPC server -* **rpccert** is the PEM-encoded X.509 certificate (public key) that the btcd - server is configured with. It is automatically generated by btcd and placed - in the btcd home directory (which is typically `%LOCALAPPDATA%\Btcd` on - Windows and `~/.btcd` on POSIX-like OSes) +* **rpcuser** is the full-access username configured for the lbcd RPC server +* **rpcpass** is the full-access password configured for the lbcd RPC server +* **rpclimituser** is the limited username configured for the lbcd RPC server +* **rpclimitpass** is the limited password configured for the lbcd RPC server +* **rpccert** is the PEM-encoded X.509 certificate (public key) that the lbcd + server is configured with. It is automatically generated by lbcd and placed + in the lbcd home directory (which is typically `%LOCALAPPDATA%\lbcd` on + Windows and `~/.lbcd` on POSIX-like OSes) -**NOTE:** As mentioned above, btcd is secure by default which means the RPC +**NOTE:** As mentioned above, lbcd is secure by default which means the RPC server is not running unless configured with a **rpcuser** and **rpcpass** and/or a **rpclimituser** and **rpclimitpass**, and uses TLS authentication for all connections. @@ -117,7 +109,7 @@ two, mutually exclusive, methods. **3.2 HTTP Basic Access Authentication**
-The btcd RPC server uses HTTP [basic access authentication](http://en.wikipedia.org/wiki/Basic_access_authentication) with the **rpcuser** +The lbcd RPC server uses HTTP [basic access authentication](http://en.wikipedia.org/wiki/Basic_access_authentication) with the **rpcuser** and **rpcpass** detailed above. If the supplied credentials are invalid, you will be disconnected immediately upon making the connection. @@ -139,8 +131,8 @@ authenticated will cause the websocket to be closed immediately. ### 4. Command-line Utility -btcd comes with a separate utility named `btcctl` which can be used to issue -these RPC commands via HTTP POST requests to btcd after configuring it with the +lbcd comes with a separate utility named `lbcctl` which can be used to issue +these RPC commands via HTTP POST requests to lbcd after configuring it with the information in the [Authentication](#Authentication) section above. It can also be used to communicate with any server/daemon/service which provides a JSON-RPC API compatible with the original bitcoind/bitcoin-qt client. @@ -156,38 +148,38 @@ API compatible with the original bitcoind/bitcoin-qt client. The following is an overview of the RPC methods and their current status. Click the method name for further details such as parameter and return information. -|#|Method|Safe for limited user?|Description| -|---|------|----------|-----------| -|1|[addnode](#addnode)|N|Attempts to add or remove a persistent peer.| -|2|[createrawtransaction](#createrawtransaction)|Y|Returns a new transaction spending the provided inputs and sending to the provided addresses.| -|3|[decoderawtransaction](#decoderawtransaction)|Y|Returns a JSON object representing the provided serialized, hex-encoded transaction.| -|4|[decodescript](#decodescript)|Y|Returns a JSON object with information about the provided hex-encoded script.| -|5|[getaddednodeinfo](#getaddednodeinfo)|N|Returns information about manually added (persistent) peers.| -|6|[getbestblockhash](#getbestblockhash)|Y|Returns the hash of the of the best (most recent) block in the longest block chain.| -|7|[getblock](#getblock)|Y|Returns information about a block given its hash.| -|8|[getblockcount](#getblockcount)|Y|Returns the number of blocks in the longest block chain.| -|9|[getblockhash](#getblockhash)|Y|Returns hash of the block in best block chain at the given height.| -|10|[getblockheader](#getblockheader)|Y|Returns the block header of the block.| -|11|[getconnectioncount](#getconnectioncount)|N|Returns the number of active connections to other peers.| -|12|[getdifficulty](#getdifficulty)|Y|Returns the proof-of-work difficulty as a multiple of the minimum difficulty.| -|13|[getgenerate](#getgenerate)|N|Return if the server is set to generate coins (mine) or not.| -|14|[gethashespersec](#gethashespersec)|N|Returns a recent hashes per second performance measurement while generating coins (mining).| -|15|[getinfo](#getinfo)|Y|Returns a JSON object containing various state info.| -|16|[getmempoolinfo](#getmempoolinfo)|N|Returns a JSON object containing mempool-related information.| -|17|[getmininginfo](#getmininginfo)|N|Returns a JSON object containing mining-related information.| -|18|[getnettotals](#getnettotals)|Y|Returns a JSON object containing network traffic statistics.| -|19|[getnetworkhashps](#getnetworkhashps)|Y|Returns the estimated network hashes per second for the block heights provided by the parameters.| -|20|[getpeerinfo](#getpeerinfo)|N|Returns information about each connected network peer as an array of json objects.| -|21|[getrawmempool](#getrawmempool)|Y|Returns an array of hashes for all of the transactions currently in the memory pool.| -|22|[getrawtransaction](#getrawtransaction)|Y|Returns information about a transaction given its hash.| -|23|[help](#help)|Y|Returns a list of all commands or help for a specified command.| -|24|[ping](#ping)|N|Queues a ping to be sent to each connected peer.| -|25|[sendrawtransaction](#sendrawtransaction)|Y|Submits the serialized, hex-encoded transaction to the local peer and relays it to the network.
btcd does not yet implement the `allowhighfees` parameter, so it has no effect| -|26|[setgenerate](#setgenerate) |N|Set the server to generate coins (mine) or not.
NOTE: Since btcd does not have the wallet integrated to provide payment addresses, btcd must be configured via the `--miningaddr` option to provide which payment addresses to pay created blocks to for this RPC to function.| -|27|[stop](#stop)|N|Shutdown btcd.| -|28|[submitblock](#submitblock)|Y|Attempts to submit a new serialized, hex-encoded block to the network.| -|29|[validateaddress](#validateaddress)|Y|Verifies the given address is valid. NOTE: Since btcd does not have a wallet integrated, btcd will only return whether the address is valid or not.| -|30|[verifychain](#verifychain)|N|Verifies the block chain database.| +| # | Method | Safe for limited user? | Description | +| --- | --------------------------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 1 | [addnode](#addnode) | N | Attempts to add or remove a persistent peer. | +| 2 | [createrawtransaction](#createrawtransaction) | Y | Returns a new transaction spending the provided inputs and sending to the provided addresses. | +| 3 | [decoderawtransaction](#decoderawtransaction) | Y | Returns a JSON object representing the provided serialized, hex-encoded transaction. | +| 4 | [decodescript](#decodescript) | Y | Returns a JSON object with information about the provided hex-encoded script. | +| 5 | [getaddednodeinfo](#getaddednodeinfo) | N | Returns information about manually added (persistent) peers. | +| 6 | [getbestblockhash](#getbestblockhash) | Y | Returns the hash of the of the best (most recent) block in the longest block chain. | +| 7 | [getblock](#getblock) | Y | Returns information about a block given its hash. | +| 8 | [getblockcount](#getblockcount) | Y | Returns the number of blocks in the longest block chain. | +| 9 | [getblockhash](#getblockhash) | Y | Returns hash of the block in best block chain at the given height. | +| 10 | [getblockheader](#getblockheader) | Y | Returns the block header of the block. | +| 11 | [getconnectioncount](#getconnectioncount) | N | Returns the number of active connections to other peers. | +| 12 | [getdifficulty](#getdifficulty) | Y | Returns the proof-of-work difficulty as a multiple of the minimum difficulty. | +| 13 | [getgenerate](#getgenerate) | N | Return if the server is set to generate coins (mine) or not. | +| 14 | [gethashespersec](#gethashespersec) | N | Returns a recent hashes per second performance measurement while generating coins (mining). | +| 15 | [getinfo](#getinfo) | Y | Returns a JSON object containing various state info. | +| 16 | [getmempoolinfo](#getmempoolinfo) | N | Returns a JSON object containing mempool-related information. | +| 17 | [getmininginfo](#getmininginfo) | N | Returns a JSON object containing mining-related information. | +| 18 | [getnettotals](#getnettotals) | Y | Returns a JSON object containing network traffic statistics. | +| 19 | [getnetworkhashps](#getnetworkhashps) | Y | Returns the estimated network hashes per second for the block heights provided by the parameters. | +| 20 | [getpeerinfo](#getpeerinfo) | N | Returns information about each connected network peer as an array of json objects. | +| 21 | [getrawmempool](#getrawmempool) | Y | Returns an array of hashes for all of the transactions currently in the memory pool. | +| 22 | [getrawtransaction](#getrawtransaction) | Y | Returns information about a transaction given its hash. | +| 23 | [help](#help) | Y | Returns a list of all commands or help for a specified command. | +| 24 | [ping](#ping) | N | Queues a ping to be sent to each connected peer. | +| 25 | [sendrawtransaction](#sendrawtransaction) | Y | Submits the serialized, hex-encoded transaction to the local peer and relays it to the network.
lbcd does not yet implement the `allowhighfees` parameter, so it has no effect | +| 26 | [setgenerate](#setgenerate) | N | Set the server to generate coins (mine) or not.
NOTE: Since lbcd does not have the wallet integrated to provide payment addresses, lbcd must be configured via the `--miningaddr` option to provide which payment addresses to pay created blocks to for this RPC to function. | +| 27 | [stop](#stop) | N | Shutdown lbcd. | +| 28 | [submitblock](#submitblock) | Y | Attempts to submit a new serialized, hex-encoded block to the network. | +| 29 | [validateaddress](#validateaddress) | Y | Verifies the given address is valid. NOTE: Since lbcd does not have a wallet integrated, lbcd will only return whether the address is valid or not. | +| 30 | [verifychain](#verifychain) | N | Verifies the block chain database. |
@@ -195,370 +187,370 @@ the method name for further details such as parameter and return information. -| | | -|---|---| -|Method|addnode| -|Parameters|1. peer (string, required) - ip address and port of the peer to operate on
2. command (string, required) - `add` to add a persistent peer, `remove` to remove a persistent peer, or `onetry` to try a single connection to a peer| -|Description|Attempts to add or remove a persistent peer.| -|Returns|Nothing| +| | | +| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | addnode | +| Parameters | 1. peer (string, required) - ip address and port of the peer to operate on
2. command (string, required) - `add` to add a persistent peer, `remove` to remove a persistent peer, or `onetry` to try a single connection to a peer | +| Description | Attempts to add or remove a persistent peer. | +| Returns | Nothing | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|createrawtransaction| -|Parameters|1. transaction inputs (JSON array, required) - json array of json objects
`[`
  `{`
    `"txid": "hash", (string, required) the hash of the input transaction`
    `"vout": n (numeric, required) the specific output of the input transaction to redeem`
  `}, ...`
`]`
2. addresses and amounts (JSON object, required) - json object with addresses as keys and amounts as values
`{`
  `"address": n.nnn (numeric, required) the address to send to as the key and the amount in BTC as the value`
  `, ...`
`}`
3. locktime (int64, optional, default=0) - specifies the transaction locktime. If non-zero, the inputs will also have their locktimes activated. | -|Description|Returns a new transaction spending the provided inputs and sending to the provided addresses.
The transaction inputs are not signed in the created transaction.
The `signrawtransaction` RPC command provided by wallet must be used to sign the resulting transaction.| -|Returns|`"transaction" (string) hex-encoded bytes of the serialized transaction`| -|Example Parameters|1. transaction inputs `[{"txid":"e6da89de7a6b8508ce8f371a3d0535b04b5e108cb1a6e9284602d3bfd357c018","vout":1}]`
2. addresses and amounts `{"13cgrTP7wgbZYWrY9BZ22BV6p82QXQT3nY": 0.49213337}`
3. locktime `0`| -|Example Return|`010000000118c057d3bfd3024628e9a6b18c105e4bb035053d1a378fce08856b7ade89dae6010000`
`0000ffffffff0199efee02000000001976a9141cb013db35ecccc156fdfd81d03a11c51998f99388`
`ac00000000`
**Newlines added for display purposes. The actual return does not contain newlines.**| +| | | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | createrawtransaction | +| Parameters | 1. transaction inputs (JSON array, required) - json array of json objects
`[`
  `{`
    `"txid": "hash", (string, required) the hash of the input transaction`
    `"vout": n (numeric, required) the specific output of the input transaction to redeem`
  `}, ...`
`]`
2. addresses and amounts (JSON object, required) - json object with addresses as keys and amounts as values
`{`
  `"address": n.nnn (numeric, required) the address to send to as the key and the amount in BTC as the value`
  `, ...`
`}`
3. locktime (int64, optional, default=0) - specifies the transaction locktime. If non-zero, the inputs will also have their locktimes activated. | +| Description | Returns a new transaction spending the provided inputs and sending to the provided addresses.
The transaction inputs are not signed in the created transaction.
The `signrawtransaction` RPC command provided by wallet must be used to sign the resulting transaction. | +| Returns | `"transaction" (string) hex-encoded bytes of the serialized transaction` | +| Example Parameters | 1. transaction inputs `[{"txid":"e6da89de7a6b8508ce8f371a3d0535b04b5e108cb1a6e9284602d3bfd357c018","vout":1}]`
2. addresses and amounts `{"13cgrTP7wgbZYWrY9BZ22BV6p82QXQT3nY": 0.49213337}`
3. locktime `0` | +| Example Return | `010000000118c057d3bfd3024628e9a6b18c105e4bb035053d1a378fce08856b7ade89dae6010000`
`0000ffffffff0199efee02000000001976a9141cb013db35ecccc156fdfd81d03a11c51998f99388`
`ac00000000`
**Newlines added for display purposes. The actual return does not contain newlines.** | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|decoderawtransaction| -|Parameters|1. data (string, required) - serialized, hex-encoded transaction| -|Description|Returns a JSON object representing the provided serialized, hex-encoded transaction.| -|Returns|`{ (json object)`
  `"txid": "hash", (string) the hash of the transaction`
  `"version": n, (numeric) the transaction version`
  `"locktime": n, (numeric) the transaction lock time`
  `"vin": [ (array of json objects) the transaction inputs as json objects`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "data", (string) the hex-encoded bytes of the signature script`
      `"sequence": n, (numeric) the script sequence number`
    `}`
  For non-coinbase transactions:
    `{ (json object)`
      `"txid": "hash", (string) the hash of the origin transaction`
      `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`
      `"scriptSig": { (json object) the signature script used to redeem the origin transaction`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
      `}`
      `"sequence": n, (numeric) the script sequence number`
    `}, ...`
  `]`
  `"vout": [ (array of json objects) the transaction outputs as json objects`
    `{ (json object)`
      `"value": n, (numeric) the value in BTC`
      `"n": n, (numeric) the index of this transaction output`
      `"scriptPubKey": { (json object) the public key script used to pay coins`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
        `"reqSigs": n, (numeric) the number of required signatures`
        `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`
        `"addresses": [ (json array of string) the bitcoin addresses associated with this output`
          `"bitcoinaddress", (string) the bitcoin address`
          `...`
        `]`
      `}`
    `}, ...`
  `]`
`}`| -|Example Return|`{`
  `"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",`
  `"version": 1,`
  `"locktime": 0,`
  `"vin": [`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6...",`
      `"sequence": 4294967295,`
    `}`
  For non-coinbase transactions:
    `{`
      `"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`
      `"vout": 0,`
      `"scriptSig": {`
        `"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`
        `"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`
      `}`
      `"sequence": 4294967295,`
    `}`
  `]`
  `"vout": [`
    `{`
      `"value": 50,`
      `"n": 0,`
      `"scriptPubKey": {`
        `"asm": "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4ce...",`
        `"hex": "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4...",`
        `"reqSigs": 1,`
        `"type": "pubkey"`
        `"addresses": [`
          `"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",`
        `]`
      `}`
    `}`
  `]`
`}`| +| | | +| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | decoderawtransaction | +| Parameters | 1. data (string, required) - serialized, hex-encoded transaction | +| Description | Returns a JSON object representing the provided serialized, hex-encoded transaction. | +| Returns | `{ (json object)`
  `"txid": "hash", (string) the hash of the transaction`
  `"version": n, (numeric) the transaction version`
  `"locktime": n, (numeric) the transaction lock time`
  `"vin": [ (array of json objects) the transaction inputs as json objects`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "data", (string) the hex-encoded bytes of the signature script`
      `"sequence": n, (numeric) the script sequence number`
    `}`
  For non-coinbase transactions:
    `{ (json object)`
      `"txid": "hash", (string) the hash of the origin transaction`
      `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`
      `"scriptSig": { (json object) the signature script used to redeem the origin transaction`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
      `}`
      `"sequence": n, (numeric) the script sequence number`
    `}, ...`
  `]`
  `"vout": [ (array of json objects) the transaction outputs as json objects`
    `{ (json object)`
      `"value": n, (numeric) the value in BTC`
      `"n": n, (numeric) the index of this transaction output`
      `"scriptPubKey": { (json object) the public key script used to pay coins`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
        `"reqSigs": n, (numeric) the number of required signatures`
        `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`
        `"addresses": [ (json array of string) the bitcoin addresses associated with this output`
          `"bitcoinaddress", (string) the bitcoin address`
          `...`
        `]`
      `}`
    `}, ...`
  `]`
`}` | +| Example Return | `{`
  `"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",`
  `"version": 1,`
  `"locktime": 0,`
  `"vin": [`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6...",`
      `"sequence": 4294967295,`
    `}`
  For non-coinbase transactions:
    `{`
      `"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`
      `"vout": 0,`
      `"scriptSig": {`
        `"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`
        `"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`
      `}`
      `"sequence": 4294967295,`
    `}`
  `]`
  `"vout": [`
    `{`
      `"value": 50,`
      `"n": 0,`
      `"scriptPubKey": {`
        `"asm": "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4ce...",`
        `"hex": "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4...",`
        `"reqSigs": 1,`
        `"type": "pubkey"`
        `"addresses": [`
          `"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",`
        `]`
      `}`
    `}`
  `]`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|decodescript| -|Parameters|1. script (string, required) - hex-encoded script| -|Description|Returns a JSON object with information about the provided hex-encoded script.| -|Returns|`{ (json object)`
  `"asm": "asm", (string) disassembly of the script`
  `"reqSigs": n, (numeric) the number of required signatures`
  `"type": "scripttype", (string) the type of the script (e.g. 'pubkeyhash')`
  `"addresses": [ (json array of string) the bitcoin addresses associated with this script`
    `"bitcoinaddress", (string) the bitcoin address`
    `...`
  `]`
  `"p2sh": "scripthash", (string) the script hash for use in pay-to-script-hash transactions`
`}`| -|Example Return|`{`
  `"asm": "OP_DUP OP_HASH160 b0a4d8a91981106e4ed85165a66748b19f7b7ad4 OP_EQUALVERIFY OP_CHECKSIG",`
  `"reqSigs": 1,`
  `"type": "pubkeyhash",`
  `"addresses": [`
    `"1H71QVBpzuLTNUh5pewaH3UTLTo2vWgcRJ"`
  `]`
  `"p2sh": "359b84ff799f48231990ff0298206f54117b08b6"`
`}`| +| | | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | decodescript | +| Parameters | 1. script (string, required) - hex-encoded script | +| Description | Returns a JSON object with information about the provided hex-encoded script. | +| Returns | `{ (json object)`
  `"asm": "asm", (string) disassembly of the script`
  `"reqSigs": n, (numeric) the number of required signatures`
  `"type": "scripttype", (string) the type of the script (e.g. 'pubkeyhash')`
  `"addresses": [ (json array of string) the bitcoin addresses associated with this script`
    `"bitcoinaddress", (string) the bitcoin address`
    `...`
  `]`
  `"p2sh": "scripthash", (string) the script hash for use in pay-to-script-hash transactions`
`}` | +| Example Return | `{`
  `"asm": "OP_DUP OP_HASH160 b0a4d8a91981106e4ed85165a66748b19f7b7ad4 OP_EQUALVERIFY OP_CHECKSIG",`
  `"reqSigs": 1,`
  `"type": "pubkeyhash",`
  `"addresses": [`
    `"1H71QVBpzuLTNUh5pewaH3UTLTo2vWgcRJ"`
  `]`
  `"p2sh": "359b84ff799f48231990ff0298206f54117b08b6"`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getaddednodeinfo| -|Parameters|1. dns (boolean, required) - specifies whether the returned data is a JSON object including DNS and connection information, or just a list of added peers
2. node (string, optional) - only return information about this specific peer instead of all added peers.| -|Description|Returns information about manually added (persistent) peers.| -|Returns (dns=false)|`["ip:port", ...]`| -|Returns (dns=true)|`[ (json array of objects)`
  `{ (json object)`
    `"addednode": "ip_or_domain", (string) the ip address or domain of the added peer`
    `"connected": true or false, (boolean) whether or not the peer is currently connected`
    `"addresses": [ (json array or objects) DNS lookup and connection information about the peer`
      `{ (json object)`
        `"address": "ip", (string) the ip address for this DNS entry`
        `"connected": "inbound/outbound/false" (string) the connection 'direction' (if connected)`
      `}, ...`
    `]`
  `}, ...`
`]`| -|Example Return (dns=false)|`["192.168.0.10:8333", "mydomain.org:8333"]`| -|Example Return (dns=true)|`[`
  `{`
    `"addednode": "mydomain.org:8333",`
    `"connected": true,`
    `"addresses": [`
      `{`
        `"address": "1.2.3.4",`
        `"connected": "outbound"`
      `},`
      `{`
        `"address": "5.6.7.8",`
        `"connected": "false"`
      `}`
    `]`
  `}`
`]`| +| | | +| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getaddednodeinfo | +| Parameters | 1. dns (boolean, required) - specifies whether the returned data is a JSON object including DNS and connection information, or just a list of added peers
2. node (string, optional) - only return information about this specific peer instead of all added peers. | +| Description | Returns information about manually added (persistent) peers. | +| Returns (dns=false) | `["ip:port", ...]` | +| Returns (dns=true) | `[ (json array of objects)`
  `{ (json object)`
    `"addednode": "ip_or_domain", (string) the ip address or domain of the added peer`
    `"connected": true or false, (boolean) whether or not the peer is currently connected`
    `"addresses": [ (json array or objects) DNS lookup and connection information about the peer`
      `{ (json object)`
        `"address": "ip", (string) the ip address for this DNS entry`
        `"connected": "inbound/outbound/false" (string) the connection 'direction' (if connected)`
      `}, ...`
    `]`
  `}, ...`
`]` | +| Example Return (dns=false) | `["192.168.0.10:9246", "mydomain.org:9246"]` | +| Example Return (dns=true) | `[`
  `{`
    `"addednode": "mydomain.org:9246",`
    `"connected": true,`
    `"addresses": [`
      `{`
        `"address": "1.2.3.4",`
        `"connected": "outbound"`
      `},`
      `{`
        `"address": "5.6.7.8",`
        `"connected": "false"`
      `}`
    `]`
  `}`
`]` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getbestblockhash| -|Parameters|None| -|Description|Returns the hash of the of the best (most recent) block in the longest block chain.| -|Returns|string| -|Example Return|`0000000000000001f356adc6b29ab42b59f913a396e170f80190dba615bd1e60`| +| | | +| -------------- | ----------------------------------------------------------------------------------- | +| Method | getbestblockhash | +| Parameters | None | +| Description | Returns the hash of the of the best (most recent) block in the longest block chain. | +| Returns | string | +| Example Return | `0000000000000001f356adc6b29ab42b59f913a396e170f80190dba615bd1e60` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getblock| -|Parameters|1. block hash (string, required) - the hash of the block
2. verbosity (int, optional, default=1) - Specifies whether the block data should be returned as a hex-encoded string (0), as parsed data with a slice of TXIDs (1), or as parsed data with parsed transaction data (2). -|Description|Returns information about a block given its hash.| -|Returns (verbosity=0)|`"data" (string) hex-encoded bytes of the serialized block`| -|Returns (verbosity=1)|`{ (json object)`
  `"hash": "blockhash", (string) the hash of the block (same as provided)`
  `"confirmations": n, (numeric) the number of confirmations`
  `"strippedsize", n (numeric) the size of the block without witness data`
  `"size": n, (numeric) the size of the block`
  `"weight": n, (numeric) value of the weight metric`
  `"height": n, (numeric) the height of the block in the block chain`
  `"version": n, (numeric) the block version`
  `"merkleroot": "hash", (string) root hash of the merkle tree`
  `"tx": [ (json array of string) the transaction hashes`
    `"transactionhash", (string) hash of the parent transaction`
    `...`
  `]`
  `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`
  `"nonce": n, (numeric) the block nonce`
  `"bits", n, (numeric) the bits which represent the block difficulty`
  `difficulty: n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`
  `"previousblockhash": "hash", (string) the hash of the previous block`
  `"nextblockhash": "hash", (string) the hash of the next block (only if there is one)`
`}`| -|Returns (verbosity=2)|`{ (json object)`
  `"hash": "blockhash", (string) the hash of the block (same as provided)`
  `"confirmations": n, (numeric) the number of confirmations`
  `"strippedsize", n (numeric) the size of the block without witness data`
  `"size": n, (numeric) the size of the block`
  `"weight": n, (numeric) value of the weight metric`
  `"height": n, (numeric) the height of the block in the block chain`
  `"version": n, (numeric) the block version`
  `"merkleroot": "hash", (string) root hash of the merkle tree`
  `"rawtx": [ (array of json objects) the transactions as json objects`
    `(see getrawtransaction json object details)`
  `]`
  `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`
  `"nonce": n, (numeric) the block nonce`
  `"bits", n, (numeric) the bits which represent the block difficulty`
  `difficulty: n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`
  `"previousblockhash": "hash", (string) the hash of the previous block`
  `"nextblockhash": "hash", (string) the hash of the next block`
`}`| -|Example Return (verbosity=0)|`"010000000000000000000000000000000000000000000000000000000000000000000000`
`3ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49`
`ffff001d1dac2b7c01010000000100000000000000000000000000000000000000000000`
`00000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f`
`4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f`
`6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104`
`678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f`
`4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"`
**Newlines added for display purposes. The actual return does not contain newlines.**| -|Example Return (verbosity=1)|`{`
  `"hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",`
  `"confirmations": 277113,`
  `"size": 285,`
  `"height": 0,`
  `"version": 1,`
  `"merkleroot": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",`
  `"tx": [`
    `"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"`
  `],`
  `"time": 1231006505,`
  `"nonce": 2083236893,`
  `"bits": "1d00ffff",`
  `"difficulty": 1,`
  `"previousblockhash": "0000000000000000000000000000000000000000000000000000000000000000",`
  `"nextblockhash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048"`
`}`| +| | | +| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getblock | +| Parameters | 1. block hash (string, required) - the hash of the block
2. verbosity (int, optional, default=1) - Specifies whether the block data should be returned as a hex-encoded string (0), as parsed data with a slice of TXIDs (1), or as parsed data with parsed transaction data (2). | +| Description | Returns information about a block given its hash. | +| Returns (verbosity=0) | `"data" (string) hex-encoded bytes of the serialized block` | +| Returns (verbosity=1) | `{ (json object)`
  `"hash": "blockhash", (string) the hash of the block (same as provided)`
  `"confirmations": n, (numeric) the number of confirmations`
  `"strippedsize", n (numeric) the size of the block without witness data`
  `"size": n, (numeric) the size of the block`
  `"weight": n, (numeric) value of the weight metric`
  `"height": n, (numeric) the height of the block in the block chain`
  `"version": n, (numeric) the block version`
  `"merkleroot": "hash", (string) root hash of the merkle tree`
  `"tx": [ (json array of string) the transaction hashes`
    `"transactionhash", (string) hash of the parent transaction`
    `...`
  `]`
  `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`
  `"nonce": n, (numeric) the block nonce`
  `"bits", n, (numeric) the bits which represent the block difficulty`
  `difficulty: n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`
  `"previousblockhash": "hash", (string) the hash of the previous block`
  `"nextblockhash": "hash", (string) the hash of the next block (only if there is one)`
`}` | +| Returns (verbosity=2) | `{ (json object)`
  `"hash": "blockhash", (string) the hash of the block (same as provided)`
  `"confirmations": n, (numeric) the number of confirmations`
  `"strippedsize", n (numeric) the size of the block without witness data`
  `"size": n, (numeric) the size of the block`
  `"weight": n, (numeric) value of the weight metric`
  `"height": n, (numeric) the height of the block in the block chain`
  `"version": n, (numeric) the block version`
  `"merkleroot": "hash", (string) root hash of the merkle tree`
  `"rawtx": [ (array of json objects) the transactions as json objects`
    `(see getrawtransaction json object details)`
  `]`
  `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`
  `"nonce": n, (numeric) the block nonce`
  `"bits", n, (numeric) the bits which represent the block difficulty`
  `difficulty: n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`
  `"previousblockhash": "hash", (string) the hash of the previous block`
  `"nextblockhash": "hash", (string) the hash of the next block`
`}` | +| Example Return (verbosity=0) | `"010000000000000000000000000000000000000000000000000000000000000000000000`
`3ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49`
`ffff001d1dac2b7c01010000000100000000000000000000000000000000000000000000`
`00000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f`
`4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f`
`6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104`
`678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f`
`4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"`
**Newlines added for display purposes. The actual return does not contain newlines.** | +| Example Return (verbosity=1) | `{`
  `"hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",`
  `"confirmations": 277113,`
  `"size": 285,`
  `"height": 0,`
  `"version": 1,`
  `"merkleroot": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",`
  `"tx": [`
    `"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"`
  `],`
  `"time": 1231006505,`
  `"nonce": 2083236893,`
  `"bits": "1d00ffff",`
  `"difficulty": 1,`
  `"previousblockhash": "0000000000000000000000000000000000000000000000000000000000000000",`
  `"nextblockhash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048"`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getblockcount| -|Parameters|None| -|Description|Returns the number of blocks in the longest block chain.| -|Returns|numeric| -|Example Return|`276820`| +| | | +| -------------- | -------------------------------------------------------- | +| Method | getblockcount | +| Parameters | None | +| Description | Returns the number of blocks in the longest block chain. | +| Returns | numeric | +| Example Return | `276820` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getblockhash| -|Parameters|1. block height (numeric, required)| -|Description|Returns hash of the block in best block chain at the given height.| -|Returns|string| -|Example Return|`000000000000000096579458d1c0f1531fcfc58d57b4fce51eb177d8d10e784d`| +| | | +| -------------- | ------------------------------------------------------------------ | +| Method | getblockhash | +| Parameters | 1. block height (numeric, required) | +| Description | Returns hash of the block in best block chain at the given height. | +| Returns | string | +| Example Return | `000000000000000096579458d1c0f1531fcfc58d57b4fce51eb177d8d10e784d` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getblockheader| -|Parameters|1. block hash (string, required) - the hash of the block
2. verbose (boolean, optional, default=true) - specifies the block header is returned as a JSON object instead of a hex-encoded string| -|Description|Returns hex-encoded bytes of the serialized block header.| -|Returns (verbose=false)|`"data" (string) hex-encoded bytes of the serialized block`| -|Returns (verbose=true)|`{ (json object)`
  `"hash": "blockhash", (string) the hash of the block (same as provided)`
  `"confirmations": n, (numeric) the number of confirmations`
  `"height": n, (numeric) the height of the block in the block chain`
  `"version": n, (numeric) the block version`
  `"merkleroot": "hash", (string) root hash of the merkle tree`
  `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`
  `"nonce": n, (numeric) the block nonce`
  `"bits": n, (numeric) the bits which represent the block difficulty`
  `"difficulty": n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`
  `"previousblockhash": "hash", (string) the hash of the previous block`
  `"nextblockhash": "hash", (string) the hash of the next block (only if there is one)`
`}`| -|Example Return (verbose=false)|`"0200000035ab154183570282ce9afc0b494c9fc6a3cfea05aa8c1add2ecc564900000000`
`38ba3d78e4500a5a7570dbe61960398add4410d278b21cd9708e6d9743f374d544fc0552`
`27f1001c29c1ea3b"`
**Newlines added for display purposes. The actual return does not contain newlines.**| -|Example Return (verbose=true)|`{`
  `"hash": "00000000009e2958c15ff9290d571bf9459e93b19765c6801ddeccadbb160a1e",`
  `"confirmations": 392076,`
  `"height": 100000,`
  `"version": 2,`
  `"merkleroot": "d574f343976d8e70d91cb278d21044dd8a396019e6db70755a0a50e4783dba38",`
  `"time": 1376123972,`
  `"nonce": 1005240617,`
  `"bits": "1c00f127",`
  `"difficulty": 271.75767393,`
  `"previousblockhash": "000000004956cc2edd1a8caa05eacfa3c69f4c490bfc9ace820257834115ab35",`
  `"nextblockhash": "0000000000629d100db387f37d0f37c51118f250fb0946310a8c37316cbc4028"`
`}`| +| | | +| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | getblockheader | +| Parameters | 1. block hash (string, required) - the hash of the block
2. verbose (boolean, optional, default=true) - specifies the block header is returned as a JSON object instead of a hex-encoded string | +| Description | Returns hex-encoded bytes of the serialized block header. | +| Returns (verbose=false) | `"data" (string) hex-encoded bytes of the serialized block` | +| Returns (verbose=true) | `{ (json object)`
  `"hash": "blockhash", (string) the hash of the block (same as provided)`
  `"confirmations": n, (numeric) the number of confirmations`
  `"height": n, (numeric) the height of the block in the block chain`
  `"version": n, (numeric) the block version`
  `"merkleroot": "hash", (string) root hash of the merkle tree`
  `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`
  `"nonce": n, (numeric) the block nonce`
  `"bits": n, (numeric) the bits which represent the block difficulty`
  `"difficulty": n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`
  `"previousblockhash": "hash", (string) the hash of the previous block`
  `"nextblockhash": "hash", (string) the hash of the next block (only if there is one)`
`}` | +| Example Return (verbose=false) | `"0200000035ab154183570282ce9afc0b494c9fc6a3cfea05aa8c1add2ecc564900000000`
`38ba3d78e4500a5a7570dbe61960398add4410d278b21cd9708e6d9743f374d544fc0552`
`27f1001c29c1ea3b"`
**Newlines added for display purposes. The actual return does not contain newlines.** | +| Example Return (verbose=true) | `{`
  `"hash": "00000000009e2958c15ff9290d571bf9459e93b19765c6801ddeccadbb160a1e",`
  `"confirmations": 392076,`
  `"height": 100000,`
  `"version": 2,`
  `"merkleroot": "d574f343976d8e70d91cb278d21044dd8a396019e6db70755a0a50e4783dba38",`
  `"time": 1376123972,`
  `"nonce": 1005240617,`
  `"bits": "1c00f127",`
  `"difficulty": 271.75767393,`
  `"previousblockhash": "000000004956cc2edd1a8caa05eacfa3c69f4c490bfc9ace820257834115ab35",`
  `"nextblockhash": "0000000000629d100db387f37d0f37c51118f250fb0946310a8c37316cbc4028"`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getconnectioncount| -|Parameters|None| -|Description|Returns the number of active connections to other peers| -|Returns|numeric| -|Example Return|`8`| +| | | +| -------------- | ------------------------------------------------------- | +| Method | getconnectioncount | +| Parameters | None | +| Description | Returns the number of active connections to other peers | +| Returns | numeric | +| Example Return | `8` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getdifficulty| -|Parameters|None| -|Description|Returns the proof-of-work difficulty as a multiple of the minimum difficulty.| -|Returns|numeric| -|Example Return|`1180923195.260000`| +| | | +| -------------- | ----------------------------------------------------------------------------- | +| Method | getdifficulty | +| Parameters | None | +| Description | Returns the proof-of-work difficulty as a multiple of the minimum difficulty. | +| Returns | numeric | +| Example Return | `1180923195.260000` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getgenerate| -|Parameters|None| -|Description|Return if the server is set to generate coins (mine) or not.| -|Returns|`false` (boolean)| +| | | +| ----------- | ------------------------------------------------------------ | +| Method | getgenerate | +| Parameters | None | +| Description | Return if the server is set to generate coins (mine) or not. | +| Returns | `false` (boolean) | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|gethashespersec| -|Parameters|None| -|Description|Returns a recent hashes per second performance measurement while generating coins (mining).| -|Returns|`0` (numeric)| +| | | +| ----------- | ------------------------------------------------------------------------------------------- | +| Method | gethashespersec | +| Parameters | None | +| Description | Returns a recent hashes per second performance measurement while generating coins (mining). | +| Returns | `0` (numeric) | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getinfo| -|Parameters|None| -|Description|Returns a JSON object containing various state info.| -|Notes|NOTE: Since btcd does NOT contain wallet functionality, wallet-related fields are not returned. See getinfo in btcwallet for a version which includes that information.| -|Returns|`{ (json object)`
  `"version": n, (numeric) the version of the server`
  `"protocolversion": n, (numeric) the latest supported protocol version`
  `"blocks": n, (numeric) the number of blocks processed`
  `"timeoffset": n, (numeric) the time offset`
  `"connections": n, (numeric) the number of connected peers`
  `"proxy": "host:port", (string) the proxy used by the server`
  `"difficulty": n.nn, (numeric) the current target difficulty`
  `"testnet": true or false, (boolean) whether or not server is using testnet`
  `"relayfee": n.nn, (numeric) the minimum relay fee for non-free transactions in BTC/KB`
`}`| -|Example Return|`{`
  `"version": 70000`
  `"protocolversion": 70001, `
  `"blocks": 298963,`
  `"timeoffset": 0,`
  `"connections": 17,`
  `"proxy": "",`
  `"difficulty": 8000872135.97,`
  `"testnet": false,`
  `"relayfee": 0.00001,`
`}`| +| | | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | getinfo | +| Parameters | None | +| Description | Returns a JSON object containing various state info. | +| Notes | NOTE: Since lbcd does NOT contain wallet functionality, wallet-related fields are not returned. See getinfo in btcwallet for a version which includes that information. | +| Returns | `{ (json object)`
  `"version": n, (numeric) the version of the server`
  `"protocolversion": n, (numeric) the latest supported protocol version`
  `"blocks": n, (numeric) the number of blocks processed`
  `"timeoffset": n, (numeric) the time offset`
  `"connections": n, (numeric) the number of connected peers`
  `"proxy": "host:port", (string) the proxy used by the server`
  `"difficulty": n.nn, (numeric) the current target difficulty`
  `"testnet": true or false, (boolean) whether or not server is using testnet`
  `"relayfee": n.nn, (numeric) the minimum relay fee for non-free transactions in BTC/KB`
`}` | +| Example Return | `{`
  `"version": 70000`
  `"protocolversion": 70001, `
  `"blocks": 298963,`
  `"timeoffset": 0,`
  `"connections": 17,`
  `"proxy": "",`
  `"difficulty": 8000872135.97,`
  `"testnet": false,`
  `"relayfee": 0.00001,`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getmempoolinfo| -|Parameters|None| -|Description|Returns a JSON object containing mempool-related information.| -|Returns|`{ (json object)`
  `"bytes": n, (numeric) size in bytes of the mempool`
  `"size": n, (numeric) number of transactions in the mempool`
`}`| -Example Return|`{`
  `"bytes": 310768,`
  `"size": 157,`
`}`| +| | | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getmempoolinfo | +| Parameters | None | +| Description | Returns a JSON object containing mempool-related information. | +| Returns | `{ (json object)`
  `"bytes": n, (numeric) size in bytes of the mempool`
  `"size": n, (numeric) number of transactions in the mempool`
`}` | +| Example Return | `{`
  `"bytes": 310768,`
  `"size": 157,`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getmininginfo| -|Parameters|None| -|Description|Returns a JSON object containing mining-related information.| -|Returns|`{ (json object)`
  `"blocks": n, (numeric) latest best block`
  `"currentblocksize": n, (numeric) size of the latest best block`
  `"currentblockweight": n, (numeric) weight of the latest best block`
  `"currentblocktx": n, (numeric) number of transactions in the latest best block`
  `"difficulty": n.nn, (numeric) current target difficulty`
  `"errors": "errors", (string) any current errors`
  `"generate": true or false, (boolean) whether or not server is set to generate coins`
  `"genproclimit": n, (numeric) number of processors to use for coin generation (-1 when disabled)`
  `"hashespersec": n, (numeric) recent hashes per second performance measurement while generating coins`
  `"networkhashps": n, (numeric) estimated network hashes per second for the most recent blocks`
  `"pooledtx": n, (numeric) number of transactions in the memory pool`
  `"testnet": true or false, (boolean) whether or not server is using testnet`
`}`| -|Example Return|`{`
  `"blocks": 236526,`
  `"currentblocksize": 185,`
  `"currentblockweight": 740,`
  `"currentblocktx": 1,`
  `"difficulty": 256,`
  `"errors": "",`
  `"generate": false,`
  `"genproclimit": -1,`
  `"hashespersec": 0,`
  `"networkhashps": 33081554756,`
  `"pooledtx": 8,`
  `"testnet": true,`
`}`| +| | | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getmininginfo | +| Parameters | None | +| Description | Returns a JSON object containing mining-related information. | +| Returns | `{ (json object)`
  `"blocks": n, (numeric) latest best block`
  `"currentblocksize": n, (numeric) size of the latest best block`
  `"currentblockweight": n, (numeric) weight of the latest best block`
  `"currentblocktx": n, (numeric) number of transactions in the latest best block`
  `"difficulty": n.nn, (numeric) current target difficulty`
  `"errors": "errors", (string) any current errors`
  `"generate": true or false, (boolean) whether or not server is set to generate coins`
  `"genproclimit": n, (numeric) number of processors to use for coin generation (-1 when disabled)`
  `"hashespersec": n, (numeric) recent hashes per second performance measurement while generating coins`
  `"networkhashps": n, (numeric) estimated network hashes per second for the most recent blocks`
  `"pooledtx": n, (numeric) number of transactions in the memory pool`
  `"testnet": true or false, (boolean) whether or not server is using testnet`
`}` | +| Example Return | `{`
  `"blocks": 236526,`
  `"currentblocksize": 185,`
  `"currentblockweight": 740,`
  `"currentblocktx": 1,`
  `"difficulty": 256,`
  `"errors": "",`
  `"generate": false,`
  `"genproclimit": -1,`
  `"hashespersec": 0,`
  `"networkhashps": 33081554756,`
  `"pooledtx": 8,`
  `"testnet": true,`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getnettotals| -|Parameters|None| -|Description|Returns a JSON object containing network traffic statistics.| -|Returns|`{`
  `"totalbytesrecv": n, (numeric) total bytes received`
  `"totalbytessent": n, (numeric) total bytes sent`
  `"timemillis": n (numeric) number of milliseconds since 1 Jan 1970 GMT`
`}`| -|Example Return|`{`
  `"totalbytesrecv": 1150990,`
  `"totalbytessent": 206739,`
  `"timemillis": 1391626433845`
`}`| +| | | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getnettotals | +| Parameters | None | +| Description | Returns a JSON object containing network traffic statistics. | +| Returns | `{`
  `"totalbytesrecv": n, (numeric) total bytes received`
  `"totalbytessent": n, (numeric) total bytes sent`
  `"timemillis": n (numeric) number of milliseconds since 1 Jan 1970 GMT`
`}` | +| Example Return | `{`
  `"totalbytesrecv": 1150990,`
  `"totalbytessent": 206739,`
  `"timemillis": 1391626433845`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getnetworkhashps| -|Parameters|1. blocks (numeric, optional, default=120) - The number of blocks, or -1 for blocks since last difficulty change
2. height (numeric, optional, default=-1) - Perform estimate ending with this height or -1 for current best chain block height| -|Description|Returns the estimated network hashes per second for the block heights provided by the parameters.| -|Returns|numeric| -|Example Return|`6573971939`| +| | | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getnetworkhashps | +| Parameters | 1. blocks (numeric, optional, default=120) - The number of blocks, or -1 for blocks since last difficulty change
2. height (numeric, optional, default=-1) - Perform estimate ending with this height or -1 for current best chain block height | +| Description | Returns the estimated network hashes per second for the block heights provided by the parameters. | +| Returns | numeric | +| Example Return | `6573971939` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getpeerinfo| -|Parameters|None| -|Description|Returns data about each connected network peer as an array of json objects.| -|Returns|`[`
  `{`
    `"addr": "host:port", (string) the ip address and port of the peer`
    `"services": "00000001", (string) the services supported by the peer`
    `"lastrecv": n, (numeric) time the last message was received in seconds since 1 Jan 1970 GMT`
    `"lastsend": n, (numeric) time the last message was sent in seconds since 1 Jan 1970 GMT`
    `"bytessent": n, (numeric) total bytes sent`
    `"bytesrecv": n, (numeric) total bytes received`
    `"conntime": n, (numeric) time the connection was made in seconds since 1 Jan 1970 GMT`
    `"pingtime": n, (numeric) number of microseconds the last ping took`
    `"pingwait": n, (numeric) number of microseconds a queued ping has been waiting for a response`
    `"version": n, (numeric) the protocol version of the peer`
    `"subver": "useragent", (string) the user agent of the peer`
    `"inbound": true_or_false, (boolean) whether or not the peer is an inbound connection`
    `"startingheight": n, (numeric) the latest block height the peer knew about when the connection was established`
    `"currentheight": n, (numeric) the latest block height the peer is known to have relayed since connected`
    `"syncnode": true_or_false, (boolean) whether or not the peer is the sync peer`
  `}, ...`
`]`| -|Example Return|`[`
  `{`
    `"addr": "178.172.xxx.xxx:8333",`
    `"services": "00000001",`
    `"lastrecv": 1388183523,`
    `"lastsend": 1388185470,`
    `"bytessent": 287592965,`
    `"bytesrecv": 780340,`
    `"conntime": 1388182973,`
    `"pingtime": 405551,`
    `"pingwait": 183023,`
    `"version": 70001,`
    `"subver": "/btcd:0.4.0/",`
    `"inbound": false,`
    `"startingheight": 276921,`
    `"currentheight": 276955,`
    `"syncnode": true,`
  `}`
`]`| +| | | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getpeerinfo | +| Parameters | None | +| Description | Returns data about each connected network peer as an array of json objects. | +| Returns | `[`
  `{`
    `"addr": "host:port", (string) the ip address and port of the peer`
    `"services": "00000001", (string) the services supported by the peer`
    `"lastrecv": n, (numeric) time the last message was received in seconds since 1 Jan 1970 GMT`
    `"lastsend": n, (numeric) time the last message was sent in seconds since 1 Jan 1970 GMT`
    `"bytessent": n, (numeric) total bytes sent`
    `"bytesrecv": n, (numeric) total bytes received`
    `"conntime": n, (numeric) time the connection was made in seconds since 1 Jan 1970 GMT`
    `"pingtime": n, (numeric) number of microseconds the last ping took`
    `"pingwait": n, (numeric) number of microseconds a queued ping has been waiting for a response`
    `"version": n, (numeric) the protocol version of the peer`
    `"subver": "useragent", (string) the user agent of the peer`
    `"inbound": true_or_false, (boolean) whether or not the peer is an inbound connection`
    `"startingheight": n, (numeric) the latest block height the peer knew about when the connection was established`
    `"currentheight": n, (numeric) the latest block height the peer is known to have relayed since connected`
    `"syncnode": true_or_false, (boolean) whether or not the peer is the sync peer`
  `}, ...`
`]` | +| Example Return | `[`
  `{`
    `"addr": "178.172.xxx.xxx:9246",`
    `"services": "00000001",`
    `"lastrecv": 1388183523,`
    `"lastsend": 1388185470,`
    `"bytessent": 287592965,`
    `"bytesrecv": 780340,`
    `"conntime": 1388182973,`
    `"pingtime": 405551,`
    `"pingwait": 183023,`
    `"version": 70001,`
    `"subver": "/lbcd:0.4.0/",`
    `"inbound": false,`
    `"startingheight": 276921,`
    `"currentheight": 276955,`
    `"syncnode": true,`
  `}`
`]` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getrawtransaction| -|Parameters|1. transaction hash (string, required) - the hash of the transaction
2. verbose (int, optional, default=0) - specifies the transaction is returned as a JSON object instead of hex-encoded string| -|Description|Returns information about a transaction given its hash.| -|Returns (verbose=0)|`"data" (string) hex-encoded bytes of the serialized transaction`| -|Returns (verbose=1)|`{ (json object)`
  `"hex": "data", (string) hex-encoded transaction`
  `"txid": "hash", (string) the hash of the transaction`
  `"version": n, (numeric) the transaction version`
  `"locktime": n, (numeric) the transaction lock time`
  `"vin": [ (array of json objects) the transaction inputs as json objects`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "data", (string) the hex-encoded bytes of the signature script`
      `"sequence": n, (numeric) the script sequence number`
    `"txinwitness": “data", (string) the witness stack for the input`
    `}`
  For non-coinbase transactions:
    `{ (json object)`
      `"txid": "hash", (string) the hash of the origin transaction`
      `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`
      `"scriptSig": { (json object) the signature script used to redeem the origin transaction`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
      `}`
      `"sequence": n, (numeric) the script sequence number`
    `"txinwitness": “data", (string) the witness stack for the input`
    `}, ...`
  `]`
  `"vout": [ (array of json objects) the transaction outputs as json objects`
    `{ (json object)`
      `"value": n, (numeric) the value in BTC`
      `"n": n, (numeric) the index of this transaction output`
      `"scriptPubKey": { (json object) the public key script used to pay coins`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
        `"reqSigs": n, (numeric) the number of required signatures`
        `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`
        `"addresses": [ (json array of string) the bitcoin addresses associated with this output`
          `"bitcoinaddress", (string) the bitcoin address`
          `...`
        `]`
      `}`
    `}, ...`
  `]`
`}`| -|Example Return (verbose=0)|`"010000000104be666c7053ef26c6110597dad1c1e81b5e6be53d17a8b9d0b34772054bac60000000`
`008c493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f`
`022100fbce8d84fcf2839127605818ac6c3e7a1531ebc69277c504599289fb1e9058df0141045a33`
`76eeb85e494330b03c1791619d53327441002832f4bd618fd9efa9e644d242d5e1145cb9c2f71965`
`656e276633d4ff1a6db5e7153a0a9042745178ebe0f5ffffffff0280841e00000000001976a91406`
`f1b6703d3f56427bfcfd372f952d50d04b64bd88ac4dd52700000000001976a9146b63f291c295ee`
`abd9aee6be193ab2d019e7ea7088ac00000000`
**Newlines added for display purposes. The actual return does not contain newlines.**| -|Example Return (verbose=1)|`{`
  `"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000f...",`
  `"txid": "90743aad855880e517270550d2a881627d84db5265142fd1e7fb7add38b08be9",`
  `"version": 1,`
  `"locktime": 0,`
  `"vin": [`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "03708203062f503253482f04066d605108f800080100000ea2122f6f7a636f696e4065757374726174756d2f",`
      `"sequence": 0,`
    `}`
  For non-coinbase transactions:
    `{`
      `"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`
      `"vout": 0,`
      `"scriptSig": {`
        `"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`
        `"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`
      `}`
      `"sequence": 4294967295,`
    `}`
  `]`
  `"vout": [`
    `{`
      `"value": 25.1394,`
      `"n": 0,`
      `"scriptPubKey": {`
        `"asm": "OP_DUP OP_HASH160 ea132286328cfc819457b9dec386c4b5c84faa5c OP_EQUALVERIFY OP_CHECKSIG",`
        `"hex": "76a914ea132286328cfc819457b9dec386c4b5c84faa5c88ac",`
        `"reqSigs": 1,`
        `"type": "pubkeyhash"`
        `"addresses": [`
          `"1NLg3QJMsMQGM5KEUaEu5ADDmKQSLHwmyh",`
        `]`
      `}`
    `}`
  `]`
`}`| +| | | +| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getrawtransaction | +| Parameters | 1. transaction hash (string, required) - the hash of the transaction
2. verbose (int, optional, default=0) - specifies the transaction is returned as a JSON object instead of hex-encoded string | +| Description | Returns information about a transaction given its hash. | +| Returns (verbose=0) | `"data" (string) hex-encoded bytes of the serialized transaction` | +| Returns (verbose=1) | `{ (json object)`
  `"hex": "data", (string) hex-encoded transaction`
  `"txid": "hash", (string) the hash of the transaction`
  `"version": n, (numeric) the transaction version`
  `"locktime": n, (numeric) the transaction lock time`
  `"vin": [ (array of json objects) the transaction inputs as json objects`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "data", (string) the hex-encoded bytes of the signature script`
      `"sequence": n, (numeric) the script sequence number`
    `"txinwitness": “data", (string) the witness stack for the input`
    `}`
  For non-coinbase transactions:
    `{ (json object)`
      `"txid": "hash", (string) the hash of the origin transaction`
      `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`
      `"scriptSig": { (json object) the signature script used to redeem the origin transaction`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
      `}`
      `"sequence": n, (numeric) the script sequence number`
    `"txinwitness": “data", (string) the witness stack for the input`
    `}, ...`
  `]`
  `"vout": [ (array of json objects) the transaction outputs as json objects`
    `{ (json object)`
      `"value": n, (numeric) the value in BTC`
      `"n": n, (numeric) the index of this transaction output`
      `"scriptPubKey": { (json object) the public key script used to pay coins`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
        `"reqSigs": n, (numeric) the number of required signatures`
        `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`
        `"addresses": [ (json array of string) the bitcoin addresses associated with this output`
          `"bitcoinaddress", (string) the bitcoin address`
          `...`
        `]`
      `}`
    `}, ...`
  `]`
`}` | +| Example Return (verbose=0) | `"010000000104be666c7053ef26c6110597dad1c1e81b5e6be53d17a8b9d0b34772054bac60000000`
`008c493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f`
`022100fbce8d84fcf2839127605818ac6c3e7a1531ebc69277c504599289fb1e9058df0141045a33`
`76eeb85e494330b03c1791619d53327441002832f4bd618fd9efa9e644d242d5e1145cb9c2f71965`
`656e276633d4ff1a6db5e7153a0a9042745178ebe0f5ffffffff0280841e00000000001976a91406`
`f1b6703d3f56427bfcfd372f952d50d04b64bd88ac4dd52700000000001976a9146b63f291c295ee`
`abd9aee6be193ab2d019e7ea7088ac00000000`
**Newlines added for display purposes. The actual return does not contain newlines.** | +| Example Return (verbose=1) | `{`
  `"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000f...",`
  `"txid": "90743aad855880e517270550d2a881627d84db5265142fd1e7fb7add38b08be9",`
  `"version": 1,`
  `"locktime": 0,`
  `"vin": [`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "03708203062f503253482f04066d605108f800080100000ea2122f6f7a636f696e4065757374726174756d2f",`
      `"sequence": 0,`
    `}`
  For non-coinbase transactions:
    `{`
      `"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`
      `"vout": 0,`
      `"scriptSig": {`
        `"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`
        `"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`
      `}`
      `"sequence": 4294967295,`
    `}`
  `]`
  `"vout": [`
    `{`
      `"value": 25.1394,`
      `"n": 0,`
      `"scriptPubKey": {`
        `"asm": "OP_DUP OP_HASH160 ea132286328cfc819457b9dec386c4b5c84faa5c OP_EQUALVERIFY OP_CHECKSIG",`
        `"hex": "76a914ea132286328cfc819457b9dec386c4b5c84faa5c88ac",`
        `"reqSigs": 1,`
        `"type": "pubkeyhash"`
        `"addresses": [`
          `"1NLg3QJMsMQGM5KEUaEu5ADDmKQSLHwmyh",`
        `]`
      `}`
    `}`
  `]`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|help| -|Parameters|1. command (string, optional) - the command to get help for| -|Description|Returns a list of all commands or help for a specified command.
When no `command` parameter is specified, a list of avaialable commands is returned
When `command` is a valid method, the help text for that method is returned.| -|Returns|string| -|Example Return|getblockcount
Returns a numeric for the number of blocks in the longest block chain.| +| | | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | help | +| Parameters | 1. command (string, optional) - the command to get help for | +| Description | Returns a list of all commands or help for a specified command.
When no `command` parameter is specified, a list of avaialable commands is returned
When `command` is a valid method, the help text for that method is returned. | +| Returns | string | +| Example Return | getblockcount
Returns a numeric for the number of blocks in the longest block chain. | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|ping| -|Parameters|None| -|Description|Queues a ping to be sent to each connected peer.
Ping times are provided by [getpeerinfo](#getpeerinfo) via the `pingtime` and `pingwait` fields.| -|Returns|Nothing| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | ping | +| Parameters | None | +| Description | Queues a ping to be sent to each connected peer.
Ping times are provided by [getpeerinfo](#getpeerinfo) via the `pingtime` and `pingwait` fields. | +| Returns | Nothing | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getrawmempool| -|Parameters|1. verbose (boolean, optional, default=false)| -|Description|Returns an array of hashes for all of the transactions currently in the memory pool.
The `verbose` flag specifies that each transaction is returned as a JSON object.| -|Notes|Since btcd does not perform any mining, the priority related fields `startingpriority` and `currentpriority` that are available when the `verbose` flag is set are always 0.| -|Returns (verbose=false)|`[ (json array of string)`
  `"transactionhash", (string) hash of the transaction`
  `...`
`]`| -|Returns (verbose=true)|`{ (json object)`
  `"transactionhash": { (json object)`
    `"size": n, (numeric) transaction size in bytes`
    `"vsize": n, (numeric) transaction virtual size`
    `"weight": n, (numeric) The transaction's weight (between vsize*4-3 and vsize*4)`
    `"fee" : n, (numeric) transaction fee in bitcoins`
    `"time": n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT`
    `"height": n, (numeric) block height when transaction entered the pool`
    `"startingpriority": n, (numeric) priority when transaction entered the pool`
    `"currentpriority": n, (numeric) current priority`
    `"depends": [ (json array) unconfirmed transactions used as inputs for this transaction`
      `"transactionhash", (string) hash of the parent transaction`
      `...`
    `]`
  `}, ...`
`}`| -|Example Return (verbose=false)|`[`
  `"3480058a397b6ffcc60f7e3345a61370fded1ca6bef4b58156ed17987f20d4e7",`
  `"cbfe7c056a358c3a1dbced5a22b06d74b8650055d5195c1c2469e6b63a41514a"`
`]`| -|Example Return (verbose=true)|`{`
  `"1697a19cede08694278f19584e8dcc87945f40c6b59a942dd8906f133ad3f9cc": {`
    `"size": 226,`
    `"fee" : 0.0001,`
    `"time": 1387992789,`
    `"height": 276836,`
    `"startingpriority": 0,`
    `"currentpriority": 0,`
    `"depends": [`
      `"aa96f672fcc5a1ec6a08a94aa46d6b789799c87bd6542967da25a96b2dee0afb",`
    `]`
`}`| +| | | +| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getrawmempool | +| Parameters | 1. verbose (boolean, optional, default=false) | +| Description | Returns an array of hashes for all of the transactions currently in the memory pool.
The `verbose` flag specifies that each transaction is returned as a JSON object. | +| Notes | Since lbcd does not perform any mining, the priority related fields `startingpriority` and `currentpriority` that are available when the `verbose` flag is set are always 0. | +| Returns (verbose=false) | `[ (json array of string)`
  `"transactionhash", (string) hash of the transaction`
  `...`
`]` | +| Returns (verbose=true) | `{ (json object)`
  `"transactionhash": { (json object)`
    `"size": n, (numeric) transaction size in bytes`
    `"vsize": n, (numeric) transaction virtual size`
    `"weight": n, (numeric) The transaction's weight (between vsize*4-3 and vsize*4)`
    `"fee" : n, (numeric) transaction fee in bitcoins`
    `"time": n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT`
    `"height": n, (numeric) block height when transaction entered the pool`
    `"startingpriority": n, (numeric) priority when transaction entered the pool`
    `"currentpriority": n, (numeric) current priority`
    `"depends": [ (json array) unconfirmed transactions used as inputs for this transaction`
      `"transactionhash", (string) hash of the parent transaction`
      `...`
    `]`
  `}, ...`
`}` | +| Example Return (verbose=false) | `[`
  `"3480058a397b6ffcc60f7e3345a61370fded1ca6bef4b58156ed17987f20d4e7",`
  `"cbfe7c056a358c3a1dbced5a22b06d74b8650055d5195c1c2469e6b63a41514a"`
`]` | +| Example Return (verbose=true) | `{`
  `"1697a19cede08694278f19584e8dcc87945f40c6b59a942dd8906f133ad3f9cc": {`
    `"size": 226,`
    `"fee" : 0.0001,`
    `"time": 1387992789,`
    `"height": 276836,`
    `"startingpriority": 0,`
    `"currentpriority": 0,`
    `"depends": [`
      `"aa96f672fcc5a1ec6a08a94aa46d6b789799c87bd6542967da25a96b2dee0afb",`
    `]`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|setgenerate| -|Parameters|1. generate (boolean, required) - `true` to enable generation, `false` to disable it
2. genproclimit (numeric, optional) - the number of processors (cores) to limit generation to or `-1` for default| -|Description|Set the server to generate coins (mine) or not.| -|Notes|NOTE: Since btcd does not have the wallet integrated to provide payment addresses, btcd must be configured via the `--miningaddr` option to provide which payment addresses to pay created blocks to for this RPC to function.| -|Returns|Nothing| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | setgenerate | +| Parameters | 1. generate (boolean, required) - `true` to enable generation, `false` to disable it
2. genproclimit (numeric, optional) - the number of processors (cores) to limit generation to or `-1` for default | +| Description | Set the server to generate coins (mine) or not. | +| Notes | NOTE: Since lbcd does not have the wallet integrated to provide payment addresses, lbcd must be configured via the `--miningaddr` option to provide which payment addresses to pay created blocks to for this RPC to function. | +| Returns | Nothing | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|sendrawtransaction| -|Parameters|1. signedhex (string, required) serialized, hex-encoded signed transaction
2. allowhighfees (boolean, optional, default=false) whether or not to allow insanely high fees| -|Description|Submits the serialized, hex-encoded transaction to the local peer and relays it to the network.| -|Notes|btcd does not yet implement the `allowhighfees` parameter, so it has no effect| -|Returns|`"hash" (string) the hash of the transaction`| -|Example Return|`"1697a19cede08694278f19584e8dcc87945f40c6b59a942dd8906f133ad3f9cc"`| +| | | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | sendrawtransaction | +| Parameters | 1. signedhex (string, required) serialized, hex-encoded signed transaction
2. allowhighfees (boolean, optional, default=false) whether or not to allow insanely high fees | +| Description | Submits the serialized, hex-encoded transaction to the local peer and relays it to the network. | +| Notes | lbcd does not yet implement the `allowhighfees` parameter, so it has no effect | +| Returns | `"hash" (string) the hash of the transaction` | +| Example Return | `"1697a19cede08694278f19584e8dcc87945f40c6b59a942dd8906f133ad3f9cc"` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|submitblock| -|Parameters|1. data (string, required) serialized, hex-encoded block
2. params (json object, optional, default=nil) this parameter is currently ignored| -|Description|Attempts to submit a new serialized, hex-encoded block to the network.| -|Returns (success)|Success: Nothing
Failure: `"rejected: reason"` (string)| +| | | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | submitblock | +| Parameters | 1. data (string, required) serialized, hex-encoded block
2. params (json object, optional, default=nil) this parameter is currently ignored | +| Description | Attempts to submit a new serialized, hex-encoded block to the network. | +| Returns (success) | Success: Nothing
Failure: `"rejected: reason"` (string) | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|stop| -|Parameters|None| -|Description|Shutdown btcd.| -|Returns|`"btcd stopping."` (string)| +| | | +| ----------- | --------------------------- | +| Method | stop | +| Parameters | None | +| Description | Shutdown lbcd. | +| Returns | `"lbcd stopping."` (string) | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|validateaddress| -|Parameters|1. address (string, required) - bitcoin address| -|Description|Verify an address is valid.| -|Returns|`{ (json object)`
  `"isvalid": true or false, (bool) whether or not the address is valid.`
  `"address": "bitcoinaddress", (string) the bitcoin address validated.`
}| +| | | +| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | validateaddress | +| Parameters | 1. address (string, required) - bitcoin address | +| Description | Verify an address is valid. | +| Returns | `{ (json object)`
  `"isvalid": true or false, (bool) whether or not the address is valid.`
  `"address": "bitcoinaddress", (string) the bitcoin address validated.`
} | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|verifychain| -|Parameters|1. checklevel (numeric, optional, default=3) - how in-depth the verification is (0=least amount of checks, higher levels are clamped to the highest supported level)
2. numblocks (numeric, optional, default=288) - the number of blocks starting from the end of the chain to verify| -|Description|Verifies the block chain database.
The actual checks performed by the `checklevel` parameter is implementation specific. For btcd this is:
`checklevel=0` - Look up each block and ensure it can be loaded from the database.
`checklevel=1` - Perform basic context-free sanity checks on each block.| -|Notes|Btcd currently only supports `checklevel` 0 and 1, but the default is still 3 for compatibility. Per the information in the Parameters section above, higher levels are automatically clamped to the highest supported level, so this means the default is effectively 1 for btcd.| -|Returns|`true` or `false` (boolean)| -|Example Return|`true`| +| | | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | verifychain | +| Parameters | 1. checklevel (numeric, optional, default=3) - how in-depth the verification is (0=least amount of checks, higher levels are clamped to the highest supported level)
2. numblocks (numeric, optional, default=288) - the number of blocks starting from the end of the chain to verify | +| Description | Verifies the block chain database.
The actual checks performed by the `checklevel` parameter is implementation specific. For lbcd this is:
`checklevel=0` - Look up each block and ensure it can be loaded from the database.
`checklevel=1` - Perform basic context-free sanity checks on each block. | +| Notes | lbcd currently only supports `checklevel` 0 and 1, but the default is still 3 for compatibility. Per the information in the Parameters section above, higher levels are automatically clamped to the highest supported level, so this means the default is effectively 1 for lbcd. | +| Returns | `true` or `false` (boolean) | +| Example Return | `true` | [Return to Overview](#MethodOverview)
@@ -570,18 +562,18 @@ Example Return|`{`
  `"bytes": 310768,`
  `"size": **6.1 Method Overview**
-The following is an overview of the RPC methods which are implemented by btcd, but not the original bitcoind client. Click the method name for further details such as parameter and return information. +The following is an overview of the RPC methods which are implemented by lbcd, but not the original bitcoind client. Click the method name for further details such as parameter and return information. -|#|Method|Safe for limited user?|Description| -|---|------|----------|-----------| -|1|[debuglevel](#debuglevel)|N|Dynamically changes the debug logging level.| -|2|[getbestblock](#getbestblock)|Y|Get block height and hash of best block in the main chain.|None| -|3|[getcurrentnet](#getcurrentnet)|Y|Get bitcoin network btcd is running on.|None| -|4|[searchrawtransactions](#searchrawtransactions)|Y|Query for transactions related to a particular address.|None| -|5|[node](#node)|N|Attempts to add or remove a peer. |None| -|6|[generate](#generate)|N|When in simnet or regtest mode, generate a set number of blocks. |None| -|7|[version](#version)|Y|Returns the JSON-RPC API version.| -|8|[getheaders](#getheaders)|Y|Returns block headers starting with the first known block hash from the request.| +| # | Method | Safe for limited user? | Description | +| --- | ----------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------- | +| 1 | [debuglevel](#debuglevel) | N | Dynamically changes the debug logging level. | +| 2 | [getbestblock](#getbestblock) | Y | Get block height and hash of best block in the main chain. | None | +| 3 | [getcurrentnet](#getcurrentnet) | Y | Get bitcoin network lbcd is running on. | None | +| 4 | [searchrawtransactions](#searchrawtransactions) | Y | Query for transactions related to a particular address. | None | +| 5 | [node](#node) | N | Attempts to add or remove a peer. | None | +| 6 | [generate](#generate) | N | When in simnet or regtest mode, generate a set number of blocks. | None | +| 7 | [version](#version) | Y | Returns the JSON-RPC API version. | +| 8 | [getheaders](#getheaders) | Y | Returns block headers starting with the first known block hash from the request. |
@@ -590,102 +582,102 @@ The following is an overview of the RPC methods which are implemented by btcd, b -| | | -|---|---| -|Method|debuglevel| -|Parameters|1. _levelspec_ (string)| -|Description|Dynamically changes the debug logging level.
The levelspec can either a debug level or of the form `=,=,...`
The valid debug levels are `trace`, `debug`, `info`, `warn`, `error`, and `critical`.
The valid subsystems are `AMGR`, `ADXR`, `BCDB`, `BMGR`, `BTCD`, `CHAN`, `DISC`, `PEER`, `RPCS`, `SCRP`, `SRVR`, and `TXMP`.
Additionally, the special keyword `show` can be used to get a list of the available subsystems.| -|Returns|string| -|Example Return|`Done.`| -|Example `show` Return|`Supported subsystems [AMGR ADXR BCDB BMGR BTCD CHAN DISC PEER RPCS SCRP SRVR TXMP]`| +| | | +| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | debuglevel | +| Parameters | 1. _levelspec_ (string) | +| Description | Dynamically changes the debug logging level.
The levelspec can either a debug level or of the form `=,=,...`
The valid debug levels are `trace`, `debug`, `info`, `warn`, `error`, and `critical`.
The valid subsystems are `AMGR`, `ADXR`, `BCDB`, `BMGR`, `lbcd`, `CHAN`, `DISC`, `PEER`, `RPCS`, `SCRP`, `SRVR`, and `TXMP`.
Additionally, the special keyword `show` can be used to get a list of the available subsystems. | +| Returns | string | +| Example Return | `Done.` | +| Example `show` Return | `Supported subsystems [AMGR ADXR BCDB BMGR lbcd CHAN DISC PEER RPCS SCRP SRVR TXMP]` | [Return to Overview](#ExtMethodOverview)
***
-| | | -|---|---| -|Method|getbestblock| -|Parameters|None| -|Description|Get block height and hash of best block in the main chain.| -|Returns|`{ (json object)`
 `"hash": "data", (string) the hex-encoded bytes of the best block hash`
 `"height": n (numeric) the block height of the best block`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | getbestblock | +| Parameters | None | +| Description | Get block height and hash of best block in the main chain. | +| Returns | `{ (json object)`
 `"hash": "data", (string) the hex-encoded bytes of the best block hash`
 `"height": n (numeric) the block height of the best block`
`}` | [Return to Overview](#ExtMethodOverview)
***
-| | | -|---|---| -|Method|getcurrentnet| -|Parameters|None| -|Description|Get bitcoin network btcd is running on.| -|Returns|numeric| -|Example Return|`3652501241` (mainnet)
`118034699` (testnet3)| +| | | +| -------------- | -------------------------------------------------- | +| Method | getcurrentnet | +| Parameters | None | +| Description | Get bitcoin network lbcd is running on. | +| Returns | numeric | +| Example Return | `3652501241` (mainnet)
`118034699` (testnet3) | [Return to Overview](#ExtMethodOverview)
***
-| | | -|---|---| -|Method|searchrawtransactions| -|Parameters|1. address (string, required) - bitcoin address
2. verbose (int, optional, default=true) - specifies the transaction is returned as a JSON object instead of hex-encoded string
3. skip (int, optional, default=0) - the number of leading transactions to leave out of the final response
4. count (int, optional, default=100) - the maximum number of transactions to return
5. vinextra (int, optional, default=0) - Specify that extra data from previous output will be returned in vin
6. reverse (boolean, optional, default=false) - Specifies that the transactions should be returned in reverse chronological order| -|Description|Returns raw data for transactions involving the passed address. Returned transactions are pulled from both the database, and transactions currently in the mempool. Transactions pulled from the mempool will have the `"confirmations"` field set to 0. Usage of this RPC requires the optional `--addrindex` flag to be activated, otherwise all responses will simply return with an error stating the address index has not yet been built up. Similarly, until the address index has caught up with the current best height, all requests will return an error response in order to avoid serving stale data.| -|Returns (verbose=0)|`[ (json array of strings)`
   `"serializedtx", ... hex-encoded bytes of the serialized transaction`
`]` | -|Returns (verbose=1)|`[ (array of json objects)`
   `{ (json object)`
  `"hex": "data", (string) hex-encoded transaction`
  `"txid": "hash", (string) the hash of the transaction`
  `"version": n, (numeric) the transaction version`
  `"locktime": n, (numeric) the transaction lock time`
  `"vin": [ (array of json objects) the transaction inputs as json objects`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "data", (string) the hex-encoded bytes of the signature script`
      `"txinwitness": “data", (string) the witness stack for the input`
    `"sequence": n, (numeric) the script sequence number`
    `}`
  For non-coinbase transactions:
    `{ (json object)`
      `"txid": "hash", (string) the hash of the origin transaction`
      `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`
      `"scriptSig": { (json object) the signature script used to redeem the origin transaction`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
      `}`
      `"prevOut": { (json object) Data from the origin transaction output with index vout.`
        `"addresses": ["value",...], (array of string) previous output addresses`
        `"value": n.nnn, (numeric) previous output value`
      `}`
      `"txinwitness": “data", (string) the witness stack for the input`
    `"sequence": n, (numeric) the script sequence number`
    `}, ...`
  `]`
  `"vout": [ (array of json objects) the transaction outputs as json objects`
    `{ (json object)`
      `"value": n, (numeric) the value in BTC`
      `"n": n, (numeric) the index of this transaction output`
      `"scriptPubKey": { (json object) the public key script used to pay coins`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
        `"reqSigs": n, (numeric) the number of required signatures`
        `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`
        `"addresses": [ (json array of string) the bitcoin addresses associated with this output`
          `"address", (string) the bitcoin address`
          `...`
        `]`
      `}`
    `}, ...`
   `]`
   `"blockhash":"hash" Hash of the block the transaction is part of.`
   `"confirmations":n, Number of numeric confirmations of block.`
   `"time":t, Transaction time in seconds since the epoch.`
   `"blocktime":t, Block time in seconds since the epoch.`
`},...`
`]`| +| | | +| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | searchrawtransactions | +| Parameters | 1. address (string, required) - bitcoin address
2. verbose (int, optional, default=true) - specifies the transaction is returned as a JSON object instead of hex-encoded string
3. skip (int, optional, default=0) - the number of leading transactions to leave out of the final response
4. count (int, optional, default=100) - the maximum number of transactions to return
5. vinextra (int, optional, default=0) - Specify that extra data from previous output will be returned in vin
6. reverse (boolean, optional, default=false) - Specifies that the transactions should be returned in reverse chronological order | +| Description | Returns raw data for transactions involving the passed address. Returned transactions are pulled from both the database, and transactions currently in the mempool. Transactions pulled from the mempool will have the `"confirmations"` field set to 0. Usage of this RPC requires the optional `--addrindex` flag to be activated, otherwise all responses will simply return with an error stating the address index has not yet been built up. Similarly, until the address index has caught up with the current best height, all requests will return an error response in order to avoid serving stale data. | +| Returns (verbose=0) | `[ (json array of strings)`
   `"serializedtx", ... hex-encoded bytes of the serialized transaction`
`]` | +| Returns (verbose=1) | `[ (array of json objects)`
   `{ (json object)`
  `"hex": "data", (string) hex-encoded transaction`
  `"txid": "hash", (string) the hash of the transaction`
  `"version": n, (numeric) the transaction version`
  `"locktime": n, (numeric) the transaction lock time`
  `"vin": [ (array of json objects) the transaction inputs as json objects`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "data", (string) the hex-encoded bytes of the signature script`
      `"txinwitness": “data", (string) the witness stack for the input`
    `"sequence": n, (numeric) the script sequence number`
    `}`
  For non-coinbase transactions:
    `{ (json object)`
      `"txid": "hash", (string) the hash of the origin transaction`
      `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`
      `"scriptSig": { (json object) the signature script used to redeem the origin transaction`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
      `}`
      `"prevOut": { (json object) Data from the origin transaction output with index vout.`
        `"addresses": ["value",...], (array of string) previous output addresses`
        `"value": n.nnn, (numeric) previous output value`
      `}`
      `"txinwitness": “data", (string) the witness stack for the input`
    `"sequence": n, (numeric) the script sequence number`
    `}, ...`
  `]`
  `"vout": [ (array of json objects) the transaction outputs as json objects`
    `{ (json object)`
      `"value": n, (numeric) the value in BTC`
      `"n": n, (numeric) the index of this transaction output`
      `"scriptPubKey": { (json object) the public key script used to pay coins`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
        `"reqSigs": n, (numeric) the number of required signatures`
        `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`
        `"addresses": [ (json array of string) the bitcoin addresses associated with this output`
          `"address", (string) the bitcoin address`
          `...`
        `]`
      `}`
    `}, ...`
   `]`
   `"blockhash":"hash" Hash of the block the transaction is part of.`
   `"confirmations":n, Number of numeric confirmations of block.`
   `"time":t, Transaction time in seconds since the epoch.`
   `"blocktime":t, Block time in seconds since the epoch.`
`},...`
`]` | [Return to Overview](#ExtMethodOverview)
***
-| | | -|---|---| -|Method|node| -|Parameters|1. command (string, required) - `connect` to add a peer (defaults to temporary), `remove` to remove a persistent peer, or `disconnect` to remove all matching non-persistent peers
2. peer (string, required) - ip address and port, or ID of the peer to operate on
3. connection type (string, optional) - `perm` indicates the peer should be added as a permanent peer, `temp` indicates a connection should only be attempted once. | -|Description|Attempts to add or remove a peer.| -|Returns|Nothing| +| | | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | node | +| Parameters | 1. command (string, required) - `connect` to add a peer (defaults to temporary), `remove` to remove a persistent peer, or `disconnect` to remove all matching non-persistent peers
2. peer (string, required) - ip address and port, or ID of the peer to operate on
3. connection type (string, optional) - `perm` indicates the peer should be added as a permanent peer, `temp` indicates a connection should only be attempted once. | +| Description | Attempts to add or remove a peer. | +| Returns | Nothing | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|generate| -|Parameters|1. numblocks (int, required) - The number of blocks to generate | -|Description|When in simnet or regtest mode, generates `numblocks` blocks. If blocks arrive from elsewhere, they are built upon but don't count toward the number of blocks to generate. Only generated blocks are returned. This RPC call will exit with an error if the server is already CPU mining, and will prevent the server from CPU mining for another command while it runs. | -|Returns|`[ (json array of strings)`
   `"blockhash", ... hash of the generated block`
`]` | +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | generate | +| Parameters | 1. numblocks (int, required) - The number of blocks to generate | +| Description | When in simnet or regtest mode, generates `numblocks` blocks. If blocks arrive from elsewhere, they are built upon but don't count toward the number of blocks to generate. Only generated blocks are returned. This RPC call will exit with an error if the server is already CPU mining, and will prevent the server from CPU mining for another command while it runs. | +| Returns | `[ (json array of strings)`
   `"blockhash", ... hash of the generated block`
`]` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|version| -|Parameters|None| -|Description|Returns the version of the JSON-RPC API built into this release of btcd.| -|Returns|`{ (json object)`
  `"btcdjsonrpcapi": {`
    `"versionstring": "x.y.z", (string) the version of the JSON-RPC API`
    `"major": x, (numeric) the major version of the JSON-RPC API`
    `"minor": y, (numeric) the minor version of the JSON-RPC API`
    `"patch": z, (numeric) the patch version of the JSON-RPC API`
    `"prerelease": "", (string) prerelease info for the JSON-RPC API`
    `"buildmetadata": "" (string) metadata about the server build`
  `}`
`}`| -|Example Return|`{`
  `"btcdjsonrpcapi": {`
    `"versionstring": "1.0.0",`
    `"major": 1, `
    `"minor": 0,`
    `"patch": 0,`
    `"prerelease": "",`
    `"buildmetadata": ""`
  `}`
`}`| +| | | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | version | +| Parameters | None | +| Description | Returns the version of the JSON-RPC API built into this release of lbcd. | +| Returns | `{ (json object)`
  `"lbcdjsonrpcapi": {`
    `"versionstring": "x.y.z", (string) the version of the JSON-RPC API`
    `"major": x, (numeric) the major version of the JSON-RPC API`
    `"minor": y, (numeric) the minor version of the JSON-RPC API`
    `"patch": z, (numeric) the patch version of the JSON-RPC API`
    `"prerelease": "", (string) prerelease info for the JSON-RPC API`
    `"buildmetadata": "" (string) metadata about the server build`
  `}`
`}` | +| Example Return | `{`
  `"lbcdjsonrpcapi": {`
    `"versionstring": "1.0.0",`
    `"major": 1, `
    `"minor": 0,`
    `"patch": 0,`
    `"prerelease": "",`
    `"buildmetadata": ""`
  `}`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getheaders| -|Parameters|1. Block Locators (JSON array, required)
 `[ (json array of strings)`
  `"blocklocator", (string) the known block hash`
  `...`
 `]`
2. hashstop (string) - last desired block's hash| -|Description|Returns block headers starting with the first known block hash from the request.| -|Returns|`[ (json array of strings)`
  `"blockheader",`
  `...`
`]`| -|Example Return|`[`
  `"0000002099417930b2ae09feda10e38b58c0f6bb44b4d60fa33f0e000000000000000000d53...",`
  `"000000203ba25a173bfd24d09e0c76002a910b685ca297bd09a17b020000000000000000702..."`
`]`| +| | | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getheaders | +| Parameters | 1. Block Locators (JSON array, required)
 `[ (json array of strings)`
  `"blocklocator", (string) the known block hash`
  `...`
 `]`
2. hashstop (string) - last desired block's hash | +| Description | Returns block headers starting with the first known block hash from the request. | +| Returns | `[ (json array of strings)`
  `"blockheader",`
  `...`
`]` | +| Example Return | `[`
  `"0000002099417930b2ae09feda10e38b58c0f6bb44b4d60fa33f0e000000000000000000d53...",`
  `"000000203ba25a173bfd24d09e0c76002a910b685ca297bd09a17b020000000000000000702..."`
`]` | [Return to Overview](#MethodOverview)
*** @@ -701,21 +693,21 @@ The following is an overview of the RPC methods which are implemented by btcd, b The following is an overview of the RPC method requests available exclusively to Websocket clients. All of these RPC methods are available to the limited user. Click the method name for further details such as parameter and return information. -|#|Method|Description|Notifications| -|---|------|-----------|-------------| -|1|[authenticate](#authenticate)|Authenticate the connection against the username and passphrase configured for the RPC server.
NOTE: This is only required if an HTTP Authorization header is not being used.|None| -|2|[notifyblocks](#notifyblocks)|Send notifications when a block is connected or disconnected from the best chain.|[blockconnected](#blockconnected), [blockdisconnected](#blockdisconnected), [filteredblockconnected](#filteredblockconnected), and [filteredblockdisconnected](#filteredblockdisconnected)| -|3|[stopnotifyblocks](#stopnotifyblocks)|Cancel registered notifications for whenever a block is connected or disconnected from the main (best) chain. |None| -|4|[notifyreceived](#notifyreceived)|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send notifications when a txout spends to an address.|[recvtx](#recvtx) and [redeemingtx](#redeemingtx)| -|5|[stopnotifyreceived](#stopnotifyreceived)|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered notifications for when a txout spends to any of the passed addresses.|None| -|6|[notifyspent](#notifyspent)|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send notification when a txout is spent.|[redeemingtx](#redeemingtx)| -|7|[stopnotifyspent](#stopnotifyspent)|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered spending notifications for each passed outpoint.|None| -|8|[rescan](#rescan)|*DEPRECATED, for similar functionality see [rescanblocks](#rescanblocks)*
Rescan block chain for transactions to addresses and spent transaction outpoints.|[recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished) | -|9|[notifynewtransactions](#notifynewtransactions)|Send notifications for all new transactions as they are accepted into the mempool.|[txaccepted](#txaccepted) or [txacceptedverbose](#txacceptedverbose)| -|10|[stopnotifynewtransactions](#stopnotifynewtransactions)|Stop sending either a txaccepted or a txacceptedverbose notification when a new transaction is accepted into the mempool.|None| -|11|[session](#session)|Return details regarding a websocket client's current connection.|None| -|12|[loadtxfilter](#loadtxfilter)|Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and rescanblocks.|[relevanttxaccepted](#relevanttxaccepted)| -|13|[rescanblocks](#rescanblocks)|Rescan blocks for transactions matching the loaded transaction filter.|None| +| # | Method | Description | Notifications | +| --- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| 1 | [authenticate](#authenticate) | Authenticate the connection against the username and passphrase configured for the RPC server.
NOTE: This is only required if an HTTP Authorization header is not being used. | None | +| 2 | [notifyblocks](#notifyblocks) | Send notifications when a block is connected or disconnected from the best chain. | [blockconnected](#blockconnected), [blockdisconnected](#blockdisconnected), [filteredblockconnected](#filteredblockconnected), and [filteredblockdisconnected](#filteredblockdisconnected) | +| 3 | [stopnotifyblocks](#stopnotifyblocks) | Cancel registered notifications for whenever a block is connected or disconnected from the main (best) chain. | None | +| 4 | [notifyreceived](#notifyreceived) | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send notifications when a txout spends to an address. | [recvtx](#recvtx) and [redeemingtx](#redeemingtx) | +| 5 | [stopnotifyreceived](#stopnotifyreceived) | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered notifications for when a txout spends to any of the passed addresses. | None | +| 6 | [notifyspent](#notifyspent) | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send notification when a txout is spent. | [redeemingtx](#redeemingtx) | +| 7 | [stopnotifyspent](#stopnotifyspent) | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered spending notifications for each passed outpoint. | None | +| 8 | [rescan](#rescan) | *DEPRECATED, for similar functionality see [rescanblocks](#rescanblocks)*
Rescan block chain for transactions to addresses and spent transaction outpoints. | [recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished) | +| 9 | [notifynewtransactions](#notifynewtransactions) | Send notifications for all new transactions as they are accepted into the mempool. | [txaccepted](#txaccepted) or [txacceptedverbose](#txacceptedverbose) | +| 10 | [stopnotifynewtransactions](#stopnotifynewtransactions) | Stop sending either a txaccepted or a txacceptedverbose notification when a new transaction is accepted into the mempool. | None | +| 11 | [session](#session) | Return details regarding a websocket client's current connection. | None | +| 12 | [loadtxfilter](#loadtxfilter) | Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and rescanblocks. | [relevanttxaccepted](#relevanttxaccepted) | +| 13 | [rescanblocks](#rescanblocks) | Rescan blocks for transactions matching the loaded transaction filter. | None |
@@ -723,177 +715,177 @@ user. Click the method name for further details such as parameter and return in -| | | -|---|---| -|Method|authenticate| -|Parameters|1. username (string, required)
2. passphrase (string, required)| -|Description|Authenticate the connection against the username and password configured for the RPC server.
Invoking any other method before authenticating with this command will close the connection.
NOTE: This is only required if an HTTP Authorization header is not being used.| -|Returns|Success: Nothing
Failure: Nothing (websocket disconnected)| +| | | +| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | authenticate | +| Parameters | 1. username (string, required)
2. passphrase (string, required) | +| Description | Authenticate the connection against the username and password configured for the RPC server.
Invoking any other method before authenticating with this command will close the connection.
NOTE: This is only required if an HTTP Authorization header is not being used. | +| Returns | Success: Nothing
Failure: Nothing (websocket disconnected) | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|notifyblocks| -|Notifications|[blockconnected](#blockconnected), [blockdisconnected](#blockdisconnected), [filteredblockconnected](#filteredblockconnected), and [filteredblockdisconnected](#filteredblockdisconnected)| -|Parameters|None| -|Description|Request notifications for whenever a block is connected or disconnected from the main (best) chain.
NOTE: If a client subscribes to both block and transaction (recvtx and redeemingtx) notifications, the blockconnected notification will be sent after all transaction notifications have been sent. This allows clients to know when all relevant transactions for a block have been received.| -|Returns|Nothing| +| | | +| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | notifyblocks | +| Notifications | [blockconnected](#blockconnected), [blockdisconnected](#blockdisconnected), [filteredblockconnected](#filteredblockconnected), and [filteredblockdisconnected](#filteredblockdisconnected) | +| Parameters | None | +| Description | Request notifications for whenever a block is connected or disconnected from the main (best) chain.
NOTE: If a client subscribes to both block and transaction (recvtx and redeemingtx) notifications, the blockconnected notification will be sent after all transaction notifications have been sent. This allows clients to know when all relevant transactions for a block have been received. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|stopnotifyblocks| -|Notifications|None| -|Parameters|None| -|Description|Cancel sending notifications for whenever a block is connected or disconnected from the main (best) chain.| -|Returns|Nothing| +| | | +| ------------- | ---------------------------------------------------------------------------------------------------------- | +| Method | stopnotifyblocks | +| Notifications | None | +| Parameters | None | +| Description | Cancel sending notifications for whenever a block is connected or disconnected from the main (best) chain. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|notifyreceived| -|Notifications|[recvtx](#recvtx) and [redeemingtx](#redeemingtx)| -|Parameters|1. Addresses (JSON array, required)
 `[ (json array of strings)`
  `"bitcoinaddress", (string) the bitcoin address`
  `...`
 `]`| -|Description|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send a recvtx notification when a transaction added to mempool or appears in a newly-attached block contains a txout pkScript sending to any of the passed addresses. Matching outpoints are automatically registered for redeemingtx notifications.| -|Returns|Nothing| +| | | +| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | notifyreceived | +| Notifications | [recvtx](#recvtx) and [redeemingtx](#redeemingtx) | +| Parameters | 1. Addresses (JSON array, required)
 `[ (json array of strings)`
  `"bitcoinaddress", (string) the bitcoin address`
  `...`
 `]` | +| Description | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send a recvtx notification when a transaction added to mempool or appears in a newly-attached block contains a txout pkScript sending to any of the passed addresses. Matching outpoints are automatically registered for redeemingtx notifications. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|stopnotifyreceived| -|Notifications|None| -|Parameters|1. Addresses (JSON array, required)
 `[ (json array of strings)`
  `"bitcoinaddress", (string) the bitcoin address`
  `...`
 `]`| -|Description|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered receive notifications for each passed address.| -|Returns|Nothing| +| | | +| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | stopnotifyreceived | +| Notifications | None | +| Parameters | 1. Addresses (JSON array, required)
 `[ (json array of strings)`
  `"bitcoinaddress", (string) the bitcoin address`
  `...`
 `]` | +| Description | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered receive notifications for each passed address. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|notifyspent| -|Notifications|[redeemingtx](#redeemingtx)| -|Parameters|1. Outpoints (JSON array, required)
 `[ (JSON array)`
  `{ (JSON object)`
   `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`
   `"index":n (numeric) the txout index of the outpoint`
  `},`
  `...`
 `]`| -|Description|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send a redeemingtx notification when a transaction spending an outpoint appears in mempool (if relayed to this btcd instance) and when such a transaction first appears in a newly-attached block.| -|Returns|Nothing| +| | | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | notifyspent | +| Notifications | [redeemingtx](#redeemingtx) | +| Parameters | 1. Outpoints (JSON array, required)
 `[ (JSON array)`
  `{ (JSON object)`
   `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`
   `"index":n (numeric) the txout index of the outpoint`
  `},`
  `...`
 `]` | +| Description | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send a redeemingtx notification when a transaction spending an outpoint appears in mempool (if relayed to this lbcd instance) and when such a transaction first appears in a newly-attached block. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|stopnotifyspent| -|Notifications|None| -|Parameters|1. Outpoints (JSON array, required)
 `[ (JSON array)`
  `{ (JSON object)`
   `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`
   `"index":n (numeric) the txout index of the outpoint`
  `},`
  `...`
 `]`| -|Description|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered spending notifications for each passed outpoint.| -|Returns|Nothing| +| | | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | stopnotifyspent | +| Notifications | None | +| Parameters | 1. Outpoints (JSON array, required)
 `[ (JSON array)`
  `{ (JSON object)`
   `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`
   `"index":n (numeric) the txout index of the outpoint`
  `},`
  `...`
 `]` | +| Description | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered spending notifications for each passed outpoint. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|rescan| -|Notifications|[recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished)| -|Parameters|1. BeginBlock (string, required) block hash to begin rescanning from
2. Addresses (JSON array, required)
 `[ (json array of strings)`
  `"bitcoinaddress", (string) the bitcoin address`
  `...`
 `]`
3. Outpoints (JSON array, required)
 `[ (JSON array)`
  `{ (JSON object)`
   `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`
   `"index":n (numeric) the txout index of the outpoint`
  `},`
  `...`
 `]`
4. EndBlock (string, optional) hash of final block to rescan| -|Description|*DEPRECATED, for similar functionality see [rescanblocks](#rescanblocks)*
Rescan block chain for transactions to addresses, starting at block BeginBlock and ending at EndBlock. The current known UTXO set for all passed addresses at height BeginBlock should included in the Outpoints argument. If EndBlock is omitted, the rescan continues through the best block in the main chain. Additionally, if no EndBlock is provided, the client is automatically registered for transaction notifications for all rescanned addresses and the final UTXO set. Rescan results are sent as recvtx and redeemingtx notifications. This call returns once the rescan completes.| -|Returns|Nothing| +| | | +| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | rescan | +| Notifications | [recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished) | +| Parameters | 1. BeginBlock (string, required) block hash to begin rescanning from
2. Addresses (JSON array, required)
 `[ (json array of strings)`
  `"bitcoinaddress", (string) the bitcoin address`
  `...`
 `]`
3. Outpoints (JSON array, required)
 `[ (JSON array)`
  `{ (JSON object)`
   `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`
   `"index":n (numeric) the txout index of the outpoint`
  `},`
  `...`
 `]`
4. EndBlock (string, optional) hash of final block to rescan | +| Description | *DEPRECATED, for similar functionality see [rescanblocks](#rescanblocks)*
Rescan block chain for transactions to addresses, starting at block BeginBlock and ending at EndBlock. The current known UTXO set for all passed addresses at height BeginBlock should included in the Outpoints argument. If EndBlock is omitted, the rescan continues through the best block in the main chain. Additionally, if no EndBlock is provided, the client is automatically registered for transaction notifications for all rescanned addresses and the final UTXO set. Rescan results are sent as recvtx and redeemingtx notifications. This call returns once the rescan completes. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|notifynewtransactions| -|Notifications|[txaccepted](#txaccepted) or [txacceptedverbose](#txacceptedverbose)| -|Parameters|1. verbose (boolean, optional, default=false) - specifies which type of notification to receive. If verbose is true, then the caller receives [txacceptedverbose](#txacceptedverbose), otherwise the caller receives [txaccepted](#txaccepted)| -|Description|Send either a [txaccepted](#txaccepted) or a [txacceptedverbose](#txacceptedverbose) notification when a new transaction is accepted into the mempool.| -|Returns|Nothing| +| | | +| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | notifynewtransactions | +| Notifications | [txaccepted](#txaccepted) or [txacceptedverbose](#txacceptedverbose) | +| Parameters | 1. verbose (boolean, optional, default=false) - specifies which type of notification to receive. If verbose is true, then the caller receives [txacceptedverbose](#txacceptedverbose), otherwise the caller receives [txaccepted](#txaccepted) | +| Description | Send either a [txaccepted](#txaccepted) or a [txacceptedverbose](#txacceptedverbose) notification when a new transaction is accepted into the mempool. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|stopnotifynewtransactions| -|Notifications|None| -|Parameters|None| -|Description|Stop sending either a [txaccepted](#txaccepted) or a [txacceptedverbose](#txacceptedverbose) notification when a new transaction is accepted into the mempool.| -|Returns|Nothing| +| | | +| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | stopnotifynewtransactions | +| Notifications | None | +| Parameters | None | +| Description | Stop sending either a [txaccepted](#txaccepted) or a [txacceptedverbose](#txacceptedverbose) notification when a new transaction is accepted into the mempool. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|session| -|Notifications|None| -|Parameters|None| -|Description|Return a JSON object with details regarding a websocket client's current connection to the RPC server. This currently only includes the session ID, a random unsigned 64-bit integer that is created for each newly connected client. Session IDs may be used to verify that the current connection was not lost and subsequently reestablished.| -|Returns|`{ (json object)`
  `"sessionid": n (numeric) the session ID`
`}`| -|Example Return|`{`
  `"sessionid": 67089679842`
`}`| +| | | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | session | +| Notifications | None | +| Parameters | None | +| Description | Return a JSON object with details regarding a websocket client's current connection to the RPC server. This currently only includes the session ID, a random unsigned 64-bit integer that is created for each newly connected client. Session IDs may be used to verify that the current connection was not lost and subsequently reestablished. | +| Returns | `{ (json object)`
  `"sessionid": n (numeric) the session ID`
`}` | +| Example Return | `{`
  `"sessionid": 67089679842`
`}` | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|loadtxfilter| -|Notifications|[relevanttxaccepted](#relevanttxaccepted)| -|Parameters|1. Reload (boolean, required) - Load a new filter instead of adding data to an existing one
2. Addresses (JSON array, required) - Array of addresses to add to the transaction filter
3. Outpoints (JSON array, required) - Array of outpoints to add to the transaction filter| -|Description|Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and [rescanblocks](#rescanblocks).| -|Returns|Nothing| +| | | +| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | loadtxfilter | +| Notifications | [relevanttxaccepted](#relevanttxaccepted) | +| Parameters | 1. Reload (boolean, required) - Load a new filter instead of adding data to an existing one
2. Addresses (JSON array, required) - Array of addresses to add to the transaction filter
3. Outpoints (JSON array, required) - Array of outpoints to add to the transaction filter | +| Description | Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and [rescanblocks](#rescanblocks). | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|rescanblocks| -|Notifications|None| -|Parameters|1. Blockhashes (JSON array, required) - List of hashes to rescan. Each next block must be a child of the previous.| -|Description|Rescan blocks for transactions matching the loaded transaction filter.| -|Returns|`[ (JSON array)`
  `{ (JSON object)`
    `"hash": "data", (string) Hash of the matching block.`
    `"transactions": [ (JSON array) List of matching transactions, serialized and hex-encoded.`
      `"serializedtx" (string) Serialized and hex-encoded transaction.`
    `]`
  `}`
`]`| -|Example Return|`[`
  `{`
    `"hash": "0000002099417930b2ae09feda10e38b58c0f6bb44b4d60fa33f0e000000000000000000d53...",`
    `"transactions": [`
      `"493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8..."`
    `]`
  `}`
`]`| +| | | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | rescanblocks | +| Notifications | None | +| Parameters | 1. Blockhashes (JSON array, required) - List of hashes to rescan. Each next block must be a child of the previous. | +| Description | Rescan blocks for transactions matching the loaded transaction filter. | +| Returns | `[ (JSON array)`
  `{ (JSON object)`
    `"hash": "data", (string) Hash of the matching block.`
    `"transactions": [ (JSON array) List of matching transactions, serialized and hex-encoded.`
      `"serializedtx" (string) Serialized and hex-encoded transaction.`
    `]`
  `}`
`]` | +| Example Return | `[`
  `{`
    `"hash": "0000002099417930b2ae09feda10e38b58c0f6bb44b4d60fa33f0e000000000000000000d53...",`
    `"transactions": [`
      `"493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8..."`
    `]`
  `}`
`]` |
### 8. Notifications (Websocket-specific) -btcd uses standard JSON-RPC notifications to notify clients of changes, rather than requiring clients to poll btcd for updates. JSON-RPC notifications are a subset of requests, but do not contain an ID. The notification type is categorized by the `method` field and additional details are sent as a JSON array in the `params` field. +lbcd uses standard JSON-RPC notifications to notify clients of changes, rather than requiring clients to poll lbcd for updates. JSON-RPC notifications are a subset of requests, but do not contain an ID. The notification type is categorized by the `method` field and additional details are sent as a JSON array in the `params` field. @@ -901,19 +893,19 @@ btcd uses standard JSON-RPC notifications to notify clients of changes, rather t The following is an overview of the JSON-RPC notifications used for Websocket connections. Click the method name for further details of the context(s) in which they are sent and their parameters. -|#|Method|Description|Request| -|---|------|-----------|-------| -|1|[blockconnected](#blockconnected)|*DEPRECATED, for similar functionality see [filteredblockconnected](#filteredblockconnected)*
Block connected to the main chain.|[notifyblocks](#notifyblocks)| -|2|[blockdisconnected](#blockdisconnected)|*DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*
Block disconnected from the main chain.|[notifyblocks](#notifyblocks)| -|3|[recvtx](#recvtx)|*DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Processed a transaction output spending to a wallet address.|[notifyreceived](#notifyreceived) and [rescan](#rescan)| -|4|[redeemingtx](#redeemingtx)|*DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Processed a transaction that spends a registered outpoint.|[notifyspent](#notifyspent) and [rescan](#rescan)| -|5|[txaccepted](#txaccepted)|Received a new transaction after requesting simple notifications of all new transactions accepted into the mempool.|[notifynewtransactions](#notifynewtransactions)| -|6|[txacceptedverbose](#txacceptedverbose)|Received a new transaction after requesting verbose notifications of all new transactions accepted into the mempool.|[notifynewtransactions](#notifynewtransactions)| -|7|[rescanprogress](#rescanprogress)|*DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
A rescan operation that is underway has made progress.|[rescan](#rescan)| -|8|[rescanfinished](#rescanfinished)|*DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
A rescan operation has completed.|[rescan](#rescan)| -|9|[relevanttxaccepted](#relevanttxaccepted)|A transaction matching the tx filter has been accepted into the mempool.|[loadtxfilter](#loadtxfilter)| -|10|[filteredblockconnected](#filteredblockconnected)|Block connected to the main chain; contains any transactions that match the client's tx filter.|[notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter)| -|11|[filteredblockdisconnected](#filteredblockdisconnected)|Block disconnected from the main chain.|[notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter)| +| # | Method | Description | Request | +| --- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | +| 1 | [blockconnected](#blockconnected) | *DEPRECATED, for similar functionality see [filteredblockconnected](#filteredblockconnected)*
Block connected to the main chain. | [notifyblocks](#notifyblocks) | +| 2 | [blockdisconnected](#blockdisconnected) | *DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*
Block disconnected from the main chain. | [notifyblocks](#notifyblocks) | +| 3 | [recvtx](#recvtx) | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Processed a transaction output spending to a wallet address. | [notifyreceived](#notifyreceived) and [rescan](#rescan) | +| 4 | [redeemingtx](#redeemingtx) | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Processed a transaction that spends a registered outpoint. | [notifyspent](#notifyspent) and [rescan](#rescan) | +| 5 | [txaccepted](#txaccepted) | Received a new transaction after requesting simple notifications of all new transactions accepted into the mempool. | [notifynewtransactions](#notifynewtransactions) | +| 6 | [txacceptedverbose](#txacceptedverbose) | Received a new transaction after requesting verbose notifications of all new transactions accepted into the mempool. | [notifynewtransactions](#notifynewtransactions) | +| 7 | [rescanprogress](#rescanprogress) | *DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
A rescan operation that is underway has made progress. | [rescan](#rescan) | +| 8 | [rescanfinished](#rescanfinished) | *DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
A rescan operation has completed. | [rescan](#rescan) | +| 9 | [relevanttxaccepted](#relevanttxaccepted) | A transaction matching the tx filter has been accepted into the mempool. | [loadtxfilter](#loadtxfilter) | +| 10 | [filteredblockconnected](#filteredblockconnected) | Block connected to the main chain; contains any transactions that match the client's tx filter. | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter) | +| 11 | [filteredblockdisconnected](#filteredblockdisconnected) | Block disconnected from the main chain. | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter) |
@@ -921,142 +913,142 @@ The following is an overview of the JSON-RPC notifications used for Websocket co -| | | -|---|---| -|Method|blockconnected| -|Request|[notifyblocks](#notifyblocks)| -|Parameters|1. BlockHash (string) hex-encoded bytes of the attached block hash
2. BlockHeight (numeric) height of the attached block
3. BlockTime (numeric) unix time of the attached block| -|Description|*DEPRECATED, for similar functionality see [filteredblockconnected](#filteredblockconnected)*
Notifies when a block has been added to the main chain. Notification is sent to all connected clients.| -|Example|Example blockconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "blockconnected",`
 `"params":`
  `[`
   `"000000000000000004cbdfe387f4df44b914e464ca79838a8ab777b3214dbffd",`
   `280330,`
   `1389636265`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | blockconnected | +| Request | [notifyblocks](#notifyblocks) | +| Parameters | 1. BlockHash (string) hex-encoded bytes of the attached block hash
2. BlockHeight (numeric) height of the attached block
3. BlockTime (numeric) unix time of the attached block | +| Description | *DEPRECATED, for similar functionality see [filteredblockconnected](#filteredblockconnected)*
Notifies when a block has been added to the main chain. Notification is sent to all connected clients. | +| Example | Example blockconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "blockconnected",`
 `"params":`
  `[`
   `"000000000000000004cbdfe387f4df44b914e464ca79838a8ab777b3214dbffd",`
   `280330,`
   `1389636265`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|blockdisconnected| -|Request|[notifyblocks](#notifyblocks)| -|Parameters|1. BlockHash (string) hex-encoded bytes of the disconnected block hash
2. BlockHeight (numeric) height of the disconnected block
3. BlockTime (numeric) unix time of the disconnected block| -|Description|*DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*
Notifies when a block has been removed from the main chain. Notification is sent to all connected clients.| -|Example|Example blockdisconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "blockdisconnected",`
 `"params":`
  `[`
   `"000000000000000004cbdfe387f4df44b914e464ca79838a8ab777b3214dbffd",`
   `280330,`
   `1389636265`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | blockdisconnected | +| Request | [notifyblocks](#notifyblocks) | +| Parameters | 1. BlockHash (string) hex-encoded bytes of the disconnected block hash
2. BlockHeight (numeric) height of the disconnected block
3. BlockTime (numeric) unix time of the disconnected block | +| Description | *DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*
Notifies when a block has been removed from the main chain. Notification is sent to all connected clients. | +| Example | Example blockdisconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "blockdisconnected",`
 `"params":`
  `[`
   `"000000000000000004cbdfe387f4df44b914e464ca79838a8ab777b3214dbffd",`
   `280330,`
   `1389636265`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|recvtx| -|Request|[rescan](#rescan) or [notifyreceived](#notifyreceived)| -|Parameters|1. Transaction (string) full transaction encoded as a hex string
2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined| -|Description|*DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Notifies a client when a transaction is processed that contains at least a single output with a pkScript sending to a requested address. If multiple outputs send to requested addresses, a single notification is sent. If a mempool (unmined) transaction is processed, the block details object (second parameter) is excluded.| -|Example|Example recvtx notification for mainnet transaction 61d3696de4c888730cbe06b0ad8ecb6d72d6108e893895aa9bc067bd7eba3fad when processed by mempool (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "recvtx",`
 `"params":`
  `[`
   `"010000000114d9ff358894c486b4ae11c2a8cf7851b1df64c53d2e511278eff17c22fb737300000000..."`
  `],`
 `"id": null`
`}`
The recvtx notification for the same txout, after the transaction was mined into block 276425:
`{`
 `"jsonrpc": "1.0",`
 `"method": "recvtx",`
 `"params":`
  `[`
   `"010000000114d9ff358894c486b4ae11c2a8cf7851b1df64c53d2e511278eff17c22fb737300000000...",`
   `{`
    `"height": 276425,`
    `"hash": "000000000000000325474bb799b9e591f965ca4461b72cb7012b808db92bb2fc",`
    `"index": 684,`
    `"time": 1387737310`
   `}`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | recvtx | +| Request | [rescan](#rescan) or [notifyreceived](#notifyreceived) | +| Parameters | 1. Transaction (string) full transaction encoded as a hex string
2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined | +| Description | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Notifies a client when a transaction is processed that contains at least a single output with a pkScript sending to a requested address. If multiple outputs send to requested addresses, a single notification is sent. If a mempool (unmined) transaction is processed, the block details object (second parameter) is excluded. | +| Example | Example recvtx notification for mainnet transaction 61d3696de4c888730cbe06b0ad8ecb6d72d6108e893895aa9bc067bd7eba3fad when processed by mempool (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "recvtx",`
 `"params":`
  `[`
   `"010000000114d9ff358894c486b4ae11c2a8cf7851b1df64c53d2e511278eff17c22fb737300000000..."`
  `],`
 `"id": null`
`}`
The recvtx notification for the same txout, after the transaction was mined into block 276425:
`{`
 `"jsonrpc": "1.0",`
 `"method": "recvtx",`
 `"params":`
  `[`
   `"010000000114d9ff358894c486b4ae11c2a8cf7851b1df64c53d2e511278eff17c22fb737300000000...",`
   `{`
    `"height": 276425,`
    `"hash": "000000000000000325474bb799b9e591f965ca4461b72cb7012b808db92bb2fc",`
    `"index": 684,`
    `"time": 1387737310`
   `}`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|redeemingtx| -|Requests|[notifyspent](#notifyspent) and [rescan](#rescan)| -|Parameters|1. Transaction (string) full transaction encoded as a hex string
2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined| -|Description|*DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Notifies a client when an registered outpoint is spent by a transaction accepted to mempool and/or mined into a block.| -|Example|Example redeemingtx notification for mainnet outpoint 61d3696de4c888730cbe06b0ad8ecb6d72d6108e893895aa9bc067bd7eba3fad:0 after being spent by transaction 4ad0c16ac973ff675dec1f3e5f1273f1c45be2a63554343f21b70240a1e43ece (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "redeemingtx",`
 `"params":`
  `[`
   `"0100000003ad3fba7ebd67c09baa9538898e10d6726dcb8eadb006be0c7388c8e46d69d3610000000..."`
  `],`
 `"id": null`
`}`
The redeemingtx notification for the same txout, after the spending transaction was mined into block 279143:
`{`
 `"jsonrpc": "1.0",`
 `"method": "recvtx",`
 `"params":`
  `[`
   `"0100000003ad3fba7ebd67c09baa9538898e10d6726dcb8eadb006be0c7388c8e46d69d3610000000...",`
   `{`
    `"height": 279143,`
    `"hash": "00000000000000017188b968a371bab95aa43522665353b646e41865abae02a4",`
    `"index": 6,`
    `"time": 1389115004`
   `}`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | redeemingtx | +| Requests | [notifyspent](#notifyspent) and [rescan](#rescan) | +| Parameters | 1. Transaction (string) full transaction encoded as a hex string
2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined | +| Description | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Notifies a client when an registered outpoint is spent by a transaction accepted to mempool and/or mined into a block. | +| Example | Example redeemingtx notification for mainnet outpoint 61d3696de4c888730cbe06b0ad8ecb6d72d6108e893895aa9bc067bd7eba3fad:0 after being spent by transaction 4ad0c16ac973ff675dec1f3e5f1273f1c45be2a63554343f21b70240a1e43ece (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "redeemingtx",`
 `"params":`
  `[`
   `"0100000003ad3fba7ebd67c09baa9538898e10d6726dcb8eadb006be0c7388c8e46d69d3610000000..."`
  `],`
 `"id": null`
`}`
The redeemingtx notification for the same txout, after the spending transaction was mined into block 279143:
`{`
 `"jsonrpc": "1.0",`
 `"method": "recvtx",`
 `"params":`
  `[`
   `"0100000003ad3fba7ebd67c09baa9538898e10d6726dcb8eadb006be0c7388c8e46d69d3610000000...",`
   `{`
    `"height": 279143,`
    `"hash": "00000000000000017188b968a371bab95aa43522665353b646e41865abae02a4",`
    `"index": 6,`
    `"time": 1389115004`
   `}`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|txaccepted| -|Request|[notifynewtransactions](#notifynewtransactions)| -|Parameters|1. TxHash (string) hex-encoded bytes of the transaction hash
2. Amount (numeric) sum of the value of all the transaction outpoints| -|Description|Notifies when a new transaction has been accepted and the client has requested standard transaction details.| -|Example|Example txaccepted notification for mainnet transaction id "16c54c9d02fe570b9d41b518c0daefae81cc05c69bbe842058e84c6ed5826261" (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "txaccepted",`
 `"params":`
  `[`
   `"16c54c9d02fe570b9d41b518c0daefae81cc05c69bbe842058e84c6ed5826261",`
   `55838384`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | txaccepted | +| Request | [notifynewtransactions](#notifynewtransactions) | +| Parameters | 1. TxHash (string) hex-encoded bytes of the transaction hash
2. Amount (numeric) sum of the value of all the transaction outpoints | +| Description | Notifies when a new transaction has been accepted and the client has requested standard transaction details. | +| Example | Example txaccepted notification for mainnet transaction id "16c54c9d02fe570b9d41b518c0daefae81cc05c69bbe842058e84c6ed5826261" (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "txaccepted",`
 `"params":`
  `[`
   `"16c54c9d02fe570b9d41b518c0daefae81cc05c69bbe842058e84c6ed5826261",`
   `55838384`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|txacceptedverbose| -|Request|[notifynewtransactions](#notifynewtransactions)| -|Parameters|1. RawTx (json object) the transaction as a json object (see getrawtransaction json object details)| -|Description|Notifies when a new transaction has been accepted and the client has requested verbose transaction details.| -|Example|Example txacceptedverbose notification (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "txacceptedverbose",`
 `"params":`
  `[`
   `{`
    `"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000f...",`
    `"txid": "90743aad855880e517270550d2a881627d84db5265142fd1e7fb7add38b08be9",`
    `"version": 1,`
    `"locktime": 0,`
    `"vin": [`
    For coinbase transactions:
      `{ (json object)`
        `"coinbase": "03708203062f503253482f04066d605108f800080100000ea2122f6f7a636f696e4065757374726174756d2f",`
        `"sequence": 0,`
      `}`
    For non-coinbase transactions:
      `{`
        `"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`
        `"vout": 0,`
        `"scriptSig": {`
          `"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`
          `"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`
        `}`
        `"sequence": 4294967295,`
      `}`
    `],`
    `"vout": [`
     `{`
      `"value": 25.1394,`
      `"n": 0,`
      `"scriptPubKey": {`
       `"asm": "OP_DUP OP_HASH160 ea132286328cfc819457b9dec386c4b5c84faa5c OP_EQUALVERIFY OP_CHECKSIG",`
       `"hex": "76a914ea132286328cfc819457b9dec386c4b5c84faa5c88ac",`
       `"reqSigs": 1,`
       `"type": "pubkeyhash"`
       `"addresses": [`
        `"1NLg3QJMsMQGM5KEUaEu5ADDmKQSLHwmyh",`
       `]`
     `}`
    `]`
   `}`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | txacceptedverbose | +| Request | [notifynewtransactions](#notifynewtransactions) | +| Parameters | 1. RawTx (json object) the transaction as a json object (see getrawtransaction json object details) | +| Description | Notifies when a new transaction has been accepted and the client has requested verbose transaction details. | +| Example | Example txacceptedverbose notification (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "txacceptedverbose",`
 `"params":`
  `[`
   `{`
    `"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000f...",`
    `"txid": "90743aad855880e517270550d2a881627d84db5265142fd1e7fb7add38b08be9",`
    `"version": 1,`
    `"locktime": 0,`
    `"vin": [`
    For coinbase transactions:
      `{ (json object)`
        `"coinbase": "03708203062f503253482f04066d605108f800080100000ea2122f6f7a636f696e4065757374726174756d2f",`
        `"sequence": 0,`
      `}`
    For non-coinbase transactions:
      `{`
        `"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`
        `"vout": 0,`
        `"scriptSig": {`
          `"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`
          `"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`
        `}`
        `"sequence": 4294967295,`
      `}`
    `],`
    `"vout": [`
     `{`
      `"value": 25.1394,`
      `"n": 0,`
      `"scriptPubKey": {`
       `"asm": "OP_DUP OP_HASH160 ea132286328cfc819457b9dec386c4b5c84faa5c OP_EQUALVERIFY OP_CHECKSIG",`
       `"hex": "76a914ea132286328cfc819457b9dec386c4b5c84faa5c88ac",`
       `"reqSigs": 1,`
       `"type": "pubkeyhash"`
       `"addresses": [`
        `"1NLg3QJMsMQGM5KEUaEu5ADDmKQSLHwmyh",`
       `]`
     `}`
    `]`
   `}`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|rescanprogress| -|Request|[rescan](#rescan)| -|Parameters|1. Hash (string) hash of the last processed block
2. Height (numeric) height of the last processed block
3. Time (numeric) UNIX time of the last processed block| -|Description|*DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
Notifies a client with the current progress at periodic intervals when a long-running [rescan](#rescan) is underway.| -|Example|`{`
 `"jsonrpc": "1.0",`
 `"method": "rescanprogress",`
 `"params":`
  `[`
   `"0000000000000ea86b49e11843b2ad937ac89ae74a963c7edd36e0147079b89d",`
   `127213,`
   `1306533807`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | rescanprogress | +| Request | [rescan](#rescan) | +| Parameters | 1. Hash (string) hash of the last processed block
2. Height (numeric) height of the last processed block
3. Time (numeric) UNIX time of the last processed block | +| Description | *DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
Notifies a client with the current progress at periodic intervals when a long-running [rescan](#rescan) is underway. | +| Example | `{`
 `"jsonrpc": "1.0",`
 `"method": "rescanprogress",`
 `"params":`
  `[`
   `"0000000000000ea86b49e11843b2ad937ac89ae74a963c7edd36e0147079b89d",`
   `127213,`
   `1306533807`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|rescanfinished| -|Request|[rescan](#rescan)| -|Parameters|1. Hash (string) hash of the last rescanned block
2. Height (numeric) height of the last rescanned block
3. Time (numeric) UNIX time of the last rescanned block | -|Description|*DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
Notifies a client that the [rescan](#rescan) has completed and no further notifications will be sent.| -|Example|`{`
 `"jsonrpc": "1.0",`
 `"method": "rescanfinished",`
 `"params":`
  `[`
   `"0000000000000ea86b49e11843b2ad937ac89ae74a963c7edd36e0147079b89d",`
   `127213,`
   `1306533807`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | rescanfinished | +| Request | [rescan](#rescan) | +| Parameters | 1. Hash (string) hash of the last rescanned block
2. Height (numeric) height of the last rescanned block
3. Time (numeric) UNIX time of the last rescanned block | +| Description | *DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
Notifies a client that the [rescan](#rescan) has completed and no further notifications will be sent. | +| Example | `{`
 `"jsonrpc": "1.0",`
 `"method": "rescanfinished",`
 `"params":`
  `[`
   `"0000000000000ea86b49e11843b2ad937ac89ae74a963c7edd36e0147079b89d",`
   `127213,`
   `1306533807`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|relevanttxaccepted| -|Request|[loadtxfilter](#loadtxfilter)| -|Parameters|1. Transaction (string) hex-encoded serialized transaction matching the client's filter loaded ith [loadtxfilter](#loadtxfilter)| -|Description|Notifies a client that a transaction matching the client's tx filter has been accepted into he mempool.| -|Example|Example `relevanttxaccepted` notification (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "relevanttxaccepted",`
 `"params": [`
  `"01000000014221abdcca25c8a3b0c044034875dece048c77d567a806f0c2e7e0f5e25a8f100..."`
 `],`
 `"id": null`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | relevanttxaccepted | +| Request | [loadtxfilter](#loadtxfilter) | +| Parameters | 1. Transaction (string) hex-encoded serialized transaction matching the client's filter loaded ith [loadtxfilter](#loadtxfilter) | +| Description | Notifies a client that a transaction matching the client's tx filter has been accepted into he mempool. | +| Example | Example `relevanttxaccepted` notification (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "relevanttxaccepted",`
 `"params": [`
  `"01000000014221abdcca25c8a3b0c044034875dece048c77d567a806f0c2e7e0f5e25a8f100..."`
 `],`
 `"id": null`
`}` | ***
-| | | -|---|---| -|Method|filteredblockconnected| -|Request|[notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter)| -|Parameters|1. BlockHeight (numeric) height of the attached block
2. Header (string) hex-encoded serialized header of the attached block
3. Transactions (JSON array) hex-encoded serialized transactions matching the filter for the client connection loaded with [loadtxfilter](#loadtxfilter)| -|Description|Notifies when a block has been added to the main chain. Notification is sent to all connected clients.| -|Example|Example filteredblockconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "filteredblockconnected",`
 `"params":`
  `[`
   `280330,`
   `"0200000052d1e8813f697293e41942aa230e7e4fcc44832d78a1372202000000000000006aa...",`
   `[`
    `"01000000014221abdcca25c8a3b0c044034875dece048c77d567a806f0c2e7e0f5e25a8f100..."`
   `]`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | filteredblockconnected | +| Request | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter) | +| Parameters | 1. BlockHeight (numeric) height of the attached block
2. Header (string) hex-encoded serialized header of the attached block
3. Transactions (JSON array) hex-encoded serialized transactions matching the filter for the client connection loaded with [loadtxfilter](#loadtxfilter) | +| Description | Notifies when a block has been added to the main chain. Notification is sent to all connected clients. | +| Example | Example filteredblockconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "filteredblockconnected",`
 `"params":`
  `[`
   `280330,`
   `"0200000052d1e8813f697293e41942aa230e7e4fcc44832d78a1372202000000000000006aa...",`
   `[`
    `"01000000014221abdcca25c8a3b0c044034875dece048c77d567a806f0c2e7e0f5e25a8f100..."`
   `]`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|filteredblockdisconnected| -|Request|[notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter)| -|Parameters|1. BlockHeight (numeric) height of the disconnected block
2. Header (string) hex-encoded serialized header of the disconnected block| -|Description|Notifies when a block has been removed from the main chain. Notification is sent to all connected clients.| -|Example|Example blockdisconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "blockdisconnected",`
 `"params":`
  `[`
   `280330,`
   `"0200000052d1e8813f697293e41942aa230e7e4fcc44832d78a1372202000000000000006aa..."`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | filteredblockdisconnected | +| Request | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter) | +| Parameters | 1. BlockHeight (numeric) height of the disconnected block
2. Header (string) hex-encoded serialized header of the disconnected block | +| Description | Notifies when a block has been removed from the main chain. Notification is sent to all connected clients. | +| Example | Example blockdisconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "blockdisconnected",`
 `"params":`
  `[`
   `280330,`
   `"0200000052d1e8813f697293e41942aa230e7e4fcc44832d78a1372202000000000000006aa..."`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
@@ -1075,7 +1067,7 @@ various languages. **9.1 Go** This section provides examples of using the RPC interface using Go and the -[rpcclient](https://github.com/btcsuite/btcd/tree/master/rpcclient) package. +[rpcclient](https://github.com/lbryio/lbcd/tree/master/rpcclient) package. * [Using getblockcount to Retrieve the Current Block Height](#ExampleGetBlockCount) * [Using getblock to Retrieve the Genesis Block](#ExampleGetBlock) @@ -1087,8 +1079,8 @@ This section provides examples of using the RPC interface using Go and the **9.1.1 Using getblockcount to Retrieve the Current Block Height**
The following is an example Go application which uses the -[rpcclient](https://github.com/btcsuite/btcd/tree/master/rpcclient) package to connect with -a btcd instance via Websockets, issues [getblockcount](#getblockcount) to +[rpcclient](https://github.com/lbryio/lbcd/tree/master/rpcclient) package to connect with +a lbcd instance via Websockets, issues [getblockcount](#getblockcount) to retrieve the current block height, and displays it. ```Go @@ -1099,16 +1091,16 @@ import ( "log" "path/filepath" - "github.com/btcsuite/btcd/rpcclient" - "github.com/btcsuite/btcutil" + "github.com/lbryio/lbcd/rpcclient" + btcutil "github.com/lbryio/lbcutil" ) func main() { // Load the certificate for the TLS connection which is automatically - // generated by btcd when it starts the RPC server and doesn't already + // generated by lbcd when it starts the RPC server and doesn't already // have one. - btcdHomeDir := btcutil.AppDataDir("btcd", false) - certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert")) + lbcdHomeDir := btcutil.AppDataDir("lbcd", false) + certs, err := ioutil.ReadFile(filepath.Join(lbcdHomeDir, "rpc.cert")) if err != nil { log.Fatal(err) } @@ -1116,8 +1108,8 @@ func main() { // Create a new RPC client using websockets. Since this example is // not long-lived, the connection will be closed as soon as the program // exits. - connCfg := &rpcclient.ConnConfig{ - Host: "localhost:8334", + connCfg := &btcrpcclient.ConnConfig{ + Host: "localhost:9245", Endpoint: "ws", User: "yourrpcuser", Pass: "yourrpcpass", @@ -1149,8 +1141,8 @@ Which results in: **9.1.2 Using getblock to Retrieve the Genesis Block**
The following is an example Go application which uses the -[rpcclient](https://github.com/btcsuite/btcd/tree/master/rpcclient) package to connect with -a btcd instance via Websockets, issues [getblock](#getblock) to retrieve +[rpcclient](https://github.com/lbryio/lbcd/tree/master/rpcclient) package to connect with +a lbcd instance via Websockets, issues [getblock](#getblock) to retrieve information about the Genesis block, and display a few details about it. ```Go @@ -1162,17 +1154,17 @@ import ( "path/filepath" "time" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/rpcclient" - "github.com/btcsuite/btcutil" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/rpcclient" + btcutil "github.com/lbryio/lbcutil" ) func main() { // Load the certificate for the TLS connection which is automatically - // generated by btcd when it starts the RPC server and doesn't already + // generated by lbcd when it starts the RPC server and doesn't already // have one. - btcdHomeDir := btcutil.AppDataDir("btcd", false) - certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert")) + lbcdHomeDir := btcutil.AppDataDir("lbcd", false) + certs, err := ioutil.ReadFile(filepath.Join(lbcdHomeDir, "rpc.cert")) if err != nil { log.Fatal(err) } @@ -1180,8 +1172,8 @@ func main() { // Create a new RPC client using websockets. Since this example is // not long-lived, the connection will be closed as soon as the program // exits. - connCfg := &rpcclient.ConnConfig{ - Host: "localhost:18334", + connCfg := &btcrpcclient.ConnConfig{ + Host: "localhost:19245", Endpoint: "ws", User: "yourrpcuser", Pass: "yourrpcpass", @@ -1239,8 +1231,8 @@ Num transactions: 1 Notifications (Websocket-specific)**
The following is an example Go application which uses the -[rpcclient](https://github.com/btcsuite/btcd/tree/master/rpcclient) package to connect with -a btcd instance via Websockets and registers for +[rpcclient](https://github.com/lbryio/lbcd/tree/master/rpcclient) package to connect with +a lbcd instance via Websockets and registers for [blockconnected](#blockconnected) and [blockdisconnected](#blockdisconnected) notifications with [notifyblocks](#notifyblocks). It also sets up handlers for the notifications. @@ -1254,9 +1246,9 @@ import ( "path/filepath" "time" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/rpcclient" - "github.com/btcsuite/btcutil" + "github.com/lbryio/lbcd/chaincfg/chainhash" + "github.com/lbryio/lbcd/rpcclient" + btcutil "github.com/lbryio/lbcutil" ) func main() { @@ -1272,17 +1264,17 @@ func main() { } // Load the certificate for the TLS connection which is automatically - // generated by btcd when it starts the RPC server and doesn't already + // generated by lbcd when it starts the RPC server and doesn't already // have one. - btcdHomeDir := btcutil.AppDataDir("btcd", false) - certs, err := ioutil.ReadFile(filepath.Join(btcdHomeDir, "rpc.cert")) + lbcdHomeDir := btcutil.AppDataDir("lbcd", false) + certs, err := ioutil.ReadFile(filepath.Join(lbcdHomeDir, "rpc.cert")) if err != nil { log.Fatal(err) } // Create a new RPC client using websockets. - connCfg := &rpcclient.ConnConfig{ - Host: "localhost:8334", + connCfg := &btcrpcclient.ConnConfig{ + Host: "localhost:9245", Endpoint: "ws", User: "yourrpcuser", Pass: "yourrpcpass", @@ -1337,7 +1329,7 @@ Example output: **9.2.1 Using notifyblocks to be Notified of Block Connects and Disconnects**
The following is example node.js code which uses [ws](https://github.com/einaros/ws) -(can be installed with `npm install ws`) to connect with a btcd instance, +(can be installed with `npm install ws`) to connect with a lbcd instance, issues [notifyblocks](#notifyblocks) to register for [blockconnected](#blockconnected) and [blockdisconnected](#blockdisconnected) notifications, and displays all incoming messages. @@ -1347,17 +1339,17 @@ var fs = require('fs'); var WebSocket = require('ws'); // Load the certificate for the TLS connection which is automatically -// generated by btcd when it starts the RPC server and doesn't already +// generated by lbcd when it starts the RPC server and doesn't already // have one. -var cert = fs.readFileSync('/path/to/btcd/appdata/rpc.cert'); +var cert = fs.readFileSync('/path/to/lbcd/appdata/rpc.cert'); var user = "yourusername"; var password = "yourpassword"; -// Initiate the websocket connection. The btcd generated certificate acts as +// Initiate the websocket connection. The lbcd generated certificate acts as // its own certificate authority, so it needs to be specified in the 'ca' array // for the certificate to properly validate. -var ws = new WebSocket('wss://127.0.0.1:8334/ws', { +var ws = new WebSocket('wss://127.0.0.1:9245/ws', { headers: { 'Authorization': 'Basic '+new Buffer(user+':'+password).toString('base64') }, diff --git a/docs/mining.md b/docs/mining.md index 29a3e898..226d560b 100644 --- a/docs/mining.md +++ b/docs/mining.md @@ -1,6 +1,6 @@ # Mining -btcd supports the `getblocktemplate` RPC. +lbcd supports the `getblocktemplate` RPC. The limited user cannot access this RPC. ## Add the payment addresses with the `miningaddr` option @@ -13,18 +13,20 @@ miningaddr=12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX miningaddr=1M83ju3EChKYyysmM2FXtLNftbacagd8FR ``` -## Add btcd's RPC TLS certificate to system Certificate Authority list +## Add lbcd's RPC TLS certificate to system Certificate Authority list -`cgminer` uses [curl](http://curl.haxx.se/) to fetch data from the RPC server. -Since curl validates the certificate by default, we must install the `btcd` RPC +Various miners use [curl](http://curl.haxx.se/) to fetch data from the RPC server. +Since curl validates the certificate by default, we must install the `lbcd` RPC certificate into the default system Certificate Authority list. ## Ubuntu -1. Copy rpc.cert to /usr/share/ca-certificates: `# cp /home/user/.btcd/rpc.cert /usr/share/ca-certificates/btcd.crt` -2. Add btcd.crt to /etc/ca-certificates.conf: `# echo btcd.crt >> /etc/ca-certificates.conf` +1. Copy rpc.cert to /usr/share/ca-certificates: `# cp /home/user/.lbcd/rpc.cert /usr/share/ca-certificates/lbcd.crt` +2. Add lbcd.crt to /etc/ca-certificates.conf: `# echo lbcd.crt >> /etc/ca-certificates.conf` 3. Update the CA certificate list: `# update-ca-certificates` ## Set your mining software url to use https -`cgminer -o https://127.0.0.1:8334 -u rpcuser -p rpcpassword` +`cgminer -o https://127.0.0.1:9245 -u rpcuser -p rpcpassword` + +Alternatively, you can disable TLS with the `--notls` option for the server. diff --git a/docs/table_of_content.md b/docs/table_of_content.md deleted file mode 100644 index 85f08a97..00000000 --- a/docs/table_of_content.md +++ /dev/null @@ -1,13 +0,0 @@ -# Contents - -* [Installation](installation.md) -* [Update](update.md) -* [Configuration](configuration.md) -* [Configuring TOR](configuring_tor.md) -* [Controlling](controlling.md) -* [Mining](mining.md) -* [Wallet](wallet.md) -* [Developer resources](developer_resources.md) -* [JSON RPC API](json_rpc_api.md) -* [Code contribution guidelines](code_contribution_guidelines.md) -* [Contact](contact.md) diff --git a/docs/update.md b/docs/update.md deleted file mode 100644 index 1fb847cf..00000000 --- a/docs/update.md +++ /dev/null @@ -1,8 +0,0 @@ -# Update - -* Run the following commands to update btcd, all dependencies, and install it: - -```bash -cd $GOPATH/src/github.com/btcsuite/btcd -git pull && GO111MODULE=on go install -v . ./cmd/... -``` diff --git a/docs/using_docker.md b/docs/using_docker.md deleted file mode 100644 index 0809abc1..00000000 --- a/docs/using_docker.md +++ /dev/null @@ -1,160 +0,0 @@ -# Using Docker - -- [Using Docker](#using-docker) - - [Introduction](#introduction) - - [Docker volumes](#docker-volumes) - - [Known error messages when starting the btcd container](#known-error-messages-when-starting-the-btcd-container) - - [Examples](#examples) - - [Preamble](#preamble) - - [Full node without RPC port](#full-node-without-rpc-port) - - [Full node with RPC port](#full-node-with-rpc-port) - - [Full node with RPC port running on TESTNET](#full-node-with-rpc-port-running-on-testnet) - -## Introduction - -With Docker you can easily set up *btcd* to run your Bitcoin full node. You can find the official *btcd* Docker images on Docker Hub [btcsuite/btcd](https://hub.docker.com/r/btcsuite/btcd). The Docker source file of this image is located at [Dockerfile](https://github.com/btcsuite/btcd/blob/master/Dockerfile). - -This documentation focuses on running Docker container with *docker-compose.yml* files. These files are better to read and you can use them as a template for your own use. For more information about Docker and Docker compose visit the official [Docker documentation](https://docs.docker.com/). - -## Docker volumes - -**Special diskspace hint**: The following examples are using a Docker managed volume. The volume is named *btcd-data* This will use a lot of disk space, because it contains the full Bitcoin blockchain. Please make yourself familiar with [Docker volumes](https://docs.docker.com/storage/volumes/). - -The *btcd-data* volume will be reused, if you upgrade your *docker-compose.yml* file. Keep in mind, that it is not automatically removed by Docker, if you delete the btcd container. If you don't need the volume anymore, please delete it manually with the command: - -```bash -docker volume ls -docker volume rm btcd-data -``` - -For binding a local folder to your *btcd* container please read the [Docker documentation](https://docs.docker.com/). The preferred way is to use a Docker managed volume. - -## Known error messages when starting the btcd container - -We pass all needed arguments to *btcd* as command line parameters in our *docker-compose.yml* file. It doesn't make sense to create a *btcd.conf* file. This would make things too complicated. Anyhow *btcd* will complain with following log messages when starting. These messages can be ignored: - -```bash -Error creating a default config file: open /sample-btcd.conf: no such file or directory -... -[WRN] BTCD: open /root/.btcd/btcd.conf: no such file or directory -``` - -## Examples - -### Preamble - -All following examples uses some defaults: - -- container_name: btcd - Name of the docker container that is be shown by e.g. ```docker ps -a``` - -- hostname: btcd **(very important to set a fixed name before first start)** - The internal hostname in the docker container. By default, docker is recreating the hostname every time you change the *docker-compose.yml* file. The default hostnames look like *ef00548d4fa5*. This is a problem when using the *btcd* RPC port. The RPC port is using a certificate to validate the hostname. If the hostname changes you need to recreate the certificate. To avoid this, you should set a fixed hostname before the first start. This ensures, that the docker volume is created with a certificate with this hostname. - -- restart: unless-stopped - Starts the *btcd* container when Docker starts, except that when the container is stopped (manually or otherwise), it is not restarted even after Docker restarts. - -To use the following examples create an empty directory. In this directory create a file named *docker-compose.yml*, copy and paste the example into the *docker-compose.yml* file and run it. - -```bash -mkdir ~/btcd-docker -cd ~/btcd-docker -touch docker-compose.yaml -nano docker-compose.yaml (use your favourite editor to edit the compose file) -docker-compose up (creates and starts a new btcd container) -``` - -With the following commands you can control *docker-compose*: - -```docker-compose up -d``` (creates and starts the container in background) - -```docker-compose down``` (stops and delete the container. **The docker volume btcd-data will not be deleted**) - -```docker-compose stop``` (stops the container) - -```docker-compose start``` (starts the container) - -```docker ps -a``` (list all running and stopped container) - -```docker volume ls``` (lists all docker volumes) - -```docker logs btcd``` (shows the log ) - -```docker-compose help``` (brings up some helpful information) - -### Full node without RPC port - -Let's start with an easy example. If you just want to create a full node without the need of using the RPC port, you can use the following example. This example will launch *btcd* and exposes only the default p2p port 8333 to the outside world: - -```yaml -version: "2" - -services: - btcd: - container_name: btcd - hostname: btcd - image: btcsuite/btcd:latest - restart: unless-stopped - volumes: - - btcd-data:/root/.btcd - ports: - - 8333:8333 - -volumes: - btcd-data: -``` - -### Full node with RPC port - -To use the RPC port of *btcd* you need to specify a *username* and a very strong *password*. If you want to connect to the RPC port from the internet, you need to expose port 8334(RPC) as well. - -```yaml -version: "2" - -services: - btcd: - container_name: btcd - hostname: btcd - image: btcsuite/btcd:latest - restart: unless-stopped - volumes: - - btcd-data:/root/.btcd - ports: - - 8333:8333 - - 8334:8334 - command: [ - "--rpcuser=[CHOOSE_A_USERNAME]", - "--rpcpass=[CREATE_A_VERY_HARD_PASSWORD]" - ] - -volumes: - btcd-data: -``` - -### Full node with RPC port running on TESTNET - -To run a node on testnet, you need to provide the *--testnet* argument. The ports for testnet are 18333 (p2p) and 18334 (RPC): - -```yaml -version: "2" - -services: - btcd: - container_name: btcd - hostname: btcd - image: btcsuite/btcd:latest - restart: unless-stopped - volumes: - - btcd-data:/root/.btcd - ports: - - 18333:18333 - - 18334:18334 - command: [ - "--testnet", - "--rpcuser=[CHOOSE_A_USERNAME]", - "--rpcpass=[CREATE_A_VERY_HARD_PASSWORD]" - ] - -volumes: - btcd-data: -``` diff --git a/docs/wallet.md b/docs/wallet.md deleted file mode 100644 index cc123aa7..00000000 --- a/docs/wallet.md +++ /dev/null @@ -1,5 +0,0 @@ -# Wallet - -btcd was intentionally developed without an integrated wallet for security -reasons. Please see [btcwallet](https://github.com/btcsuite/btcwallet) for more -information. diff --git a/integration/README.md b/integration/README.md index 5f6f14ea..db58a898 100644 --- a/integration/README.md +++ b/integration/README.md @@ -1,13 +1,8 @@ integration =========== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) This contains integration tests which make use of the -[rpctest](https://github.com/btcsuite/btcd/tree/master/integration/rpctest) +[rpctest](https://github.com/lbryio/lbcd/tree/master/integration/rpctest) package to programmatically drive nodes via RPC. - -## License - -This code is licensed under the [copyfree](http://copyfree.org) ISC License. diff --git a/integration/rpctest/README.md b/integration/rpctest/README.md index 79f45bc8..8ccfc879 100644 --- a/integration/rpctest/README.md +++ b/integration/rpctest/README.md @@ -1,9 +1,7 @@ rpctest ======= -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/integration/rpctest) Package rpctest provides a btcd-specific RPC testing harness crafting and executing integration tests by driving a `btcd` instance via the `RPC` @@ -16,15 +14,3 @@ This package was designed specifically to act as an RPC testing harness for `btcd`. However, the constructs presented are general enough to be adapted to any project wishing to programmatically drive a `btcd` instance of its systems/integration tests. - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/integration/rpctest -``` - -## License - -Package rpctest is licensed under the [copyfree](http://copyfree.org) ISC -License. - diff --git a/mempool/README.md b/mempool/README.md index 5f1e4a4c..1e19f843 100644 --- a/mempool/README.md +++ b/mempool/README.md @@ -1,9 +1,7 @@ mempool ======= -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/mempool) Package mempool provides a policy-enforced pool of unmined bitcoin transactions. @@ -33,11 +31,6 @@ proceed. Typically, this will involve things such as relaying the transactions to other peers on the network and notifying the mining process that new transactions are available. -This package has intentionally been designed so it can be used as a standalone -package for any projects needing the ability create an in-memory pool of bitcoin -transactions that are not only valid by consensus rules, but also adhere to a -configurable policy. - ## Feature Overview The following is a quick overview of the major features. It is not intended to @@ -70,14 +63,3 @@ be an exhaustive list. - The starting priority for the transaction - Manual control of transaction removal - Recursive removal of all dependent transactions - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/mempool -``` - -## License - -Package mempool is licensed under the [copyfree](http://copyfree.org) ISC -License. diff --git a/mining/README.md b/mining/README.md index 3abd1953..40a30a20 100644 --- a/mining/README.md +++ b/mining/README.md @@ -1,21 +1,8 @@ mining ====== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/mining) ## Overview -This package is currently a work in progress. - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/mining -``` - -## License - -Package mining is licensed under the [copyfree](http://copyfree.org) ISC -License. +This package is currently a work in progress. \ No newline at end of file diff --git a/mining/cpuminer/README.md b/mining/cpuminer/README.md index 47247be9..270e435d 100644 --- a/mining/cpuminer/README.md +++ b/mining/cpuminer/README.md @@ -1,9 +1,9 @@ cpuminer ======== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) +[![Build Status](https://github.com/lbryio/lbcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/lbryio/lbcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/mining/cpuminer) +[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/lbryio/lbcd/mining/cpuminer) ======= ## Overview @@ -16,7 +16,7 @@ now. ## Installation and Updating ```bash -$ go get -u github.com/btcsuite/btcd/mining/cpuminer +$ go get -u github.com/lbryio/lbcd/mining/cpuminer ``` ## License diff --git a/netsync/README.md b/netsync/README.md index a4966815..22f51701 100644 --- a/netsync/README.md +++ b/netsync/README.md @@ -1,9 +1,7 @@ netsync ======= -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/netsync) ## Overview @@ -13,13 +11,3 @@ download, keep the chain and unconfirmed transaction pool in sync, and announce new blocks connected to the chain. Currently the sync manager selects a single sync peer that it downloads all blocks from until it is up to date with the longest chain the sync peer is aware of. - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/netsync -``` - -## License - -Package netsync is licensed under the [copyfree](http://copyfree.org) ISC License. diff --git a/peer/README.md b/peer/README.md index 217f5dc3..51761319 100644 --- a/peer/README.md +++ b/peer/README.md @@ -1,16 +1,11 @@ peer ==== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/peer) Package peer provides a common base for creating and managing bitcoin network peers. -This package has intentionally been designed so it can be used as a standalone -package for any projects needing a full featured bitcoin peer base to build on. - ## Overview This package builds upon the wire package, which provides the fundamental @@ -54,20 +49,4 @@ A quick overview of the major features peer provides are as follows: filtering and address randomization - Ability to wait for shutdown/disconnect - Comprehensive test coverage - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/peer -``` - -## Examples - -* [New Outbound Peer Example](https://pkg.go.dev/github.com/btcsuite/btcd/peer#example-package--NewOutboundPeer) - Demonstrates the basic process for initializing and creating an outbound peer. - Peers negotiate by exchanging version and verack messages. For demonstration, - a simple handler for the version message is attached to the peer. - -## License - -Package peer is licensed under the [copyfree](http://copyfree.org) ISC License. + \ No newline at end of file diff --git a/release/README.md b/release/README.md deleted file mode 100644 index 7128ef1f..00000000 --- a/release/README.md +++ /dev/null @@ -1,181 +0,0 @@ -# `btcd`'s Reproducible Build System - -This package contains the build script that the `btcd` project uses in order to -build binaries for each new release. As of `go1.13`, with some new build flags, -binaries are now reproducible, allowing developers to build the binary on -distinct machines, and end up with a byte-for-byte identical binary. -Every release should note which Go version was used to build the release, so -that version should be used for verifying the release. - -## Building a New Release - -### Tagging and pushing a new tag (for maintainers) - -Before running release scripts, a few things need to happen in order to finally -create a release and make sure there are no mistakes in the release process. - -First, make sure that before the tagged commit there are modifications to the -[CHANGES](../CHANGES) file committed. -The CHANGES file should be a changelog that roughly mirrors the release notes. -Generally, the PRs that have been merged since the last release have been -listed in the CHANGES file and categorized. -For example, these changes have had the following format in the past: -``` -Changes in X.YY.Z (Month Day Year): - - Protocol and Network-related changes: - - PR Title One (#PRNUM) - - PR Title Two (#PRNUMTWO) - ... - - RPC changes: - - Crypto changes: - ... - - - Contributors (alphabetical order): - - Contributor A - - Contributor B - - Contributor C - ... -``` - -If the previous tag is, for example, `vA.B.C`, then you can get the list of -contributors (from `vA.B.C` until the current `HEAD`) using the following command: -```bash -git log vA.B.C..HEAD --pretty="%an" | sort | uniq -``` -After committing changes to the CHANGES file, the tagged release commit -should be created. - -The tagged commit should be a commit that bumps version numbers in `version.go` -and `cmd/btcctl/version.go`. -For example (taken from [f3ec130](https://github.com/btcsuite/btcd/commit/f3ec13030e4e828869954472cbc51ac36bee5c1d)): -```diff -diff --git a/cmd/btcctl/version.go b/cmd/btcctl/version.go -index 2195175c71..f65cacef7e 100644 ---- a/cmd/btcctl/version.go -+++ b/cmd/btcctl/version.go -@@ -18,7 +18,7 @@ const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr - const ( - appMajor uint = 0 - appMinor uint = 20 -- appPatch uint = 0 -+ appPatch uint = 1 - - // appPreRelease MUST only contain characters from semanticAlphabet - // per the semantic versioning spec. -diff --git a/version.go b/version.go -index 92fd60fdd4..fba55b5a37 100644 ---- a/version.go -+++ b/version.go -@@ -18,7 +18,7 @@ const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr - const ( - appMajor uint = 0 - appMinor uint = 20 -- appPatch uint = 0 -+ appPatch uint = 1 - - // appPreRelease MUST only contain characters from semanticAlphabet - // per the semantic versioning spec. -``` - -Next, this commit should be signed by the maintainer using `git commit -S`. -The commit should be tagged and signed with `git tag -s`, and should be -pushed using `git push origin TAG`. - -### Building a release on macOS/Linux/Windows (WSL) - -No prior set up is needed on Linux or macOS is required in order to build the -release binaries. However, on Windows, the only way to build the release -binaries at the moment is by using the Windows Subsystem Linux. One can build -the release binaries following these steps: - -1. `git clone https://github.com/btcsuite/btcd.git` -2. `cd btcd` -3. `./release/release.sh # is the name of the next release/tag` - -This will then create a directory of the form `btcd-` containing archives -of the release binaries for each supported operating system and architecture, -and a manifest file containing the hash of each archive. - -### Pushing a release (for maintainers) - -Now that the directory `btcd-` is created, the manifest file needs to be -signed by a maintainer and the release files need to be published to GitHub. - -Sign the `manifest-.txt` file like so: -```sh -gpg --sign --detach-sig manifest-.txt -``` -This will create a file named `manifest-.txt.sig`, which will must -be included in the release files later. - -#### Note before publishing -Before publishing, go through the reproducible build process that is outlined -in this document with the files created from `release/release.sh`. This includes -verifying commit and tag signatures using `git verify-commit` and git `verify-tag` -respectively. - -Now that we've double-checked everything and have all of the necessary files, -it's time to publish release files on GitHub. -Follow [this documentation](https://docs.github.com/en/github/administering-a-repository/managing-releases-in-a-repository) -to create a release using the GitHub UI, and make sure to write release notes -which roughly follow the format of [previous release notes](https://github.com/btcsuite/btcd/releases/tag/v0.20.1-beta). -This is different from the [CHANGES](../CHANGES) file, which should be before the -tagged commit in the git history. -Much of the information in the release notes will be the same as the CHANGES -file. -It's important to include the Go version used to produce the release files in -the release notes, so users know the correct version of Go to use to reproduce -and verify the build. -When following the GitHub documentation, include every file in the `btcd-` -directory. - -At this point, a signed commit and tag on that commit should be pushed to the main -branch. The directory created from running `release/release.sh` should be included -as release files in the GitHub release UI, and the `manifest-.txt` file -signature, called `manifest-.txt.sig`, should also be included. -A release notes document should be created and written in the GitHub release UI. -Once all of this is done, feel free to click `Publish Release`! - -## Verifying a Release - -With `go1.13`, it's now possible for third parties to verify release binaries. -Before this version of `go`, one had to trust the release manager(s) to build the -proper binary. With this new system, third parties can now _independently_ run -the release process, and verify that all the hashes of the release binaries -match exactly that of the release binaries produced by said third parties. - -To verify a release, one must obtain the following tools (many of these come -installed by default in most Unix systems): `gpg`/`gpg2`, `shashum`, and -`tar`/`unzip`. - -Once done, verifiers can proceed with the following steps: - -1. Acquire the archive containing the release binaries for one's specific - operating system and architecture, and the manifest file along with its - signature. -2. Verify the signature of the manifest file with `gpg --verify - manifest-.txt.sig`. This will require obtaining the PGP keys which - signed the manifest file, which are included in the release notes. -3. Recompute the `SHA256` hash of the archive with `shasum -a 256 `, - locate the corresponding one in the manifest file, and ensure they match - __exactly__. - -At this point, verifiers can use the release binaries acquired if they trust -the integrity of the release manager(s). Otherwise, one can proceed with the -guide to verify the release binaries were built properly by obtaining `shasum` -and `go` (matching the same version used in the release): - -4. Extract the release binaries contained within the archive, compute their - hashes as done above, and note them down. -5. Ensure `go` is installed, matching the same version as noted in the release - notes. -6. Obtain a copy of `btcd`'s source code with `git clone - https://github.com/btcsuite/btcd` and checkout the source code of the - release with `git checkout `. -7. Proceed to verify the tag with `git verify-tag ` and compile the - binaries from source for the intended operating system and architecture with - `BTCDBUILDSYS=OS-ARCH ./release/release.sh `. -8. Extract the archive found in the `btcd-` directory created by the - release script and recompute the `SHA256` hash of the release binaries (btcd - and btcctl) with `shasum -a 256 `. These should match __exactly__ - as the ones noted above. \ No newline at end of file diff --git a/rpcclient/README.md b/rpcclient/README.md index 08b16f75..c5a42063 100644 --- a/rpcclient/README.md +++ b/rpcclient/README.md @@ -1,13 +1,11 @@ rpcclient ========= -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/rpcclient) rpcclient implements a Websocket-enabled Bitcoin JSON-RPC client package written in [Go](http://golang.org/). It provides a robust and easy to use client for -interfacing with a Bitcoin RPC server that uses a btcd/bitcoin core compatible +interfacing with a Bitcoin RPC server that uses a lbcd/bitcoin core compatible Bitcoin JSON-RPC API. ## Status @@ -16,26 +14,11 @@ This package is currently under active development. It is already stable and the infrastructure is complete. However, there are still several RPCs left to implement and the API is not stable yet. -## Documentation - -* [API Reference](https://pkg.go.dev/github.com/btcsuite/btcd/rpcclient) -* [btcd Websockets Example](https://github.com/btcsuite/btcd/tree/master/rpcclient/examples/btcdwebsockets) - Connects to a btcd RPC server using TLS-secured websockets, registers for - block connected and block disconnected notifications, and gets the current - block count -* [btcwallet Websockets Example](https://github.com/btcsuite/btcd/tree/master/rpcclient/examples/btcwalletwebsockets) - Connects to a btcwallet RPC server using TLS-secured websockets, registers for - notifications about changes to account balances, and gets a list of unspent - transaction outputs (utxos) the wallet can sign -* [Bitcoin Core HTTP POST Example](https://github.com/btcsuite/btcd/tree/master/rpcclient/examples/bitcoincorehttp) - Connects to a bitcoin core RPC server using HTTP POST mode with TLS disabled - and gets the current block count - ## Major Features -* Supports Websockets (btcd/btcwallet) and HTTP POST mode (bitcoin core) -* Provides callback and registration functions for btcd/btcwallet notifications -* Supports btcd extensions +* Supports Websockets (lbcd/lbcwallet) and HTTP POST mode (bitcoin core) +* Provides callback and registration functions for lbcd/lbcwallet notifications +* Supports lbcd extensions * Translates to and from higher-level and easier to use Go types * Offers a synchronous (blocking) and asynchronous API * When running in Websockets mode (the default): @@ -43,14 +26,4 @@ implement and the API is not stable yet. * Outstanding commands are automatically reissued * Registered notifications are automatically reregistered * Back-off support on reconnect attempts - -## Installation - -```bash -$ go get -u github.com/btcsuite/btcd/rpcclient -``` - -## License - -Package rpcclient is licensed under the [copyfree](http://copyfree.org) ISC -License. + \ No newline at end of file diff --git a/rpcclient/examples/bitcoincorehttp/README.md b/rpcclient/examples/bitcoincorehttp/README.md index 4d1f0adf..e26e68ce 100644 --- a/rpcclient/examples/bitcoincorehttp/README.md +++ b/rpcclient/examples/bitcoincorehttp/README.md @@ -10,7 +10,7 @@ block count. The first step is to use `go get` to download and install the rpcclient package: ```bash -$ go get github.com/btcsuite/btcd/rpcclient +$ go get github.com/lbryio/lbcd/rpcclient ``` Next, modify the `main.go` source to specify the correct RPC username and @@ -24,7 +24,7 @@ password for the RPC server: Finally, navigate to the example's directory and run it with: ```bash -$ cd $GOPATH/src/github.com/btcsuite/btcd/rpcclient/examples/bitcoincorehttp +$ cd $GOPATH/src/github.com/lbryio/lbcd/rpcclient/examples/bitcoincorehttp $ go run *.go ``` diff --git a/rpcclient/examples/bitcoincorehttpbulk/README.md b/rpcclient/examples/bitcoincorehttpbulk/README.md index ca900b6e..6d1a02c0 100644 --- a/rpcclient/examples/bitcoincorehttpbulk/README.md +++ b/rpcclient/examples/bitcoincorehttpbulk/README.md @@ -8,7 +8,7 @@ This example shows how to use the rpclient package to connect to a Bitcoin Core The first step is to use `go get` to download and install the rpcclient package: ```bash -$ go get github.com/btcsuite/btcd/rpcclient +$ go get github.com/lbryio/lbcd/rpcclient ``` Next, modify the `main.go` source to specify the correct RPC username and @@ -22,7 +22,7 @@ password for the RPC server: Finally, navigate to the example's directory and run it with: ```bash -$ cd $GOPATH/src/github.com/btcsuite/btcd/rpcclient/examples/bitcoincorehttp +$ cd $GOPATH/src/github.com/lbryio/lbcd/rpcclient/examples/bitcoincorehttp $ go run *.go ``` diff --git a/rpcclient/examples/btcdwebsockets/README.md b/rpcclient/examples/btcdwebsockets/README.md index a1686484..4168a0fa 100644 --- a/rpcclient/examples/btcdwebsockets/README.md +++ b/rpcclient/examples/btcdwebsockets/README.md @@ -13,7 +13,7 @@ demonstrate clean shutdown. The first step is to use `go get` to download and install the rpcclient package: ```bash -$ go get github.com/btcsuite/btcd/rpcclient +$ go get github.com/lbryio/lbcd/rpcclient ``` Next, modify the `main.go` source to specify the correct RPC username and @@ -27,7 +27,7 @@ password for the RPC server: Finally, navigate to the example's directory and run it with: ```bash -$ cd $GOPATH/src/github.com/btcsuite/btcd/rpcclient/examples/btcdwebsockets +$ cd $GOPATH/src/github.com/lbryio/lbcd/rpcclient/examples/btcdwebsockets $ go run *.go ``` diff --git a/rpcclient/examples/btcwalletwebsockets/README.md b/rpcclient/examples/btcwalletwebsockets/README.md index e495dff8..1e95a6c1 100644 --- a/rpcclient/examples/btcwalletwebsockets/README.md +++ b/rpcclient/examples/btcwalletwebsockets/README.md @@ -14,7 +14,7 @@ demonstrate clean shutdown. The first step is to use `go get` to download and install the rpcclient package: ```bash -$ go get github.com/btcsuite/btcd/rpcclient +$ go get github.com/lbryio/lbcd/rpcclient ``` Next, modify the `main.go` source to specify the correct RPC username and @@ -28,7 +28,7 @@ password for the RPC server: Finally, navigate to the example's directory and run it with: ```bash -$ cd $GOPATH/src/github.com/btcsuite/btcd/rpcclient/examples/btcwalletwebsockets +$ cd $GOPATH/src/github.com/lbryio/lbcd/rpcclient/examples/btcwalletwebsockets $ go run *.go ``` diff --git a/rpcclient/examples/customcommand/README.md b/rpcclient/examples/customcommand/README.md index 0e36d649..21670cc8 100644 --- a/rpcclient/examples/customcommand/README.md +++ b/rpcclient/examples/customcommand/README.md @@ -9,7 +9,7 @@ implementing the `name_show` command from Namecoin Core. The first step is to use `go get` to download and install the rpcclient package: ```bash -$ go get github.com/btcsuite/btcd/rpcclient +$ go get github.com/lbryio/lbcd/rpcclient ``` Next, modify the `main.go` source to specify the correct RPC username and @@ -23,7 +23,7 @@ password for the RPC server of your Namecoin Core node: Finally, navigate to the example's directory and run it with: ```bash -$ cd $GOPATH/src/github.com/btcsuite/btcd/rpcclient/examples/customcommand +$ cd $GOPATH/src/github.com/lbryio/lbcd/rpcclient/examples/customcommand $ go run *.go ``` diff --git a/rpcclient/examples/customcommand/main.go b/rpcclient/examples/customcommand/main.go index 1e14c06f..e89719d5 100644 --- a/rpcclient/examples/customcommand/main.go +++ b/rpcclient/examples/customcommand/main.go @@ -9,8 +9,8 @@ import ( "encoding/json" "log" - "github.com/btcsuite/btcd/btcjson" - "github.com/btcsuite/btcd/rpcclient" + "github.com/lbryio/lbcd/btcjson" + "github.com/lbryio/lbcd/rpcclient" ) // NameShowCmd defines the name_show JSON-RPC command. diff --git a/sample-btcd.conf b/sample-lbcd.conf similarity index 94% rename from sample-btcd.conf rename to sample-lbcd.conf index 0a765fca..ae9d232e 100644 --- a/sample-btcd.conf +++ b/sample-lbcd.conf @@ -6,12 +6,12 @@ ; The directory to store data such as the block chain and peer addresses. The ; block chain takes several GB, so this location must have a lot of free space. -; The default is ~/.btcd/data on POSIX OSes, $LOCALAPPDATA/Btcd/data on Windows, -; ~/Library/Application Support/Btcd/data on Mac OS, and $home/btcd/data on +; The default is ~/.lbcd/data on POSIX OSes, $LOCALAPPDATA/Lbcd/data on Windows, +; ~/Library/Application Support/Lbcd/data on Mac OS, and $home/lbcd/data on ; Plan9. Environment variables are expanded so they may be used. NOTE: Windows ; environment variables are typically %VARIABLE%, but they must be accessed with ; $VARIABLE here. Also, ~ is expanded to $LOCALAPPDATA on Windows. -; datadir=~/.btcd/data +; datadir=~/.lbcd/data ; ------------------------------------------------------------------------------ @@ -52,7 +52,7 @@ ; upnp=1 ; Specify the external IP addresses your node is listening on. One address per -; line. btcd will not contact 3rd-party sites to obtain external ip addresses. +; line. lbcd will not contact 3rd-party sites to obtain external ip addresses. ; This means if you are behind NAT, your node will not be able to advertise a ; reachable address unless you specify it here or enable the 'upnp' option (and ; have a supported device). @@ -64,7 +64,7 @@ ; ; Only one of the following two options, 'addpeer' and 'connect', may be ; specified. Both allow you to specify peers that you want to stay connected -; with, but the behavior is slightly different. By default, btcd will query DNS +; with, but the behavior is slightly different. By default, lbcd will query DNS ; to find peers to connect to, so unless you have a specific reason such as ; those described below, you probably won't need to modify anything here. ; @@ -86,9 +86,9 @@ ; You may specify each IP address with or without a port. The default port will ; be added automatically if one is not specified here. ; addpeer=192.168.1.1 -; addpeer=10.0.0.2:8333 +; addpeer=10.0.0.2:9246 ; addpeer=fe80::1 -; addpeer=[fe80::2]:8333 +; addpeer=[fe80::2]:9246 ; Add persistent peers that you ONLY want to connect to as desired. One peer ; per line. You may specify each IP address with or without a port. The @@ -96,9 +96,9 @@ ; NOTE: Specifying this option has other side effects as described above in ; the 'addpeer' versus 'connect' summary section. ; connect=192.168.1.1 -; connect=10.0.0.2:8333 +; connect=10.0.0.2:9246 ; connect=fe80::1 -; connect=[fe80::2]:8333 +; connect=[fe80::2]:9246 ; Maximum number of inbound and outbound peers. ; maxpeers=125 @@ -121,7 +121,7 @@ ; whitelist=192.168.0.0/24 ; whitelist=fd00::/16 -; Disable DNS seeding for peers. By default, when btcd starts, it will use +; Disable DNS seeding for peers. By default, when lbcd starts, it will use ; DNS to query for available peers to connect with. ; nodnsseed=1 @@ -135,16 +135,16 @@ ; listen=0.0.0.0 ; All ipv6 interfaces on default port: ; listen=:: -; All interfaces on port 8333: -; listen=:8333 -; All ipv4 interfaces on port 8333: -; listen=0.0.0.0:8333 -; All ipv6 interfaces on port 8333: -; listen=[::]:8333 -; Only ipv4 localhost on port 8333: -; listen=127.0.0.1:8333 -; Only ipv6 localhost on port 8333: -; listen=[::1]:8333 +; All interfaces on port 9246: +; listen=:9246 +; All ipv4 interfaces on port 9246: +; listen=0.0.0.0:9246 +; All ipv6 interfaces on port 9246: +; listen=[::]:9246 +; Only ipv4 localhost on port 9246: +; listen=127.0.0.1:9246 +; Only ipv6 localhost on port 9246: +; listen=[::1]:9246 ; Only ipv4 localhost on non-standard port 8336: ; listen=127.0.0.1:8336 ; All interfaces on non-standard port 8336: @@ -172,7 +172,7 @@ ; ------------------------------------------------------------------------------ ; RPC server options - The following options control the built-in RPC server -; which is used to control and query information from a running btcd process. +; which is used to control and query information from a running lbcd process. ; ; NOTE: The RPC server is disabled by default if rpcuser AND rpcpass, or ; rpclimituser AND rpclimitpass, are not specified. @@ -335,7 +335,7 @@ ; Debug logging level. ; Valid levels are {trace, debug, info, warn, error, critical} ; You may also specify =,=,... to set -; log level for individual subsystems. Use btcd --debuglevel=show to list +; log level for individual subsystems. Use lbcd --debuglevel=show to list ; available subsystems. ; debuglevel=info diff --git a/txscript/README.md b/txscript/README.md index f0abb518..e0b8fdd6 100644 --- a/txscript/README.md +++ b/txscript/README.md @@ -1,67 +1,15 @@ txscript ======== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) -[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://pkg.go.dev/github.com/btcsuite/btcd/txscript?status.png)](https://pkg.go.dev/github.com/btcsuite/btcd/txscript) - Package txscript implements the bitcoin transaction script language. There is a comprehensive test suite. -This package has intentionally been designed so it can be used as a standalone -package for any projects needing to use or validate bitcoin transaction scripts. +This package has been augmented to include support for LBRY's custom claim operations. +See https://lbry.tech/spec ## Bitcoin Scripts Bitcoin provides a stack-based, FORTH-like language for the scripts in the bitcoin transactions. This language is not turing complete although it is still fairly powerful. A description of the language -can be found at https://en.bitcoin.it/wiki/Script - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/txscript -``` - -## Examples - -* [Standard Pay-to-pubkey-hash Script](https://pkg.go.dev/github.com/btcsuite/btcd/txscript#example-PayToAddrScript) - Demonstrates creating a script which pays to a bitcoin address. It also - prints the created script hex and uses the DisasmString function to display - the disassembled script. - -* [Extracting Details from Standard Scripts](https://pkg.go.dev/github.com/btcsuite/btcd/txscript#example-ExtractPkScriptAddrs) - Demonstrates extracting information from a standard public key script. - -* [Manually Signing a Transaction Output](https://pkg.go.dev/github.com/btcsuite/btcd/txscript#example-SignTxOutput) - Demonstrates manually creating and signing a redeem transaction. - -* [Counting Opcodes in Scripts](http://godoc.org/github.com/decred/dcrd/txscript#example-ScriptTokenizer) - Demonstrates creating a script tokenizer instance and using it to count the - number of opcodes a script contains. - -## GPG Verification Key - -All official release tags are signed by Conformal so users can ensure the code -has not been tampered with and is coming from the btcsuite developers. To -verify the signature perform the following: - -- Download the public key from the Conformal website at - https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt - -- Import the public key into your GPG keyring: - ```bash - gpg --import GIT-GPG-KEY-conformal.txt - ``` - -- Verify the release tag with the following command where `TAG_NAME` is a - placeholder for the specific tag: - ```bash - git tag -v TAG_NAME - ``` - -## License - -Package txscript is licensed under the [copyfree](http://copyfree.org) ISC -License. +can be found at https://en.bitcoin.it/wiki/Script \ No newline at end of file diff --git a/wire/README.md b/wire/README.md index 8660bbfd..c14a3640 100644 --- a/wire/README.md +++ b/wire/README.md @@ -1,26 +1,14 @@ wire ==== -[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) -[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/wire) -======= - Package wire implements the bitcoin wire protocol. A comprehensive suite of tests with 100% test coverage is provided to ensure proper functionality. There is an associated blog post about the release of this package [here](https://blog.conformal.com/btcwire-the-bitcoin-wire-protocol-package-from-btcd/). -This package has intentionally been designed so it can be used as a standalone -package for any projects needing to interface with bitcoin peers at the wire -protocol level. - -## Installation and Updating - -```bash -$ go get -u github.com/btcsuite/btcd/wire -``` +This package has been augmented from the original btcd implementation. +The block header was modified to contain the claimtrie hash. ## Bitcoin Message Overview @@ -85,29 +73,4 @@ from a remote peer is: if err != nil { // Log and handle the error } -``` - -## GPG Verification Key - -All official release tags are signed by Conformal so users can ensure the code -has not been tampered with and is coming from the btcsuite developers. To -verify the signature perform the following: - -- Download the public key from the Conformal website at - https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt - -- Import the public key into your GPG keyring: - ```bash - gpg --import GIT-GPG-KEY-conformal.txt - ``` - -- Verify the release tag with the following command where `TAG_NAME` is a - placeholder for the specific tag: - ```bash - git tag -v TAG_NAME - ``` - -## License - -Package wire is licensed under the [copyfree](http://copyfree.org) ISC -License. +``` \ No newline at end of file