github.com/lbryio/lbcd@v0.22.119/docs/json_rpc_api.md (about)

     1  # JSON RPC API
     2  
     3  1. [Overview](#Overview)<br />
     4  2. [HTTP POST Versus Websockets](#HttpPostVsWebsockets)<br />
     5  3. [Authentication](#Authentication)<br />
     6  3.1.  [Overview](#AuthenticationOverview)<br />
     7  3.2.  [HTTP Basic Access Authentication](#HTTPAuth)<br />
     8  3.3.  [JSON-RPC Authenticate Command (Websocket-specific)](#JSONAuth)<br />
     9  4. [Command-line Utility](#CLIUtil)<br />
    10  5. [Standard Methods](#Methods)<br />
    11  5.1. [Method Overview](#MethodOverview)<br />
    12  5.2. [Method Details](#MethodDetails)<br />
    13  6. [Extension Methods](#ExtensionMethods)<br />
    14  6.1. [Method Overview](#ExtMethodOverview)<br />
    15  6.2. [Method Details](#ExtMethodDetails)<br />
    16  7. [Websocket Extension Methods (Websocket-specific)](#WSExtMethods)<br />
    17  7.1. [Method Overview](#WSExtMethodOverview)<br />
    18  7.2. [Method Details](#WSExtMethodDetails)<br />
    19  8. [Notifications (Websocket-specific)](#Notifications)<br />
    20  8.1. [Notification Overview](#NotificationOverview)<br />
    21  8.2. [Notification Details](#NotificationDetails)<br />
    22  9. [Example Code](#ExampleCode)<br />
    23  9.1. [Go](#ExampleGoApp)<br />
    24  9.2. [node.js](#ExampleNodeJsCode)<br />
    25  
    26  <a name="Overview" />
    27  
    28  ### 1. Overview
    29  
    30  lbcd provides a [JSON-RPC](http://json-rpc.org/wiki/specification) API that is
    31  fully compatible with the original bitcoind/bitcoin-qt.  There are a few key
    32  differences between lbcd and bitcoind as far as how RPCs are serviced:
    33  * lbcd is secure by default which means that the RPC connection is TLS-enabled
    34    by default
    35  * lbcd provides access to the API through both
    36    [HTTP POST](http://en.wikipedia.org/wiki/POST_%28HTTP%29) requests and
    37    [Websockets](http://en.wikipedia.org/wiki/WebSocket)
    38  
    39  Websockets are the preferred transport for lbcd RPC and are used by applications
    40  such as [btcwallet](https://github.com/btcsuite/btcwallet) for inter-process
    41  communication with lbcd.  The websocket connection endpoint for lbcd is
    42  `wss://your_ip_or_domain:9245/ws`.
    43  
    44  In addition to the [standard API](#Methods), an [extension API](#WSExtMethods)
    45  has been developed that is exclusive to clients using Websockets. In its current
    46  state, this API attempts to cover features found missing in the standard API
    47  during the development of btcwallet.
    48  
    49  While the [standard API](#Methods) is stable, the
    50  [Websocket extension API](#WSExtMethods) should be considered a work in
    51  progress, incomplete, and susceptible to changes (both additions and removals).
    52  
    53  The original bitcoind/bitcoin-qt JSON-RPC API documentation is available at [https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list)
    54  
    55  <a name="HttpPostVsWebsockets" />
    56  
    57  ### 2. HTTP POST Versus Websockets
    58  
    59  The lbcd RPC server supports both [HTTP POST](http://en.wikipedia.org/wiki/POST_%28HTTP%29)
    60  requests and the preferred [Websockets](http://en.wikipedia.org/wiki/WebSocket).
    61  All of the [standard](#Methods) and [extension](#ExtensionMethods) methods
    62  described in this documentation can be accessed through both.  As the name
    63  indicates, the [Websocket-specific extension](#WSExtMethods) methods can only be
    64  accessed when connected via Websockets.
    65  
    66  As mentioned in the [overview](#Overview), the websocket connection endpoint for
    67  lbcd is `wss://your_ip_or_domain:9245/ws`.
    68  
    69  The most important differences between the two transports as it pertains to the
    70  JSON-RPC API are:
    71  
    72  |                                                     | HTTP POST Requests | Websockets |
    73  | --------------------------------------------------- | ------------------ | ---------- |
    74  | Allows multiple requests across a single connection | No                 | Yes        |
    75  | Supports asynchronous notifications                 | No                 | Yes        |
    76  | Scales well with large numbers of requests          | No                 | Yes        |
    77  
    78  <a name="Authentication" />
    79  
    80  ### 3. Authentication
    81  
    82  <a name="AuthenticationOverview" />
    83  
    84  **3.1 Authentication Overview**<br />
    85  
    86  The following authentication details are needed before establishing a connection
    87  to a lbcd RPC server:
    88  
    89  * **rpcuser** is the full-access username configured for the lbcd RPC server
    90  * **rpcpass** is the full-access password configured for the lbcd RPC server
    91  * **rpclimituser** is the limited username configured for the lbcd RPC server
    92  * **rpclimitpass** is the limited password configured for the lbcd RPC server
    93  * **rpccert** is the PEM-encoded X.509 certificate (public key) that the lbcd
    94    server is configured with.  It is automatically generated by lbcd and placed
    95    in the lbcd home directory (which is typically `%LOCALAPPDATA%\lbcd` on
    96    Windows and `~/.lbcd` on POSIX-like OSes)
    97  
    98  **NOTE:** As mentioned above, lbcd is secure by default which means the RPC
    99  server is not running unless configured with a **rpcuser** and **rpcpass**
   100  and/or a **rpclimituser** and **rpclimitpass**, and uses TLS authentication for
   101  all connections.
   102  
   103  Depending on which connection transaction you are using, you can choose one of
   104  two, mutually exclusive, methods.
   105  - [Use HTTP Authorization Header](#HTTPAuth) - HTTP POST requests and Websockets
   106  - [Use the JSON-RPC "authenticate" command](#JSONAuth) - Websockets only
   107  
   108  <a name="HTTPAuth" />
   109  
   110  **3.2 HTTP Basic Access Authentication**<br />
   111  
   112  The lbcd RPC server uses HTTP [basic access authentication](http://en.wikipedia.org/wiki/Basic_access_authentication) with the **rpcuser**
   113  and **rpcpass** detailed above.  If the supplied credentials are invalid, you
   114  will be disconnected immediately upon making the connection.
   115  
   116  <a name="JSONAuth" />
   117  
   118  **3.3 JSON-RPC Authenticate Command (Websocket-specific)**<br />
   119  
   120  While the HTTP basic access authentication method is the preferred method, the
   121  ability to set HTTP headers from websockets is not always available.  In that
   122  case, you will need to use the [authenticate](#authenticate) JSON-RPC method.
   123  
   124  The [authenticate](#authenticate) command must be the first command sent after
   125  connecting to the websocket.  Sending any other commands before authenticating,
   126  supplying invalid credentials, or attempting to authenticate again when already
   127  authenticated will cause the websocket to be closed immediately.
   128  
   129  
   130  <a name="CLIUtil" />
   131  
   132  ### 4. Command-line Utility
   133  
   134  lbcd comes with a separate utility named `lbcctl` which can be used to issue
   135  these RPC commands via HTTP POST requests to lbcd after configuring it with the
   136  information in the [Authentication](#Authentication) section above.  It can also
   137  be used to communicate with any server/daemon/service which provides a JSON-RPC
   138  API compatible with the original bitcoind/bitcoin-qt client.
   139  
   140  <a name="Methods" />
   141  
   142  ### 5. Standard Methods
   143  
   144  <a name="MethodOverview" />
   145  
   146  **5.1 Method Overview**<br />
   147  
   148  The following is an overview of the RPC methods and their current status.  Click
   149  the method name for further details such as parameter and return information.
   150  
   151  | #   | Method                                        | Safe for limited user? | Description                                                                                                                                                                                                                                                                        |
   152  | --- | --------------------------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   153  | 1   | [addnode](#addnode)                           | N                      | Attempts to add or remove a persistent peer.                                                                                                                                                                                                                                       |
   154  | 2   | [createrawtransaction](#createrawtransaction) | Y                      | Returns a new transaction spending the provided inputs and sending to the provided addresses.                                                                                                                                                                                      |
   155  | 3   | [decoderawtransaction](#decoderawtransaction) | Y                      | Returns a JSON object representing the provided serialized, hex-encoded transaction.                                                                                                                                                                                               |
   156  | 4   | [decodescript](#decodescript)                 | Y                      | Returns a JSON object with information about the provided hex-encoded script.                                                                                                                                                                                                      |
   157  | 5   | [getaddednodeinfo](#getaddednodeinfo)         | N                      | Returns information about manually added (persistent) peers.                                                                                                                                                                                                                       |
   158  | 6   | [getbestblockhash](#getbestblockhash)         | Y                      | Returns the hash of the of the best (most recent) block in the longest block chain.                                                                                                                                                                                                |
   159  | 7   | [getblock](#getblock)                         | Y                      | Returns information about a block given its hash.                                                                                                                                                                                                                                  |
   160  | 8   | [getblockcount](#getblockcount)               | Y                      | Returns the number of blocks in the longest block chain.                                                                                                                                                                                                                           |
   161  | 9   | [getblockhash](#getblockhash)                 | Y                      | Returns hash of the block in best block chain at the given height.                                                                                                                                                                                                                 |
   162  | 10  | [getblockheader](#getblockheader)             | Y                      | Returns the block header of the block.                                                                                                                                                                                                                                             |
   163  | 11  | [getconnectioncount](#getconnectioncount)     | N                      | Returns the number of active connections to other peers.                                                                                                                                                                                                                           |
   164  | 12  | [getdifficulty](#getdifficulty)               | Y                      | Returns the proof-of-work difficulty as a multiple of the minimum difficulty.                                                                                                                                                                                                      |
   165  | 13  | [getgenerate](#getgenerate)                   | N                      | Return if the server is set to generate coins (mine) or not.                                                                                                                                                                                                                       |
   166  | 14  | [gethashespersec](#gethashespersec)           | N                      | Returns a recent hashes per second performance measurement while generating coins (mining).                                                                                                                                                                                        |
   167  | 15  | [getinfo](#getinfo)                           | Y                      | Returns a JSON object containing various state info.                                                                                                                                                                                                                               |
   168  | 16  | [getmempoolinfo](#getmempoolinfo)             | N                      | Returns a JSON object containing mempool-related information.                                                                                                                                                                                                                      |
   169  | 17  | [getmininginfo](#getmininginfo)               | N                      | Returns a JSON object containing mining-related information.                                                                                                                                                                                                                       |
   170  | 18  | [getnettotals](#getnettotals)                 | Y                      | Returns a JSON object containing network traffic statistics.                                                                                                                                                                                                                       |
   171  | 19  | [getnetworkhashps](#getnetworkhashps)         | Y                      | Returns the estimated network hashes per second for the block heights provided by the parameters.                                                                                                                                                                                  |
   172  | 20  | [getpeerinfo](#getpeerinfo)                   | N                      | Returns information about each connected network peer as an array of json objects.                                                                                                                                                                                                 |
   173  | 21  | [getrawmempool](#getrawmempool)               | Y                      | Returns an array of hashes for all of the transactions currently in the memory pool.                                                                                                                                                                                               |
   174  | 22  | [getrawtransaction](#getrawtransaction)       | Y                      | Returns information about a transaction given its hash.                                                                                                                                                                                                                            |
   175  | 23  | [help](#help)                                 | Y                      | Returns a list of all commands or help for a specified command.                                                                                                                                                                                                                    |
   176  | 24  | [ping](#ping)                                 | N                      | Queues a ping to be sent to each connected peer.                                                                                                                                                                                                                                   |
   177  | 25  | [sendrawtransaction](#sendrawtransaction)     | Y                      | Submits the serialized, hex-encoded transaction to the local peer and relays it to the network.<br /><font color="orange">lbcd does not yet implement the `allowhighfees` parameter, so it has no effect</font>                                                                    |
   178  | 26  | [setgenerate](#setgenerate)                   | N                      | Set the server to generate coins (mine) or not.<br/>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. |
   179  | 27  | [stop](#stop)                                 | N                      | Shutdown lbcd.                                                                                                                                                                                                                                                                     |
   180  | 28  | [submitblock](#submitblock)                   | Y                      | Attempts to submit a new serialized, hex-encoded block to the network.                                                                                                                                                                                                             |
   181  | 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.                                                                                                                               |
   182  | 30  | [verifychain](#verifychain)                   | N                      | Verifies the block chain database.                                                                                                                                                                                                                                                 |
   183  
   184  <a name="MethodDetails" />
   185  
   186  **5.2 Method Details**<br />
   187  
   188  <a name="addnode"/>
   189  
   190  |             |                                                                                                                                                                                                                                        |
   191  | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   192  | Method      | addnode                                                                                                                                                                                                                                |
   193  | Parameters  | 1. peer (string, required) - ip address and port of the peer to operate on<br />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 |
   194  | Description | Attempts to add or remove a persistent peer.                                                                                                                                                                                           |
   195  | Returns     | Nothing                                                                                                                                                                                                                                |
   196  [Return to Overview](#MethodOverview)<br />
   197  
   198  ***
   199  <a name="createrawtransaction"/>
   200  
   201  |                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   202  | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   203  | Method             | createrawtransaction                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   204  | Parameters         | 1. transaction inputs (JSON array, required) - json array of json objects<br />`[`<br />&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"txid": "hash", (string, required) the hash of the input transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"vout": n  (numeric, required) the specific output of the input transaction to redeem`<br />&nbsp;&nbsp;`}, ...`<br />`]`<br />2. addresses and amounts (JSON object, required) - json object with addresses as keys and amounts as values<br />`{`<br />&nbsp;&nbsp;`"address": n.nnn (numeric, required) the address to send to as the key and the amount in BTC as the value`<br />&nbsp;&nbsp;`, ...`<br />`}`<br />3. locktime (int64, optional, default=0) - specifies the transaction locktime.  If non-zero, the inputs will also have their locktimes activated. |
   205  | Description        | Returns a new transaction spending the provided inputs and sending to the provided addresses.<br />The transaction inputs are not signed in the created transaction.<br />The `signrawtransaction` RPC command provided by wallet must be used to sign the resulting transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
   206  | Returns            | `"transaction" (string) hex-encoded bytes of the serialized transaction`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
   207  | Example Parameters | 1. transaction inputs `[{"txid":"e6da89de7a6b8508ce8f371a3d0535b04b5e108cb1a6e9284602d3bfd357c018","vout":1}]`<br />2. addresses and amounts `{"13cgrTP7wgbZYWrY9BZ22BV6p82QXQT3nY": 0.49213337}`<br />3. locktime `0`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   208  | Example Return     | `010000000118c057d3bfd3024628e9a6b18c105e4bb035053d1a378fce08856b7ade89dae6010000`<br />`0000ffffffff0199efee02000000001976a9141cb013db35ecccc156fdfd81d03a11c51998f99388`<br />`ac00000000`<br /><font color="orange">**Newlines added for display purposes.  The actual return does not contain newlines.**</font>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   209  [Return to Overview](#MethodOverview)<br />
   210  
   211  ***
   212  <a name="decoderawtransaction"/>
   213  
   214  |                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   215  | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   216  | Method         | decoderawtransaction                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   217  | Parameters     | 1. data (string, required) - serialized, hex-encoded transaction                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
   218  | Description    | Returns a JSON object representing the provided serialized, hex-encoded transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   219  | Returns        | `{ (json object)`<br />&nbsp;&nbsp;`"txid": "hash",  (string) the hash of the transaction`<br />&nbsp;&nbsp;`"version": n,  (numeric) the transaction version`<br />&nbsp;&nbsp;`"locktime": n,  (numeric) the transaction lock time`<br />&nbsp;&nbsp;`"vin": [  (array of json objects) the transaction inputs as json objects`<br />&nbsp;&nbsp;<font color="orange">For coinbase transactions:</font><br />&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"coinbase": "data",  (string) the hex-encoded bytes of the signature script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"sequence": n,  (numeric) the script sequence number`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;<font color="orange">For non-coinbase transactions:</font><br />&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"txid": "hash", (string) the hash of the origin transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"vout": n, (numeric) the index of the output being redeemed from the origin transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"scriptSig": { (json object) the signature script used to redeem the origin transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"asm": "asm", (string) disassembly of the script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "data",  (string) hex-encoded bytes of the script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"sequence": n,  (numeric) the script sequence number`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}, ...`<br />&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`"vout": [  (array of json objects) the transaction outputs as json objects`<br />&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"value": n, (numeric) the value in BTC`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"n": n, (numeric) the index of this transaction output`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"scriptPubKey": { (json object) the public key script used to pay coins`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"asm": "asm",  (string) disassembly of the script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "data", (string) hex-encoded bytes of the script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"reqSigs": n,  (numeric) the number of required signatures`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"addresses": [ (json array of string) the bitcoin addresses associated with this output`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"bitcoinaddress",  (string) the bitcoin address`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`...`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}, ...`<br />&nbsp;&nbsp;`]`<br />`}` |
   220  | Example Return | `{`<br />&nbsp;&nbsp;`"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",`<br />&nbsp;&nbsp;`"version": 1,`<br />&nbsp;&nbsp;`"locktime": 0,`<br />&nbsp;&nbsp;`"vin": [`<br />&nbsp;&nbsp;<font color="orange">For coinbase transactions:</font><br />&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"coinbase": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6...",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"sequence": 4294967295,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;<font color="orange">For non-coinbase transactions:</font><br />&nbsp;&nbsp;&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"vout": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"scriptSig": {`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"sequence": 4294967295,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`"vout": [`<br />&nbsp;&nbsp;&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"value": 50,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"n": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"scriptPubKey": {`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"asm": "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4ce...",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4...",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"reqSigs": 1,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"type": "pubkey"`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"addresses": [`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;`]`<br />`}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   221  [Return to Overview](#MethodOverview)<br />
   222  
   223  ***
   224  <a name="decodescript"/>
   225  
   226  |                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   227  | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   228  | Method         | decodescript                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   229  | Parameters     | 1. script (string, required) - hex-encoded script                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   230  | Description    | Returns a JSON object with information about the provided hex-encoded script.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
   231  | Returns        | `{ (json object)`<br />&nbsp;&nbsp;`"asm": "asm",  (string) disassembly of the script`<br />&nbsp;&nbsp;`"reqSigs": n,  (numeric) the number of required signatures`<br />&nbsp;&nbsp;`"type": "scripttype",  (string) the type of the script (e.g. 'pubkeyhash')`<br />&nbsp;&nbsp;`"addresses": [ (json array of string) the bitcoin addresses associated with this script`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"bitcoinaddress",  (string) the bitcoin address`<br />&nbsp;&nbsp;&nbsp;&nbsp;`...`<br />&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`"p2sh": "scripthash",  (string) the script hash for use in pay-to-script-hash transactions`<br />`}` |
   232  | Example Return | `{`<br />&nbsp;&nbsp;`"asm": "OP_DUP OP_HASH160 b0a4d8a91981106e4ed85165a66748b19f7b7ad4 OP_EQUALVERIFY OP_CHECKSIG",`<br />&nbsp;&nbsp;`"reqSigs": 1,`<br />&nbsp;&nbsp;`"type": "pubkeyhash",`<br />&nbsp;&nbsp;`"addresses": [`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"1H71QVBpzuLTNUh5pewaH3UTLTo2vWgcRJ"`<br />&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`"p2sh": "359b84ff799f48231990ff0298206f54117b08b6"`<br />`}`                                                                                                                                                                                                                                  |
   233  [Return to Overview](#MethodOverview)<br />
   234  
   235  ***
   236  <a name="getaddednodeinfo"/>
   237  
   238  |                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   239  | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   240  | Method                     | getaddednodeinfo                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   241  | 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<br />2. node (string, optional) - only return information about this specific peer instead of all added peers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
   242  | Description                | Returns information about manually added (persistent) peers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   243  | Returns (dns=false)        | `["ip:port", ...]`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   244  | Returns (dns=true)         | `[ (json array of objects)`<br />&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"addednode": "ip_or_domain",  (string) the ip address or domain of the added peer`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"connected": true or false,  (boolean) whether or not the peer is currently connected`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"addresses": [  (json array or objects) DNS lookup and connection information about the peer`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"address": "ip",  (string) the ip address for this DNS entry`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"connected": "inbound/outbound/false"  (string) the connection 'direction' (if connected)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}, ...`<br />&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`}, ...`<br />`]` |
   245  | Example Return (dns=false) | `["192.168.0.10:9246", "mydomain.org:9246"]`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   246  | Example Return (dns=true)  | `[`<br />&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"addednode": "mydomain.org:9246",`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"connected": true,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"addresses": [`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"address": "1.2.3.4",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"connected": "outbound"`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`},`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"address": "5.6.7.8",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"connected": "false"`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`}`<br />`]`                                                                                                                     |
   247  [Return to Overview](#MethodOverview)<br />
   248  
   249  ***
   250  <a name="getbestblockhash"/>
   251  
   252  |                |                                                                                     |
   253  | -------------- | ----------------------------------------------------------------------------------- |
   254  | Method         | getbestblockhash                                                                    |
   255  | Parameters     | None                                                                                |
   256  | Description    | Returns the hash of the of the best (most recent) block in the longest block chain. |
   257  | Returns        | string                                                                              |
   258  | Example Return | `0000000000000001f356adc6b29ab42b59f913a396e170f80190dba615bd1e60`                  |
   259  [Return to Overview](#MethodOverview)<br />
   260  
   261  ***
   262  <a name="getblock"/>
   263  
   264  |                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   265  | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   266  | Method                       | getblock                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
   267  | Parameters                   | 1. block hash (string, required) - the hash of the block<br />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).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   268  | Description                  | Returns information about a block given its hash.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   269  | Returns (verbosity=0)        | `"data" (string) hex-encoded bytes of the serialized block`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   270  | Returns (verbosity=1)        | `{ (json object)`<br />&nbsp;&nbsp;`"hash": "blockhash",  (string) the hash of the block (same as provided)`<br />&nbsp;&nbsp;`"confirmations": n,  (numeric) the number of confirmations`<br />&nbsp;&nbsp;`"strippedsize", n (numeric) the size of the block without witness data`<br />&nbsp;&nbsp;`"size": n,  (numeric) the size of the block`<br />&nbsp;&nbsp;`"weight": n, (numeric) value of the weight metric`<br />&nbsp;&nbsp;`"height": n,  (numeric) the height of the block in the block chain`<br />&nbsp;&nbsp;`"version": n,  (numeric) the block version`<br />&nbsp;&nbsp;`"merkleroot": "hash",  (string) root hash of the merkle tree`<br />&nbsp;&nbsp;`"tx": [ (json array of string) the transaction hashes`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"transactionhash",  (string) hash of the parent transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;`...`<br />&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`"time": n,  (numeric) the block time in seconds since 1 Jan 1970 GMT`<br />&nbsp;&nbsp;`"nonce": n,  (numeric) the block nonce`<br />&nbsp;&nbsp;`"bits", n,  (numeric) the bits which represent the block difficulty`<br />&nbsp;&nbsp;`difficulty: n.nn,  (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`<br />&nbsp;&nbsp;`"previousblockhash": "hash",  (string) the hash of the previous block`<br />&nbsp;&nbsp;`"nextblockhash": "hash",  (string) the hash of the next block (only if there is one)`<br />`}` |
   271  | Returns (verbosity=2)        | `{ (json object)`<br />&nbsp;&nbsp;`"hash": "blockhash",  (string) the hash of the block (same as provided)`<br />&nbsp;&nbsp;`"confirmations": n,  (numeric) the number of confirmations`<br />&nbsp;&nbsp;`"strippedsize", n (numeric) the size of the block without witness data`<br />&nbsp;&nbsp;`"size": n,  (numeric) the size of the block`<br />&nbsp;&nbsp;`"weight": n, (numeric) value of the weight metric`<br />&nbsp;&nbsp;`"height": n,  (numeric) the height of the block in the block chain`<br />&nbsp;&nbsp;`"version": n,  (numeric) the block version`<br />&nbsp;&nbsp;`"merkleroot": "hash",  (string) root hash of the merkle tree`<br />&nbsp;&nbsp;`"rawtx": [ (array of json objects) the transactions as json objects`<br />&nbsp;&nbsp;&nbsp;&nbsp;`(see getrawtransaction json object details)`<br />&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`"time": n,  (numeric) the block time in seconds since 1 Jan 1970 GMT`<br />&nbsp;&nbsp;`"nonce": n,  (numeric) the block nonce`<br />&nbsp;&nbsp;`"bits", n,  (numeric) the bits which represent the block difficulty`<br />&nbsp;&nbsp;`difficulty: n.nn,  (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`<br />&nbsp;&nbsp;`"previousblockhash": "hash",  (string) the hash of the previous block`<br />&nbsp;&nbsp;`"nextblockhash": "hash",  (string) the hash of the next block`<br />`}`                                                             |
   272  | Example Return (verbosity=0) | `"010000000000000000000000000000000000000000000000000000000000000000000000`<br />`3ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49`<br />`ffff001d1dac2b7c01010000000100000000000000000000000000000000000000000000`<br />`00000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f`<br />`4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f`<br />`6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104`<br />`678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f`<br />`4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"`<br /><font color="orange">**Newlines added for display purposes.  The actual return does not contain newlines.**</font>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
   273  | Example Return (verbosity=1) | `{`<br />&nbsp;&nbsp;`"hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",`<br />&nbsp;&nbsp;`"confirmations": 277113,`<br />&nbsp;&nbsp;`"size": 285,`<br />&nbsp;&nbsp;`"height": 0,`<br />&nbsp;&nbsp;`"version": 1,`<br />&nbsp;&nbsp;`"merkleroot": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",`<br />&nbsp;&nbsp;`"tx": [`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"`<br />&nbsp;&nbsp;`],`<br />&nbsp;&nbsp;`"time": 1231006505,`<br />&nbsp;&nbsp;`"nonce": 2083236893,`<br />&nbsp;&nbsp;`"bits": "1d00ffff",`<br />&nbsp;&nbsp;`"difficulty": 1,`<br />&nbsp;&nbsp;`"previousblockhash": "0000000000000000000000000000000000000000000000000000000000000000",`<br />&nbsp;&nbsp;`"nextblockhash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048"`<br />`}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
   274  [Return to Overview](#MethodOverview)<br />
   275  
   276  ***
   277  <a name="getblockcount"/>
   278  
   279  |                |                                                          |
   280  | -------------- | -------------------------------------------------------- |
   281  | Method         | getblockcount                                            |
   282  | Parameters     | None                                                     |
   283  | Description    | Returns the number of blocks in the longest block chain. |
   284  | Returns        | numeric                                                  |
   285  | Example Return | `276820`                                                 |
   286  [Return to Overview](#MethodOverview)<br />
   287  
   288  ***
   289  <a name="getblockhash"/>
   290  
   291  |                |                                                                    |
   292  | -------------- | ------------------------------------------------------------------ |
   293  | Method         | getblockhash                                                       |
   294  | Parameters     | 1. block height (numeric, required)                                |
   295  | Description    | Returns hash of the block in best block chain at the given height. |
   296  | Returns        | string                                                             |
   297  | Example Return | `000000000000000096579458d1c0f1531fcfc58d57b4fce51eb177d8d10e784d` |
   298  [Return to Overview](#MethodOverview)<br />
   299  
   300  ***
   301  <a name="getblockheader"/>
   302  
   303  |                                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   304  | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   305  | Method                         | getblockheader                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
   306  | Parameters                     | 1. block hash (string, required) - the hash of the block<br />2. verbose (boolean, optional, default=true) - specifies the block header is returned as a JSON object instead of a hex-encoded string                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
   307  | Description                    | Returns hex-encoded bytes of the serialized block header.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   308  | Returns (verbose=false)        | `"data" (string) hex-encoded bytes of the serialized block`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
   309  | Returns (verbose=true)         | `{ (json object)`<br />&nbsp;&nbsp;`"hash": "blockhash", (string) the hash of the block (same as provided)`<br />&nbsp;&nbsp;`"confirmations": n,  (numeric) the number of confirmations`<br />&nbsp;&nbsp;`"height": n, (numeric) the height of the block in the block chain`<br />&nbsp;&nbsp;`"version": n,  (numeric) the block version`<br />&nbsp;&nbsp;`"merkleroot": "hash",  (string) root hash of the merkle tree`<br />&nbsp;&nbsp;`"time": n,  (numeric) the block time in seconds since 1 Jan 1970 GMT`<br />&nbsp;&nbsp;`"nonce": n,  (numeric) the block nonce`<br />&nbsp;&nbsp;`"bits": n,  (numeric) the bits which represent the block difficulty`<br />&nbsp;&nbsp;`"difficulty": n.nn,  (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`<br />&nbsp;&nbsp;`"previousblockhash": "hash",  (string) the hash of the previous block`<br />&nbsp;&nbsp;`"nextblockhash": "hash",  (string) the hash of the next block (only if there is one)`<br />`}` |
   310  | Example Return (verbose=false) | `"0200000035ab154183570282ce9afc0b494c9fc6a3cfea05aa8c1add2ecc564900000000`<br />`38ba3d78e4500a5a7570dbe61960398add4410d278b21cd9708e6d9743f374d544fc0552`<br />`27f1001c29c1ea3b"`<br /><font color="orange">**Newlines added for display purposes.  The actual return does not contain newlines.**</font>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   311  | Example Return (verbose=true)  | `{`<br />&nbsp;&nbsp;`"hash": "00000000009e2958c15ff9290d571bf9459e93b19765c6801ddeccadbb160a1e",`<br />&nbsp;&nbsp;`"confirmations": 392076,`<br />&nbsp;&nbsp;`"height": 100000,`<br />&nbsp;&nbsp;`"version": 2,`<br />&nbsp;&nbsp;`"merkleroot": "d574f343976d8e70d91cb278d21044dd8a396019e6db70755a0a50e4783dba38",`<br />&nbsp;&nbsp;`"time": 1376123972,`<br />&nbsp;&nbsp;`"nonce": 1005240617,`<br />&nbsp;&nbsp;`"bits": "1c00f127",`<br />&nbsp;&nbsp;`"difficulty": 271.75767393,`<br />&nbsp;&nbsp;`"previousblockhash": "000000004956cc2edd1a8caa05eacfa3c69f4c490bfc9ace820257834115ab35",`<br />&nbsp;&nbsp;`"nextblockhash": "0000000000629d100db387f37d0f37c51118f250fb0946310a8c37316cbc4028"`<br />`}`                                                                                                                                                                                                                                                                             |
   312  [Return to Overview](#MethodOverview)<br />
   313  
   314  ***
   315  <a name="getconnectioncount"/>
   316  
   317  |                |                                                         |
   318  | -------------- | ------------------------------------------------------- |
   319  | Method         | getconnectioncount                                      |
   320  | Parameters     | None                                                    |
   321  | Description    | Returns the number of active connections to other peers |
   322  | Returns        | numeric                                                 |
   323  | Example Return | `8`                                                     |
   324  [Return to Overview](#MethodOverview)<br />
   325  
   326  ***
   327  <a name="getdifficulty"/>
   328  
   329  |                |                                                                               |
   330  | -------------- | ----------------------------------------------------------------------------- |
   331  | Method         | getdifficulty                                                                 |
   332  | Parameters     | None                                                                          |
   333  | Description    | Returns the proof-of-work difficulty as a multiple of the minimum difficulty. |
   334  | Returns        | numeric                                                                       |
   335  | Example Return | `1180923195.260000`                                                           |
   336  [Return to Overview](#MethodOverview)<br />
   337  
   338  ***
   339  <a name="getgenerate"/>
   340  
   341  |             |                                                              |
   342  | ----------- | ------------------------------------------------------------ |
   343  | Method      | getgenerate                                                  |
   344  | Parameters  | None                                                         |
   345  | Description | Return if the server is set to generate coins (mine) or not. |
   346  | Returns     | `false` (boolean)                                            |
   347  [Return to Overview](#MethodOverview)<br />
   348  
   349  ***
   350  <a name="gethashespersec"/>
   351  
   352  |             |                                                                                             |
   353  | ----------- | ------------------------------------------------------------------------------------------- |
   354  | Method      | gethashespersec                                                                             |
   355  | Parameters  | None                                                                                        |
   356  | Description | Returns a recent hashes per second performance measurement while generating coins (mining). |
   357  | Returns     | `0` (numeric)                                                                               |
   358  [Return to Overview](#MethodOverview)<br />
   359  
   360  ***
   361  <a name="getinfo"/>
   362  
   363  |                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
   364  | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   365  | Method         | getinfo                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
   366  | Parameters     | None                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   367  | Description    | Returns a JSON object containing various state info.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   368  | 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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
   369  | Returns        | `{ (json object)`<br />&nbsp;&nbsp;`"version": n,  (numeric) the version of the server`<br />&nbsp;&nbsp;`"protocolversion": n,  (numeric) the latest supported protocol version`<br />&nbsp;&nbsp;`"blocks": n,  (numeric) the number of blocks processed`<br />&nbsp;&nbsp;`"timeoffset": n,  (numeric) the time offset`<br />&nbsp;&nbsp;`"connections": n,  (numeric) the number of connected peers`<br />&nbsp;&nbsp;`"proxy": "host:port",  (string) the proxy used by the server`<br />&nbsp;&nbsp;`"difficulty": n.nn,  (numeric) the current target difficulty`<br />&nbsp;&nbsp;`"testnet": true or false,  (boolean) whether or not server is using testnet`<br />&nbsp;&nbsp;`"relayfee": n.nn,  (numeric) the minimum relay fee for non-free transactions in BTC/KB`<br />`}` |
   370  | Example Return | `{`<br />&nbsp;&nbsp;`"version": 70000`<br />&nbsp;&nbsp;`"protocolversion": 70001,  `<br />&nbsp;&nbsp;`"blocks": 298963,`<br />&nbsp;&nbsp;`"timeoffset": 0,`<br />&nbsp;&nbsp;`"connections": 17,`<br />&nbsp;&nbsp;`"proxy": "",`<br />&nbsp;&nbsp;`"difficulty": 8000872135.97,`<br />&nbsp;&nbsp;`"testnet": false,`<br />&nbsp;&nbsp;`"relayfee": 0.00001,`<br />`}`                                                                                                                                                                                                                                                                                                                                                                                                                |
   371  [Return to Overview](#MethodOverview)<br />
   372  
   373  ***
   374  <a name="getmempoolinfo"/>
   375  
   376  |                |                                                                                                                                                                                  |
   377  | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   378  | Method         | getmempoolinfo                                                                                                                                                                   |
   379  | Parameters     | None                                                                                                                                                                             |
   380  | Description    | Returns a JSON object containing mempool-related information.                                                                                                                    |
   381  | Returns        | `{ (json object)`<br />&nbsp;&nbsp;`"bytes": n,  (numeric) size in bytes of the mempool`<br />&nbsp;&nbsp;`"size": n,  (numeric) number of transactions in the mempool`<br />`}` |
   382  | Example Return | `{`<br />&nbsp;&nbsp;`"bytes": 310768,`<br />&nbsp;&nbsp;`"size": 157,`<br />`}`                                                                                                 |
   383  [Return to Overview](#MethodOverview)<br />
   384  
   385  ***
   386  <a name="getmininginfo"/>
   387  
   388  |                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   389  | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   390  | Method         | getmininginfo                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
   391  | Parameters     | None                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   392  | Description    | Returns a JSON object containing mining-related information.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   393  | Returns        | `{ (json object)`<br />&nbsp;&nbsp;`"blocks": n,  (numeric) latest best block`<br />&nbsp;&nbsp;`"currentblocksize": n,  (numeric) size of the latest best block`<br />&nbsp;&nbsp;`"currentblockweight": n,  (numeric) weight of the latest best block`<br />&nbsp;&nbsp;`"currentblocktx": n,  (numeric) number of transactions in the latest best block`<br />&nbsp;&nbsp;`"difficulty": n.nn,  (numeric) current target difficulty`<br />&nbsp;&nbsp;`"errors": "errors",  (string) any current errors`<br />&nbsp;&nbsp;`"generate": true or false,  (boolean) whether or not server is set to generate coins`<br />&nbsp;&nbsp;`"genproclimit": n,  (numeric) number of processors to use for coin generation (-1 when disabled)`<br />&nbsp;&nbsp;`"hashespersec": n,  (numeric) recent hashes per second performance measurement while generating coins`<br />&nbsp;&nbsp;`"networkhashps": n,  (numeric) estimated network hashes per second for the most recent blocks`<br />&nbsp;&nbsp;`"pooledtx": n,  (numeric) number of transactions in the memory pool`<br />&nbsp;&nbsp;`"testnet": true or false,  (boolean) whether or not server is using testnet`<br />`}` |
   394  | Example Return | `{`<br />&nbsp;&nbsp;`"blocks": 236526,`<br />&nbsp;&nbsp;`"currentblocksize": 185,`<br />&nbsp;&nbsp;`"currentblockweight": 740,`<br />&nbsp;&nbsp;`"currentblocktx": 1,`<br />&nbsp;&nbsp;`"difficulty": 256,`<br />&nbsp;&nbsp;`"errors": "",`<br />&nbsp;&nbsp;`"generate": false,`<br />&nbsp;&nbsp;`"genproclimit": -1,`<br />&nbsp;&nbsp;`"hashespersec": 0,`<br />&nbsp;&nbsp;`"networkhashps": 33081554756,`<br />&nbsp;&nbsp;`"pooledtx": 8,`<br />&nbsp;&nbsp;`"testnet": true,`<br />`}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   395  [Return to Overview](#MethodOverview)<br />
   396  
   397  ***
   398  <a name="getnettotals"/>
   399  
   400  |                |                                                                                                                                                                                                                                                    |
   401  | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   402  | Method         | getnettotals                                                                                                                                                                                                                                       |
   403  | Parameters     | None                                                                                                                                                                                                                                               |
   404  | Description    | Returns a JSON object containing network traffic statistics.                                                                                                                                                                                       |
   405  | Returns        | `{`<br />&nbsp;&nbsp;`"totalbytesrecv": n,  (numeric) total bytes received`<br />&nbsp;&nbsp;`"totalbytessent": n,  (numeric) total bytes sent`<br />&nbsp;&nbsp;`"timemillis": n  (numeric) number of milliseconds since 1 Jan 1970 GMT`<br />`}` |
   406  | Example Return | `{`<br />&nbsp;&nbsp;`"totalbytesrecv": 1150990,`<br />&nbsp;&nbsp;`"totalbytessent": 206739,`<br />&nbsp;&nbsp;`"timemillis": 1391626433845`<br />`}`                                                                                             |
   407  [Return to Overview](#MethodOverview)<br />
   408  
   409  ***
   410  <a name="getnetworkhashps"/>
   411  
   412  |                |                                                                                                                                                                                                                                                      |
   413  | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   414  | Method         | getnetworkhashps                                                                                                                                                                                                                                     |
   415  | Parameters     | 1. blocks (numeric, optional, default=120) - The number of blocks, or -1 for blocks since last difficulty change<br />2. height (numeric, optional, default=-1) - Perform estimate ending with this height or -1 for current best chain block height |
   416  | Description    | Returns the estimated network hashes per second for the block heights provided by the parameters.                                                                                                                                                    |
   417  | Returns        | numeric                                                                                                                                                                                                                                              |
   418  | Example Return | `6573971939`                                                                                                                                                                                                                                         |
   419  [Return to Overview](#MethodOverview)<br />
   420  
   421  ***
   422  <a name="getpeerinfo"/>
   423  
   424  |                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   425  | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   426  | Method         | getpeerinfo                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
   427  | Parameters     | None                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
   428  | Description    | Returns data about each connected network peer as an array of json objects.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
   429  | Returns        | `[`<br />&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"addr": "host:port",  (string) the ip address and port of the peer`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"services": "00000001",  (string) the services supported by the peer`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"lastrecv": n,  (numeric) time the last message was received in seconds since 1 Jan 1970 GMT`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"lastsend": n,  (numeric) time the last message was sent in seconds since 1 Jan 1970 GMT`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"bytessent": n,  (numeric) total bytes sent`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"bytesrecv": n,  (numeric) total bytes received`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"conntime": n,  (numeric) time the connection was made in seconds since 1 Jan 1970 GMT`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"pingtime": n,  (numeric) number of microseconds the last ping took`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"pingwait": n,  (numeric) number of microseconds a queued ping has been waiting for a response`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"version": n,  (numeric) the protocol version of the peer`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"subver": "useragent",  (string) the user agent of the peer`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"inbound": true_or_false,  (boolean) whether or not the peer is an inbound connection`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"startingheight": n,  (numeric) the latest block height the peer knew about when the connection was established`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"currentheight": n,  (numeric) the latest block height the peer is known to have relayed since connected`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"syncnode": true_or_false,  (boolean) whether or not the peer is the sync peer`<br />&nbsp;&nbsp;`}, ...`<br />`]` |
   430  | Example Return | `[`<br />&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"addr": "178.172.xxx.xxx:9246",`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"services": "00000001",`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"lastrecv": 1388183523,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"lastsend": 1388185470,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"bytessent": 287592965,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"bytesrecv": 780340,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"conntime": 1388182973,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"pingtime": 405551,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"pingwait": 183023,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"version": 70001,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"subver": "/lbcd:0.4.0/",`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"inbound": false,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"startingheight": 276921,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"currentheight": 276955,`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`"syncnode": true,`<br />&nbsp;&nbsp;`}`<br />`]`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   431  [Return to Overview](#MethodOverview)<br />
   432  
   433  ***
   434  <a name="getrawtransaction"/>
   435  
   436  |                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   437  | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   438  | Method                     | getrawtransaction                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   439  | Parameters                 | 1. transaction hash (string, required) - the hash of the transaction<br />2. verbose (bool, optional, default=false) - specifies the transaction is returned as a JSON object instead of hex-encoded string                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
   440  | Description                | Returns information about a transaction given its hash.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   441  | Returns (verbose=0)        | `"data" (string) hex-encoded bytes of the serialized transaction`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   442  | Returns (verbose=1)        | `{ (json object)`<br />&nbsp;&nbsp;`"hex": "data",  (string) hex-encoded transaction`<br />&nbsp;&nbsp;`"txid": "hash",  (string) the hash of the transaction`<br />&nbsp;&nbsp;`"version": n,  (numeric) the transaction version`<br />&nbsp;&nbsp;`"locktime": n,  (numeric) the transaction lock time`<br />&nbsp;&nbsp;`"vin": [  (array of json objects) the transaction inputs as json objects`<br />&nbsp;&nbsp;<font color="orange">For coinbase transactions:</font><br />&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"coinbase": "data",  (string) the hex-encoded bytes of the signature script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"sequence": n,  (numeric) the script sequence number`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"txinwitness": “data", (string) the witness stack for the input`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;<font color="orange">For non-coinbase transactions:</font><br />&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"txid": "hash", (string) the hash of the origin transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"vout": n, (numeric) the index of the output being redeemed from the origin transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"scriptSig": { (json object) the signature script used to redeem the origin transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"asm": "asm", (string) disassembly of the script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "data",  (string) hex-encoded bytes of the script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"sequence": n,  (numeric) the script sequence number`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"txinwitness": “data", (string) the witness stack for the input`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}, ...`<br />&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`"vout": [  (array of json objects) the transaction outputs as json objects`<br />&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"value": n, (numeric) the value in BTC`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"n": n, (numeric) the index of this transaction output`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"scriptPubKey": { (json object) the public key script used to pay coins`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"asm": "asm",  (string) disassembly of the script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "data", (string) hex-encoded bytes of the script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"reqSigs": n,  (numeric) the number of required signatures`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"addresses": [ (json array of string) the bitcoin addresses associated with this output`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"bitcoinaddress",  (string) the bitcoin address`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`...`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}, ...`<br />&nbsp;&nbsp;`]`<br />`}` |
   443  | Example Return (verbose=0) | `"010000000104be666c7053ef26c6110597dad1c1e81b5e6be53d17a8b9d0b34772054bac60000000`<br />`008c493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f`<br />`022100fbce8d84fcf2839127605818ac6c3e7a1531ebc69277c504599289fb1e9058df0141045a33`<br />`76eeb85e494330b03c1791619d53327441002832f4bd618fd9efa9e644d242d5e1145cb9c2f71965`<br />`656e276633d4ff1a6db5e7153a0a9042745178ebe0f5ffffffff0280841e00000000001976a91406`<br />`f1b6703d3f56427bfcfd372f952d50d04b64bd88ac4dd52700000000001976a9146b63f291c295ee`<br />`abd9aee6be193ab2d019e7ea7088ac00000000`<br /><font color="orange">**Newlines added for display purposes.  The actual return does not contain newlines.**</font>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   444  | Example Return (verbose=1) | `{`<br />&nbsp;&nbsp;`"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000f...",`<br />&nbsp;&nbsp;`"txid": "90743aad855880e517270550d2a881627d84db5265142fd1e7fb7add38b08be9",`<br />&nbsp;&nbsp;`"version": 1,`<br />&nbsp;&nbsp;`"locktime": 0,`<br />&nbsp;&nbsp;`"vin": [`<br />&nbsp;&nbsp;<font color="orange">For coinbase transactions:</font><br />&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"coinbase": "03708203062f503253482f04066d605108f800080100000ea2122f6f7a636f696e4065757374726174756d2f",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"sequence": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;<font color="orange">For non-coinbase transactions:</font><br />&nbsp;&nbsp;&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"vout": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"scriptSig": {`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"sequence": 4294967295,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`"vout": [`<br />&nbsp;&nbsp;&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"value": 25.1394,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"n": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"scriptPubKey": {`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"asm": "OP_DUP OP_HASH160 ea132286328cfc819457b9dec386c4b5c84faa5c OP_EQUALVERIFY OP_CHECKSIG",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "76a914ea132286328cfc819457b9dec386c4b5c84faa5c88ac",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"reqSigs": 1,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"type": "pubkeyhash"`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"addresses": [`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"1NLg3QJMsMQGM5KEUaEu5ADDmKQSLHwmyh",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;`]`<br />`}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   445  [Return to Overview](#MethodOverview)<br />
   446  
   447  ***
   448  <a name="help"/>
   449  
   450  |                |                                                                                                                                                                                                                                            |
   451  | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   452  | Method         | help                                                                                                                                                                                                                                       |
   453  | Parameters     | 1. command (string, optional) - the command to get help for                                                                                                                                                                                |
   454  | Description    | Returns a list of all commands or help for a specified command.<br />When no `command` parameter is specified, a list of avaialable commands is returned<br />When `command` is a valid method, the help text for that method is returned. |
   455  | Returns        | string                                                                                                                                                                                                                                     |
   456  | Example Return | getblockcount<br />Returns a numeric for the number of blocks in the longest block chain.                                                                                                                                                  |
   457  [Return to Overview](#MethodOverview)<br />
   458  
   459  ***
   460  <a name="ping"/>
   461  
   462  |             |                                                                                                                                                        |
   463  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
   464  | Method      | ping                                                                                                                                                   |
   465  | Parameters  | None                                                                                                                                                   |
   466  | Description | Queues a ping to be sent to each connected peer.<br />Ping times are provided by [getpeerinfo](#getpeerinfo) via the `pingtime` and `pingwait` fields. |
   467  | Returns     | Nothing                                                                                                                                                |
   468  [Return to Overview](#MethodOverview)<br />
   469  
   470  ***
   471  <a name="getrawmempool"/>
   472  
   473  |                                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   474  | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   475  | Method                         | getrawmempool                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   476  | Parameters                     | 1. verbose (boolean, optional, default=false)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   477  | Description                    | Returns an array of hashes for all of the transactions currently in the memory pool.<br />The `verbose` flag specifies that each transaction is returned as a JSON object.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   478  | Notes                          | <font color="orange">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.</font>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   479  | Returns (verbose=false)        | `[ (json array of string)`<br />&nbsp;&nbsp;`"transactionhash", (string) hash of the transaction`<br />&nbsp;&nbsp;`...`<br />`]`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
   480  | Returns (verbose=true)         | `{ (json object)`<br />&nbsp;&nbsp;`"transactionhash": { (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"size": n, (numeric) transaction size in bytes`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"vsize": n, (numeric) transaction virtual size`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"weight": n, (numeric) The transaction's weight (between vsize*4-3 and vsize*4)`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"fee" : n, (numeric) transaction fee in bitcoins`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"time": n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"height": n, (numeric) block height when transaction entered the pool`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"startingpriority": n, (numeric) priority when transaction entered the pool`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"currentpriority": n, (numeric) current priority`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"depends": [ (json array) unconfirmed transactions used as inputs for this transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"transactionhash", (string) hash of the parent transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`...`<br />&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`}, ...`<br />`}` |
   481  | Example Return (verbose=false) | `[`<br />&nbsp;&nbsp;`"3480058a397b6ffcc60f7e3345a61370fded1ca6bef4b58156ed17987f20d4e7",`<br />&nbsp;&nbsp;`"cbfe7c056a358c3a1dbced5a22b06d74b8650055d5195c1c2469e6b63a41514a"`<br />`]`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
   482  | Example Return (verbose=true)  | `{`<br />&nbsp;&nbsp;`"1697a19cede08694278f19584e8dcc87945f40c6b59a942dd8906f133ad3f9cc": {`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"size": 226,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"fee" : 0.0001,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"time": 1387992789,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"height": 276836,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"startingpriority": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"currentpriority": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"depends": [`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"aa96f672fcc5a1ec6a08a94aa46d6b789799c87bd6542967da25a96b2dee0afb",`<br />&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />`}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
   483  [Return to Overview](#MethodOverview)<br />
   484  
   485  ***
   486  <a name="setgenerate"/>
   487  
   488  |             |                                                                                                                                                                                                                                |
   489  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   490  | Method      | setgenerate                                                                                                                                                                                                                    |
   491  | Parameters  | 1. generate (boolean, required) - `true` to enable generation, `false` to disable it<br />2. genproclimit (numeric, optional) - the number of processors (cores) to limit generation to or `-1` for default                    |
   492  | Description | Set the server to generate coins (mine) or not.                                                                                                                                                                                |
   493  | 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. |
   494  | Returns     | Nothing                                                                                                                                                                                                                        |
   495  [Return to Overview](#MethodOverview)<br />
   496  
   497  ***
   498  <a name="sendrawtransaction"/>
   499  
   500  |                |                                                                                                                                                                                |
   501  | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   502  | Method         | sendrawtransaction                                                                                                                                                             |
   503  | Parameters     | 1. signedhex (string, required) serialized, hex-encoded signed transaction<br />2. allowhighfees (boolean, optional, default=false) whether or not to allow insanely high fees |
   504  | Description    | Submits the serialized, hex-encoded transaction to the local peer and relays it to the network.                                                                                |
   505  | Notes          | <font color="orange">lbcd does not yet implement the `allowhighfees` parameter, so it has no effect</font>                                                                     |
   506  | Returns        | `"hash" (string) the hash of the transaction`                                                                                                                                  |
   507  | Example Return | `"1697a19cede08694278f19584e8dcc87945f40c6b59a942dd8906f133ad3f9cc"`                                                                                                           |
   508  [Return to Overview](#MethodOverview)<br />
   509  
   510  ***
   511  <a name="submitblock"/>
   512  
   513  |                   |                                                                                                                                                  |
   514  | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
   515  | Method            | submitblock                                                                                                                                      |
   516  | Parameters        | 1. data (string, required) serialized, hex-encoded block<br />2. params (json object, optional, default=nil) this parameter is currently ignored |
   517  | Description       | Attempts to submit a new serialized, hex-encoded block to the network.                                                                           |
   518  | Returns (success) | Success: Nothing<br />Failure: `"rejected: reason"` (string)                                                                                     |
   519  [Return to Overview](#MethodOverview)<br />
   520  
   521  ***
   522  <a name="stop"/>
   523  
   524  |             |                             |
   525  | ----------- | --------------------------- |
   526  | Method      | stop                        |
   527  | Parameters  | None                        |
   528  | Description | Shutdown lbcd.              |
   529  | Returns     | `"lbcd stopping."` (string) |
   530  [Return to Overview](#MethodOverview)<br />
   531  
   532  ***
   533  <a name="validateaddress"/>
   534  
   535  |             |                                                                                                                                                                                                            |
   536  | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   537  | Method      | validateaddress                                                                                                                                                                                            |
   538  | Parameters  | 1. address (string, required) - bitcoin address                                                                                                                                                            |
   539  | Description | Verify an address is valid.                                                                                                                                                                                |
   540  | Returns     | `{ (json object)`<br />&nbsp;&nbsp;`"isvalid": true or false,  (bool) whether or not the address is valid.`<br />&nbsp;&nbsp;`"address": "bitcoinaddress", (string) the bitcoin address validated.`<br />} |
   541  [Return to Overview](#MethodOverview)<br />
   542  
   543  ***
   544  <a name="verifychain"/>
   545  
   546  |                |                                                                                                                                                                                                                                                                                                                        |
   547  | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   548  | Method         | verifychain                                                                                                                                                                                                                                                                                                            |
   549  | 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)<br />2. numblocks (numeric, optional, default=288) - the number of blocks starting from the end of the chain to verify                            |
   550  | Description    | Verifies the block chain database.<br />The actual checks performed by the `checklevel` parameter is implementation specific.  For lbcd this is:<br />`checklevel=0` - Look up each block and ensure it can be loaded from the database.<br />`checklevel=1` - Perform basic context-free sanity checks on each block. |
   551  | Notes          | <font color="orange">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.</font>        |
   552  | Returns        | `true` or `false` (boolean)                                                                                                                                                                                                                                                                                            |
   553  | Example Return | `true`                                                                                                                                                                                                                                                                                                                 |
   554  [Return to Overview](#MethodOverview)<br />
   555  
   556  
   557  <a name="ExtensionMethods" />
   558  
   559  ### 6. Extension Methods
   560  
   561  <a name="ExtMethodOverview" />
   562  
   563  **6.1 Method Overview**<br />
   564  
   565  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.
   566  
   567  | #   | Method                                          | Safe for limited user? | Description                                                                      |
   568  | --- | ----------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------- |
   569  | 1   | [debuglevel](#debuglevel)                       | N                      | Dynamically changes the debug logging level.                                     |
   570  | 2   | [getbestblock](#getbestblock)                   | Y                      | Get block height and hash of best block in the main chain.                       | None |
   571  | 3   | [getcurrentnet](#getcurrentnet)                 | Y                      | Get bitcoin network lbcd is running on.                                          | None |
   572  | 4   | [searchrawtransactions](#searchrawtransactions) | Y                      | Query for transactions related to a particular address.                          | None |
   573  | 5   | [node](#node)                                   | N                      | Attempts to add or remove a peer.                                                | None |
   574  | 6   | [generate](#generate)                           | N                      | When in simnet or regtest mode, generate a set number of blocks.                 | None |
   575  | 7   | [version](#version)                             | Y                      | Returns the JSON-RPC API version.                                                |
   576  | 8   | [getheaders](#getheaders)                       | Y                      | Returns block headers starting with the first known block hash from the request. |
   577  
   578  
   579  <a name="ExtMethodDetails" />
   580  
   581  **6.2 Method Details**<br />
   582  
   583  <a name="debuglevel"/>
   584  
   585  |                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   586  | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   587  | Method                | debuglevel                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   588  | Parameters            | 1. _levelspec_ (string)                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
   589  | Description           | Dynamically changes the debug logging level.<br />The levelspec can either a debug level or of the form `<subsystem>=<level>,<subsystem2>=<level2>,...`<br />The valid debug levels are `trace`, `debug`, `info`, `warn`, `error`, and `critical`.<br />The valid subsystems are `AMGR`, `ADXR`, `BCDB`, `BMGR`, `lbcd`, `CHAN`, `DISC`, `PEER`, `RPCS`, `SCRP`, `SRVR`, and `TXMP`.<br />Additionally, the special keyword `show` can be used to get a list of the available subsystems. |
   590  | Returns               | string                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
   591  | Example Return        | `Done.`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
   592  | Example `show` Return | `Supported subsystems [AMGR ADXR BCDB BMGR lbcd CHAN DISC PEER RPCS SCRP SRVR TXMP]`                                                                                                                                                                                                                                                                                                                                                                                                      |
   593  [Return to Overview](#ExtMethodOverview)<br />
   594  
   595  ***
   596  
   597  <a name="getbestblock"/>
   598  
   599  |             |                                                                                                                                                                                      |
   600  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   601  | Method      | getbestblock                                                                                                                                                                         |
   602  | Parameters  | None                                                                                                                                                                                 |
   603  | Description | Get block height and hash of best block in the main chain.                                                                                                                           |
   604  | Returns     | `{ (json object)`<br />&nbsp;`"hash": "data",  (string) the hex-encoded bytes of the best block hash`<br />&nbsp;`"height": n (numeric) the block height of the best block`<br />`}` |
   605  [Return to Overview](#ExtMethodOverview)<br />
   606  
   607  ***
   608  
   609  <a name="getcurrentnet"/>
   610  
   611  |                |                                                    |
   612  | -------------- | -------------------------------------------------- |
   613  | Method         | getcurrentnet                                      |
   614  | Parameters     | None                                               |
   615  | Description    | Get bitcoin network lbcd is running on.            |
   616  | Returns        | numeric                                            |
   617  | Example Return | `3652501241` (mainnet)<br />`118034699` (testnet3) |
   618  [Return to Overview](#ExtMethodOverview)<br />
   619  
   620  ***
   621  
   622  <a name="searchrawtransactions"/>
   623  
   624  |                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   625  | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   626  | Method              | searchrawtransactions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   627  | Parameters          | 1. address (string, required) - bitcoin address <br /> 2. verbose (int, optional, default=true) - specifies the transaction is returned as a JSON object instead of hex-encoded string <br />3. skip (int, optional, default=0) - the number of leading transactions to leave out of the final response <br /> 4. count (int, optional, default=100) - the maximum number of transactions to return <br /> 5. vinextra (int, optional, default=0) - Specify that extra data from previous output will be returned in vin <br /> 6. reverse (boolean, optional, default=false) - Specifies that the transactions should be returned in reverse chronological order                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
   628  | 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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   629  | Returns (verbose=0) | `[ (json array of strings)` <br/>&nbsp;&nbsp; `"serializedtx", ... hex-encoded bytes of the serialized transaction` <br/>`]`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   630  | Returns (verbose=1) | `[ (array of json objects)` <br/> &nbsp;&nbsp; `{ (json object)`<br />&nbsp;&nbsp;`"hex": "data",  (string) hex-encoded transaction`<br />&nbsp;&nbsp;`"txid": "hash",  (string) the hash of the transaction`<br />&nbsp;&nbsp;`"version": n,  (numeric) the transaction version`<br />&nbsp;&nbsp;`"locktime": n,  (numeric) the transaction lock time`<br />&nbsp;&nbsp;`"vin": [  (array of json objects) the transaction inputs as json objects`<br />&nbsp;&nbsp;<font color="orange">For coinbase transactions:</font><br />&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"coinbase": "data",  (string) the hex-encoded bytes of the signature script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"txinwitness": “data", (string) the witness stack for the input`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"sequence": n,  (numeric) the script sequence number`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;<font color="orange">For non-coinbase transactions:</font><br />&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"txid": "hash", (string) the hash of the origin transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"vout": n, (numeric) the index of the output being redeemed from the origin transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"scriptSig": { (json object) the signature script used to redeem the origin transaction`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"asm": "asm", (string) disassembly of the script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "data",  (string) hex-encoded bytes of the script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"prevOut": { (json object) Data from the origin transaction output with index vout.`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"addresses": ["value",...], (array of string) previous output addresses`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"value": n.nnn,             (numeric)         previous output value`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"txinwitness": “data", (string) the witness stack for the input`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"sequence": n,  (numeric) the script sequence number`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}, ...`<br />&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`"vout": [  (array of json objects) the transaction outputs as json objects`<br />&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"value": n, (numeric) the value in BTC`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"n": n, (numeric) the index of this transaction output`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"scriptPubKey": { (json object) the public key script used to pay coins`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"asm": "asm",  (string) disassembly of the script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "data", (string) hex-encoded bytes of the script`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"reqSigs": n,  (numeric) the number of required signatures`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"addresses": [ (json array of string) the bitcoin addresses associated with this output`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"address",  (string) the bitcoin address`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`...`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;`}, ...`<br /> &nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp; `"blockhash":"hash" Hash of the block the transaction is part of.` <br /> &nbsp;&nbsp; `"confirmations":n,  Number of numeric confirmations of block.` <br /> &nbsp;&nbsp;&nbsp;`"time":t, Transaction time in seconds since the epoch.` <br /> &nbsp;&nbsp;&nbsp;`"blocktime":t, Block time in seconds since the epoch.`<br />`},...`<br/> `]` |
   631  [Return to Overview](#ExtMethodOverview)<br />
   632  
   633  ***
   634  
   635  <a name="node"/>
   636  
   637  |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   638  | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   639  | Method      | node                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   640  | 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 <br /> 2. peer (string, required) - ip address and port, or ID of the peer to operate on<br /> 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. |
   641  | Description | Attempts to add or remove a peer.                                                                                                                                                                                                                                                                                                                                                                                                                     |
   642  | Returns     | Nothing                                                                                                                                                                                                                                                                                                                                                                                                                                               |
   643  [Return to Overview](#MethodOverview)<br />
   644  
   645  ***
   646  
   647  <a name="generate"/>
   648  
   649  |             |                                                                                                                                                                                                                                                                                                                                                                           |
   650  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   651  | Method      | generate                                                                                                                                                                                                                                                                                                                                                                  |
   652  | Parameters  | 1. numblocks (int, required) - The number of blocks to generate                                                                                                                                                                                                                                                                                                           |
   653  | 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. |
   654  | Returns     | `[ (json array of strings)` <br/>&nbsp;&nbsp; `"blockhash", ... hash of the generated block` <br/>`]`                                                                                                                                                                                                                                                                     |
   655  [Return to Overview](#MethodOverview)<br />
   656  
   657  ***
   658  
   659  <a name="version"/>
   660  
   661  |                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
   662  | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   663  | Method         | version                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
   664  | Parameters     | None                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   665  | Description    | Returns the version of the JSON-RPC API built into this release of lbcd.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
   666  | Returns        | `{ (json object)`<br />&nbsp;&nbsp;`"lbcdjsonrpcapi": {`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"versionstring": "x.y.z",  (string) the version of the JSON-RPC API`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"major": x,  (numeric) the major version of the JSON-RPC API`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"minor": y,  (numeric) the minor version of the JSON-RPC API`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"patch": z,  (numeric) the patch version of the JSON-RPC API`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"prerelease": "",  (string) prerelease info for the JSON-RPC API`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"buildmetadata": ""  (string) metadata about the server build`<br />&nbsp;&nbsp;`}`<br />`}` |
   667  | Example Return | `{`<br />&nbsp;&nbsp;`"lbcdjsonrpcapi": {`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"versionstring": "1.0.0",`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"major": 1,  `<br />&nbsp;&nbsp;&nbsp;&nbsp;`"minor": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"patch": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"prerelease": "",`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"buildmetadata": ""`<br />&nbsp;&nbsp;`}`<br />`}`                                                                                                                                                                                                                                                                                                   |
   668  [Return to Overview](#MethodOverview)<br />
   669  
   670  ***
   671  
   672  <a name="getheaders"/>
   673  
   674  |                |                                                                                                                                                                                                                                              |
   675  | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   676  | Method         | getheaders                                                                                                                                                                                                                                   |
   677  | Parameters     | 1. Block Locators (JSON array, required)<br />&nbsp;`[ (json array of strings)`<br />&nbsp;&nbsp;`"blocklocator", (string) the known block hash`<br />&nbsp;&nbsp;`...`<br />&nbsp;`]`<br />2. hashstop (string) - last desired block's hash |
   678  | Description    | Returns block headers starting with the first known block hash from the request.                                                                                                                                                             |
   679  | Returns        | `[ (json array of strings)`<br />&nbsp;&nbsp;`"blockheader",`<br />&nbsp;&nbsp;`...`<br />`]`                                                                                                                                                |
   680  | Example Return | `[`<br />&nbsp;&nbsp;`"0000002099417930b2ae09feda10e38b58c0f6bb44b4d60fa33f0e000000000000000000d53...",`<br />&nbsp;&nbsp;`"000000203ba25a173bfd24d09e0c76002a910b685ca297bd09a17b020000000000000000702..."`<br />`]`                        |
   681  [Return to Overview](#MethodOverview)<br />
   682  
   683  ***
   684  
   685  <a name="WSExtMethods" />
   686  
   687  ### 7. Websocket Extension Methods (Websocket-specific)
   688  
   689  <a name="WSExtMethodOverview" />
   690  
   691  **7.1 Method Overview**<br />
   692  
   693  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
   694  user.  Click the method name for further details such as parameter and return information.
   695  
   696  | #   | Method                                                  | Description                                                                                                                                                                                                    | Notifications                                                                                                                                                                              |
   697  | --- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   698  | 1   | [authenticate](#authenticate)                           | Authenticate the connection against the username and passphrase configured for the RPC server.<br /><font color="orange">NOTE: This is only required if an HTTP Authorization header is not being used.</font> | None                                                                                                                                                                                       |
   699  | 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) |
   700  | 3   | [stopnotifyblocks](#stopnotifyblocks)                   | Cancel registered notifications for whenever a block is connected or disconnected from the main (best) chain.                                                                                                  | None                                                                                                                                                                                       |
   701  | 4   | [notifyreceived](#notifyreceived)                       | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br />Send notifications when a txout spends to an address.                                                                           | [recvtx](#recvtx) and [redeemingtx](#redeemingtx)                                                                                                                                          |
   702  | 5   | [stopnotifyreceived](#stopnotifyreceived)               | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br />Cancel registered notifications for when a txout spends to any of the passed addresses.                                         | None                                                                                                                                                                                       |
   703  | 6   | [notifyspent](#notifyspent)                             | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br />Send notification when a txout is spent.                                                                                        | [redeemingtx](#redeemingtx)                                                                                                                                                                |
   704  | 7   | [stopnotifyspent](#stopnotifyspent)                     | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br />Cancel registered spending notifications for each passed outpoint.                                                              | None                                                                                                                                                                                       |
   705  | 8   | [rescan](#rescan)                                       | *DEPRECATED, for similar functionality see [rescanblocks](#rescanblocks)*<br />Rescan block chain for transactions to addresses and spent transaction outpoints.                                               | [recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished)                                                                   |
   706  | 9   | [notifynewtransactions](#notifynewtransactions)         | Send notifications for all new transactions as they are accepted into the mempool.                                                                                                                             | [txaccepted](#txaccepted) or [txacceptedverbose](#txacceptedverbose)                                                                                                                       |
   707  | 10  | [stopnotifynewtransactions](#stopnotifynewtransactions) | Stop sending either a txaccepted or a txacceptedverbose notification when a new transaction is accepted into the mempool.                                                                                      | None                                                                                                                                                                                       |
   708  | 11  | [session](#session)                                     | Return details regarding a websocket client's current connection.                                                                                                                                              | None                                                                                                                                                                                       |
   709  | 12  | [loadtxfilter](#loadtxfilter)                           | Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and rescanblocks.                                                                                         | [relevanttxaccepted](#relevanttxaccepted)                                                                                                                                                  |
   710  | 13  | [rescanblocks](#rescanblocks)                           | Rescan blocks for transactions matching the loaded transaction filter.                                                                                                                                         | None                                                                                                                                                                                       |
   711  
   712  <a name="WSExtMethodDetails" />
   713  
   714  **7.2 Method Details**<br />
   715  
   716  <a name="authenticate"/>
   717  
   718  |             |                                                                                                                                                                                                                                                                                                                  |
   719  | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   720  | Method      | authenticate                                                                                                                                                                                                                                                                                                     |
   721  | Parameters  | 1. username (string, required)<br />2. passphrase (string, required)                                                                                                                                                                                                                                             |
   722  | Description | Authenticate the connection against the username and password configured for the RPC server.<br />  Invoking any other method before authenticating with this command will close the connection.<br /><font color="orange">NOTE: This is only required if an HTTP Authorization header is not being used.</font> |
   723  | Returns     | Success: Nothing<br />Failure: Nothing (websocket disconnected)                                                                                                                                                                                                                                                  |
   724  [Return to Overview](#WSExtMethodOverview)<br />
   725  
   726  ***
   727  
   728  <a name="notifyblocks"/>
   729  
   730  |               |                                                                                                                                                                                                                                                                                                                                                                                                          |
   731  | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   732  | Method        | notifyblocks                                                                                                                                                                                                                                                                                                                                                                                             |
   733  | Notifications | [blockconnected](#blockconnected), [blockdisconnected](#blockdisconnected), [filteredblockconnected](#filteredblockconnected), and [filteredblockdisconnected](#filteredblockdisconnected)                                                                                                                                                                                                               |
   734  | Parameters    | None                                                                                                                                                                                                                                                                                                                                                                                                     |
   735  | Description   | Request notifications for whenever a block is connected or disconnected from the main (best) chain.<br />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. |
   736  | Returns       | Nothing                                                                                                                                                                                                                                                                                                                                                                                                  |
   737  [Return to Overview](#WSExtMethodOverview)<br />
   738  
   739  ***
   740  
   741  <a name="stopnotifyblocks"/>
   742  
   743  |               |                                                                                                            |
   744  | ------------- | ---------------------------------------------------------------------------------------------------------- |
   745  | Method        | stopnotifyblocks                                                                                           |
   746  | Notifications | None                                                                                                       |
   747  | Parameters    | None                                                                                                       |
   748  | Description   | Cancel sending notifications for whenever a block is connected or disconnected from the main (best) chain. |
   749  | Returns       | Nothing                                                                                                    |
   750  [Return to Overview](#WSExtMethodOverview)<br />
   751  
   752  ***
   753  
   754  <a name="notifyreceived"/>
   755  
   756  |               |                                                                                                                                                                                                                                                                                                                                      |
   757  | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   758  | Method        | notifyreceived                                                                                                                                                                                                                                                                                                                       |
   759  | Notifications | [recvtx](#recvtx) and [redeemingtx](#redeemingtx)                                                                                                                                                                                                                                                                                    |
   760  | Parameters    | 1. Addresses (JSON array, required)<br />&nbsp;`[ (json array of strings)`<br />&nbsp;&nbsp;`"bitcoinaddress", (string) the bitcoin address`<br />&nbsp;&nbsp;`...`<br />&nbsp;`]`                                                                                                                                                   |
   761  | Description   | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br />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. |
   762  | Returns       | Nothing                                                                                                                                                                                                                                                                                                                              |
   763  [Return to Overview](#WSExtMethodOverview)<br />
   764  
   765  ***
   766  
   767  <a name="stopnotifyreceived"/>
   768  
   769  |               |                                                                                                                                                                                    |
   770  | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   771  | Method        | stopnotifyreceived                                                                                                                                                                 |
   772  | Notifications | None                                                                                                                                                                               |
   773  | Parameters    | 1. Addresses (JSON array, required)<br />&nbsp;`[ (json array of strings)`<br />&nbsp;&nbsp;`"bitcoinaddress", (string) the bitcoin address`<br />&nbsp;&nbsp;`...`<br />&nbsp;`]` |
   774  | Description   | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br />Cancel registered receive notifications for each passed address.                                    |
   775  | Returns       | Nothing                                                                                                                                                                            |
   776  [Return to Overview](#WSExtMethodOverview)<br />
   777  
   778  ***
   779  
   780  <a name="notifyspent"/>
   781  
   782  |               |                                                                                                                                                                                                                                                                                                                                         |
   783  | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   784  | Method        | notifyspent                                                                                                                                                                                                                                                                                                                             |
   785  | Notifications | [redeemingtx](#redeemingtx)                                                                                                                                                                                                                                                                                                             |
   786  | Parameters    | 1. Outpoints (JSON array, required)<br />&nbsp;`[ (JSON array)`<br />&nbsp;&nbsp;`{ (JSON object)`<br />&nbsp;&nbsp;&nbsp;`"hash":"data", (string) the hex-encoded bytes of the outpoint hash`<br />&nbsp;&nbsp;&nbsp;`"index":n (numeric) the txout index of the outpoint`<br />&nbsp;&nbsp;`},`<br />&nbsp;&nbsp;`...`<br />&nbsp;`]` |
   787  | Description   | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br />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.                                                       |
   788  | Returns       | Nothing                                                                                                                                                                                                                                                                                                                                 |
   789  [Return to Overview](#WSExtMethodOverview)<br />
   790  
   791  ***
   792  
   793  <a name="stopnotifyspent"/>
   794  
   795  |               |                                                                                                                                                                                                                                                                                                                                         |
   796  | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   797  | Method        | stopnotifyspent                                                                                                                                                                                                                                                                                                                         |
   798  | Notifications | None                                                                                                                                                                                                                                                                                                                                    |
   799  | Parameters    | 1. Outpoints (JSON array, required)<br />&nbsp;`[ (JSON array)`<br />&nbsp;&nbsp;`{ (JSON object)`<br />&nbsp;&nbsp;&nbsp;`"hash":"data", (string) the hex-encoded bytes of the outpoint hash`<br />&nbsp;&nbsp;&nbsp;`"index":n (numeric) the txout index of the outpoint`<br />&nbsp;&nbsp;`},`<br />&nbsp;&nbsp;`...`<br />&nbsp;`]` |
   800  | Description   | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br />Cancel registered spending notifications for each passed outpoint.                                                                                                                                                                                       |
   801  | Returns       | Nothing                                                                                                                                                                                                                                                                                                                                 |
   802  [Return to Overview](#WSExtMethodOverview)<br />
   803  
   804  ***
   805  
   806  <a name="rescan"/>
   807  
   808  |               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   809  | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   810  | Method        | rescan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
   811  | Notifications | [recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
   812  | Parameters    | 1. BeginBlock (string, required) block hash to begin rescanning from<br />2. Addresses (JSON array, required)<br />&nbsp;`[ (json array of strings)`<br />&nbsp;&nbsp;`"bitcoinaddress", (string) the bitcoin address`<br />&nbsp;&nbsp;`...` <br />&nbsp;`]`<br />3. Outpoints (JSON array, required)<br />&nbsp;`[ (JSON array)`<br />&nbsp;&nbsp;`{ (JSON object)`<br />&nbsp;&nbsp;&nbsp;`"hash":"data", (string) the hex-encoded bytes of the outpoint hash`<br />&nbsp;&nbsp;&nbsp;`"index":n (numeric) the txout index of the outpoint`<br />&nbsp;&nbsp;`},`<br />&nbsp;&nbsp;`...`<br />&nbsp;`]`<br />4. EndBlock (string, optional) hash of final block to rescan           |
   813  | Description   | *DEPRECATED, for similar functionality see [rescanblocks](#rescanblocks)*<br />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. |
   814  | Returns       | Nothing                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   815  [Return to Overview](#WSExtMethodOverview)<br />
   816  
   817  ***
   818  
   819  <a name="notifynewtransactions"/>
   820  
   821  |               |                                                                                                                                                                                                                                                 |
   822  | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   823  | Method        | notifynewtransactions                                                                                                                                                                                                                           |
   824  | Notifications | [txaccepted](#txaccepted) or [txacceptedverbose](#txacceptedverbose)                                                                                                                                                                            |
   825  | 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) |
   826  | Description   | Send either a [txaccepted](#txaccepted) or a [txacceptedverbose](#txacceptedverbose) notification when a new transaction is accepted into the mempool.                                                                                          |
   827  | Returns       | Nothing                                                                                                                                                                                                                                         |
   828  [Return to Overview](#WSExtMethodOverview)<br />
   829  
   830  ***
   831  
   832  <a name="stopnotifynewtransactions"/>
   833  
   834  |               |                                                                                                                                                                |
   835  | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   836  | Method        | stopnotifynewtransactions                                                                                                                                      |
   837  | Notifications | None                                                                                                                                                           |
   838  | Parameters    | None                                                                                                                                                           |
   839  | Description   | Stop sending either a [txaccepted](#txaccepted) or a [txacceptedverbose](#txacceptedverbose) notification when a new transaction is accepted into the mempool. |
   840  | Returns       | Nothing                                                                                                                                                        |
   841  [Return to Overview](#WSExtMethodOverview)<br />
   842  
   843  ***
   844  
   845  <a name="session"/>
   846  
   847  |                |                                                                                                                                                                                                                                                                                                                                                    |
   848  | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   849  | Method         | session                                                                                                                                                                                                                                                                                                                                            |
   850  | Notifications  | None                                                                                                                                                                                                                                                                                                                                               |
   851  | Parameters     | None                                                                                                                                                                                                                                                                                                                                               |
   852  | 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. |
   853  | Returns        | `{ (json object)`<br />&nbsp;&nbsp;`"sessionid": n  (numeric) the session ID`<br />`}`                                                                                                                                                                                                                                                             |
   854  | Example Return | `{`<br />&nbsp;&nbsp;`"sessionid": 67089679842`<br />`}`                                                                                                                                                                                                                                                                                           |
   855  [Return to Overview](#WSExtMethodOverview)<br />
   856  
   857  ***
   858  
   859  <a name="loadtxfilter"/>
   860  
   861  |               |                                                                                                                                                                                                                                                                                           |
   862  | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   863  | Method        | loadtxfilter                                                                                                                                                                                                                                                                              |
   864  | Notifications | [relevanttxaccepted](#relevanttxaccepted)                                                                                                                                                                                                                                                 |
   865  | Parameters    | 1. Reload (boolean, required) - Load a new filter instead of adding data to an existing one<br />2. Addresses (JSON array, required) - Array of addresses to add to the transaction filter<br />3. Outpoints (JSON array, required) - Array of outpoints to add to the transaction filter |
   866  | Description   | Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and [rescanblocks](#rescanblocks).                                                                                                                                                   |
   867  | Returns       | Nothing                                                                                                                                                                                                                                                                                   |
   868  [Return to Overview](#WSExtMethodOverview)<br />
   869  
   870  ***
   871  
   872  <a name="rescanblocks"/>
   873  
   874  |                |                                                                                                                                                                                                                                                                                                                                                                                                                                            |
   875  | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   876  | Method         | rescanblocks                                                                                                                                                                                                                                                                                                                                                                                                                               |
   877  | Notifications  | None                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   878  | Parameters     | 1. Blockhashes (JSON array, required) - List of hashes to rescan.  Each next block must be a child of the previous.                                                                                                                                                                                                                                                                                                                        |
   879  | Description    | Rescan blocks for transactions matching the loaded transaction filter.                                                                                                                                                                                                                                                                                                                                                                     |
   880  | Returns        | `[ (JSON array)`<br />&nbsp;&nbsp;`{ (JSON object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"hash": "data", (string) Hash of the matching block.`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"transactions": [ (JSON array) List of matching transactions, serialized and hex-encoded.`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"serializedtx" (string) Serialized and hex-encoded transaction.`<br />&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`}`<br />`]` |
   881  | Example Return | `[`<br />&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"hash": "0000002099417930b2ae09feda10e38b58c0f6bb44b4d60fa33f0e000000000000000000d53...",`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"transactions": [`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8..."`<br />&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`}`<br />`]`                                              |
   882  
   883  
   884  <a name="Notifications" />
   885  
   886  ### 8. Notifications (Websocket-specific)
   887  
   888  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.
   889  
   890  <a name="NotificationOverview" />
   891  
   892  **8.1 Notification Overview**<br />
   893  
   894  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.
   895  
   896  | #   | Method                                                  | Description                                                                                                                                                                                                   | Request                                                      |
   897  | --- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
   898  | 1   | [blockconnected](#blockconnected)                       | *DEPRECATED, for similar functionality see [filteredblockconnected](#filteredblockconnected)*<br />Block connected to the main chain.                                                                         | [notifyblocks](#notifyblocks)                                |
   899  | 2   | [blockdisconnected](#blockdisconnected)                 | *DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*<br />Block disconnected from the main chain.                                                              | [notifyblocks](#notifyblocks)                                |
   900  | 3   | [recvtx](#recvtx)                                       | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*<br />Processed a transaction output spending to a wallet address. | [notifyreceived](#notifyreceived) and [rescan](#rescan)      |
   901  | 4   | [redeemingtx](#redeemingtx)                             | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*<br />Processed a transaction that spends a registered outpoint.   | [notifyspent](#notifyspent) and [rescan](#rescan)            |
   902  | 5   | [txaccepted](#txaccepted)                               | Received a new transaction after requesting simple notifications of all new transactions accepted into the mempool.                                                                                           | [notifynewtransactions](#notifynewtransactions)              |
   903  | 6   | [txacceptedverbose](#txacceptedverbose)                 | Received a new transaction after requesting verbose notifications of all new transactions accepted into the mempool.                                                                                          | [notifynewtransactions](#notifynewtransactions)              |
   904  | 7   | [rescanprogress](#rescanprogress)                       | *DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*<br />A rescan operation that is underway has made progress.                                                                             | [rescan](#rescan)                                            |
   905  | 8   | [rescanfinished](#rescanfinished)                       | *DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*<br />A rescan operation has completed.                                                                                                  | [rescan](#rescan)                                            |
   906  | 9   | [relevanttxaccepted](#relevanttxaccepted)               | A transaction matching the tx filter has been accepted into the mempool.                                                                                                                                      | [loadtxfilter](#loadtxfilter)                                |
   907  | 10  | [filteredblockconnected](#filteredblockconnected)       | Block connected to the main chain; contains any transactions that match the client's tx filter.                                                                                                               | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter) |
   908  | 11  | [filteredblockdisconnected](#filteredblockdisconnected) | Block disconnected from the main chain.                                                                                                                                                                       | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter) |
   909  
   910  <a name="NotificationDetails" />
   911  
   912  **8.2 Notification Details**<br />
   913  
   914  <a name="blockconnected"/>
   915  
   916  |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   917  | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   918  | Method      | blockconnected                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   919  | Request     | [notifyblocks](#notifyblocks)                                                                                                                                                                                                                                                                                                                                                                                                                        |
   920  | Parameters  | 1. BlockHash (string) hex-encoded bytes of the attached block hash<br />2. BlockHeight (numeric) height of the attached block<br />3. BlockTime (numeric) unix time of the attached block                                                                                                                                                                                                                                                            |
   921  | Description | *DEPRECATED, for similar functionality see [filteredblockconnected](#filteredblockconnected)*<br />Notifies when a block has been added to the main chain.  Notification is sent to all connected clients.                                                                                                                                                                                                                                           |
   922  | Example     | Example blockconnected notification for mainnet block 280330 (newlines added for readability):<br />`{`<br />&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "blockconnected",`<br />&nbsp;`"params":`<br />&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;`"000000000000000004cbdfe387f4df44b914e464ca79838a8ab777b3214dbffd",`<br />&nbsp;&nbsp;&nbsp;`280330,`<br />&nbsp;&nbsp;&nbsp;`1389636265`<br />&nbsp;&nbsp;`],`<br />&nbsp;`"id": null`<br />`}` |
   923  [Return to Overview](#NotificationOverview)<br />
   924  
   925  ***
   926  
   927  <a name="blockdisconnected"/>
   928  
   929  |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
   930  | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   931  | Method      | blockdisconnected                                                                                                                                                                                                                                                                                                                                                                                                                                          |
   932  | Request     | [notifyblocks](#notifyblocks)                                                                                                                                                                                                                                                                                                                                                                                                                              |
   933  | Parameters  | 1. BlockHash (string) hex-encoded bytes of the disconnected block hash<br />2. BlockHeight (numeric) height of the disconnected block<br />3. BlockTime (numeric) unix time of the disconnected block                                                                                                                                                                                                                                                      |
   934  | Description | *DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*<br />Notifies when a block has been removed from the main chain.  Notification is sent to all connected clients.                                                                                                                                                                                                                                       |
   935  | Example     | Example blockdisconnected notification for mainnet block 280330 (newlines added for readability):<br />`{`<br />&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "blockdisconnected",`<br />&nbsp;`"params":`<br />&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;`"000000000000000004cbdfe387f4df44b914e464ca79838a8ab777b3214dbffd",`<br />&nbsp;&nbsp;&nbsp;`280330,`<br />&nbsp;&nbsp;&nbsp;`1389636265`<br />&nbsp;&nbsp;`],`<br />&nbsp;`"id": null`<br />`}` |
   936  [Return to Overview](#NotificationOverview)<br />
   937  
   938  ***
   939  
   940  <a name="recvtx"/>
   941  
   942  |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   943  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   944  | Method      | recvtx                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   945  | Request     | [rescan](#rescan) or [notifyreceived](#notifyreceived)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   946  | Parameters  | 1. Transaction (string) full transaction encoded as a hex string<br />2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   947  | Description | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*<br />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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
   948  | Example     | Example recvtx notification for mainnet transaction 61d3696de4c888730cbe06b0ad8ecb6d72d6108e893895aa9bc067bd7eba3fad when processed by mempool (newlines added for readability):<br />`{`<br />&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "recvtx",`<br />&nbsp;`"params":`<br />&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;`"010000000114d9ff358894c486b4ae11c2a8cf7851b1df64c53d2e511278eff17c22fb737300000000..."`<br />&nbsp;&nbsp;`],`<br />&nbsp;`"id": null`<br />`}`<br />The recvtx notification for the same txout, after the transaction was mined into block 276425:<br />`{`<br />&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "recvtx",`<br />&nbsp;`"params":`<br />&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;`"010000000114d9ff358894c486b4ae11c2a8cf7851b1df64c53d2e511278eff17c22fb737300000000...",`<br />&nbsp;&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"height": 276425,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"hash": "000000000000000325474bb799b9e591f965ca4461b72cb7012b808db92bb2fc",`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"index": 684,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"time": 1387737310`<br />&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;`],`<br />&nbsp;`"id": null`<br />`}` |
   949  [Return to Overview](#NotificationOverview)<br />
   950  
   951  ***
   952  
   953  <a name="redeemingtx"/>
   954  
   955  |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   956  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   957  | Method      | redeemingtx                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
   958  | Requests    | [notifyspent](#notifyspent) and [rescan](#rescan)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   959  | Parameters  | 1. Transaction (string) full transaction encoded as a hex string<br />2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   960  | Description | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*<br />Notifies a client when an registered outpoint is spent by a transaction accepted to mempool and/or mined into a block.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   961  | Example     | Example redeemingtx notification for mainnet outpoint 61d3696de4c888730cbe06b0ad8ecb6d72d6108e893895aa9bc067bd7eba3fad:0 after being spent by transaction 4ad0c16ac973ff675dec1f3e5f1273f1c45be2a63554343f21b70240a1e43ece (newlines added for readability):<br />`{`<br />&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "redeemingtx",`<br />&nbsp;`"params":`<br />&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;`"0100000003ad3fba7ebd67c09baa9538898e10d6726dcb8eadb006be0c7388c8e46d69d3610000000..."`<br />&nbsp;&nbsp;`],`<br />&nbsp;`"id": null`<br />`}`<br />The redeemingtx notification for the same txout, after the spending transaction was mined into block 279143:<br />`{`<br />&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "recvtx",`<br />&nbsp;`"params":`<br />&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;`"0100000003ad3fba7ebd67c09baa9538898e10d6726dcb8eadb006be0c7388c8e46d69d3610000000...",`<br />&nbsp;&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"height": 279143,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"hash": "00000000000000017188b968a371bab95aa43522665353b646e41865abae02a4",`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"index": 6,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"time": 1389115004`<br />&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;`],`<br />&nbsp;`"id": null`<br />`}` |
   962  [Return to Overview](#NotificationOverview)<br />
   963  
   964  ***
   965  
   966  <a name="txaccepted"/>
   967  
   968  |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   969  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   970  | Method      | txaccepted                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   971  | Request     | [notifynewtransactions](#notifynewtransactions)                                                                                                                                                                                                                                                                                                                                                                                                                                |
   972  | Parameters  | 1. TxHash (string) hex-encoded bytes of the transaction hash<br />2. Amount (numeric) sum of the value of all the transaction outpoints                                                                                                                                                                                                                                                                                                                                        |
   973  | Description | Notifies when a new transaction has been accepted and the client has requested standard transaction details.                                                                                                                                                                                                                                                                                                                                                                   |
   974  | Example     | Example txaccepted notification for mainnet transaction id "16c54c9d02fe570b9d41b518c0daefae81cc05c69bbe842058e84c6ed5826261" (newlines added for readability):<br />`{`<br />&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "txaccepted",`<br />&nbsp;`"params":`<br />&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;`"16c54c9d02fe570b9d41b518c0daefae81cc05c69bbe842058e84c6ed5826261",`<br />&nbsp;&nbsp;&nbsp;`55838384`<br />&nbsp;&nbsp;`],`<br />&nbsp;`"id": null`<br />`}` |
   975  [Return to Overview](#NotificationOverview)<br />
   976  
   977  ***
   978  
   979  <a name="txacceptedverbose"/>
   980  
   981  |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   982  | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   983  | Method      | txacceptedverbose                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
   984  | Request     | [notifynewtransactions](#notifynewtransactions)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   985  | Parameters  | 1. RawTx (json object) the transaction as a json object (see getrawtransaction json object details)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   986  | Description | Notifies when a new transaction has been accepted and the client has requested verbose transaction details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
   987  | Example     | Example txacceptedverbose notification (newlines added for readability):<br />`{`<br />&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "txacceptedverbose",`<br />&nbsp;`"params":`<br />&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000f...",`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"txid": "90743aad855880e517270550d2a881627d84db5265142fd1e7fb7add38b08be9",`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"version": 1,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"locktime": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"vin": [`<br />&nbsp;&nbsp;&nbsp;&nbsp;<font color="orange">For coinbase transactions:</font><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`{ (json object)`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"coinbase": "03708203062f503253482f04066d605108f800080100000ea2122f6f7a636f696e4065757374726174756d2f",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"sequence": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;<font color="orange">For non-coinbase transactions:</font><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"vout": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"scriptSig": {`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"sequence": 4294967295,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;`],`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"vout": [`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`{`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"value": 25.1394,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"n": 0,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"scriptPubKey": {`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"asm": "OP_DUP OP_HASH160 ea132286328cfc819457b9dec386c4b5c84faa5c OP_EQUALVERIFY OP_CHECKSIG",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"hex": "76a914ea132286328cfc819457b9dec386c4b5c84faa5c88ac",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"reqSigs": 1,`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"type": "pubkeyhash"`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"addresses": [`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`"1NLg3QJMsMQGM5KEUaEu5ADDmKQSLHwmyh",`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;&nbsp;`}`<br />&nbsp;&nbsp;`],`<br />&nbsp;`"id": null`<br />`}` |
   988  [Return to Overview](#NotificationOverview)<br />
   989  
   990  ***
   991  
   992  <a name="rescanprogress"/>
   993  
   994  |             |                                                                                                                                                                                                                                                                                                                                                  |
   995  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   996  | Method      | rescanprogress                                                                                                                                                                                                                                                                                                                                   |
   997  | Request     | [rescan](#rescan)                                                                                                                                                                                                                                                                                                                                |
   998  | Parameters  | 1. Hash (string) hash of the last processed block<br />2. Height (numeric) height of the last processed block<br />3. Time (numeric) UNIX time of the last processed block                                                                                                                                                                       |
   999  | Description | *DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*<br />Notifies a client with the current progress at periodic intervals when a long-running [rescan](#rescan) is underway.                                                                                                                                                  |
  1000  | Example     | `{`<br />&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "rescanprogress",`<br />&nbsp;`"params":`<br />&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;`"0000000000000ea86b49e11843b2ad937ac89ae74a963c7edd36e0147079b89d",`<br />&nbsp;&nbsp;&nbsp;`127213,`<br />&nbsp;&nbsp;&nbsp;`1306533807`<br />&nbsp;&nbsp;`],`<br />&nbsp;`"id": null`<br />`}` |
  1001  [Return to Overview](#NotificationOverview)<br />
  1002  
  1003  ***
  1004  
  1005  <a name="rescanfinished"/>
  1006  
  1007  |             |                                                                                                                                                                                                                                                                                                                                                  |
  1008  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  1009  | Method      | rescanfinished                                                                                                                                                                                                                                                                                                                                   |
  1010  | Request     | [rescan](#rescan)                                                                                                                                                                                                                                                                                                                                |
  1011  | Parameters  | 1. Hash (string) hash of the last rescanned block<br />2. Height (numeric) height of the last rescanned block<br />3. Time (numeric) UNIX time of the last rescanned block                                                                                                                                                                       |
  1012  | Description | *DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*<br />Notifies a client that the [rescan](#rescan) has completed and no further notifications will be sent.                                                                                                                                                                 |
  1013  | Example     | `{`<br />&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "rescanfinished",`<br />&nbsp;`"params":`<br />&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;`"0000000000000ea86b49e11843b2ad937ac89ae74a963c7edd36e0147079b89d",`<br />&nbsp;&nbsp;&nbsp;`127213,`<br />&nbsp;&nbsp;&nbsp;`1306533807`<br />&nbsp;&nbsp;`],`<br />&nbsp;`"id": null`<br />`}` |
  1014  [Return to Overview](#NotificationOverview)<br />
  1015  
  1016  ***
  1017  
  1018  <a name="relevanttxaccepted"/>
  1019  
  1020  |             |                                                                                                                                                                                                                                                                                                                                             |
  1021  | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  1022  | Method      | relevanttxaccepted                                                                                                                                                                                                                                                                                                                          |
  1023  | Request     | [loadtxfilter](#loadtxfilter)                                                                                                                                                                                                                                                                                                               |
  1024  | Parameters  | 1. Transaction (string) hex-encoded serialized transaction matching the client's filter loaded ith [loadtxfilter](#loadtxfilter)                                                                                                                                                                                                            |
  1025  | Description | Notifies a client that a transaction matching the client's tx filter has been accepted into he mempool.                                                                                                                                                                                                                                     |
  1026  | Example     | Example `relevanttxaccepted` notification (newlines added for readability):<br />`{`<br >&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "relevanttxaccepted",`<br />&nbsp;`"params": [`<br >&nbsp;&nbsp;`"01000000014221abdcca25c8a3b0c044034875dece048c77d567a806f0c2e7e0f5e25a8f100..."`<br >&nbsp;`],`<br />&nbsp;`"id": null`<br />`}` |
  1027  
  1028  ***
  1029  
  1030  <a name="filteredblockconnected"/>
  1031  
  1032  |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
  1033  | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  1034  | Method      | filteredblockconnected                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
  1035  | Request     | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
  1036  | Parameters  | 1. BlockHeight (numeric) height of the attached block<br />2. Header (string) hex-encoded serialized header of the attached block<br />3. Transactions (JSON array) hex-encoded serialized transactions matching the filter for the client connection loaded with [loadtxfilter](#loadtxfilter)                                                                                                                                                                                                                                                                                                                      |
  1037  | Description | Notifies when a block has been added to the main chain.  Notification is sent to all connected clients.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
  1038  | Example     | Example filteredblockconnected notification for mainnet block 280330 (newlines added for readability):<br />`{`<br />&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "filteredblockconnected",`<br />&nbsp;`"params":`<br />&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;`280330,`<br />&nbsp;&nbsp;&nbsp;`"0200000052d1e8813f697293e41942aa230e7e4fcc44832d78a1372202000000000000006aa...",`<br />&nbsp;&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;&nbsp;`"01000000014221abdcca25c8a3b0c044034875dece048c77d567a806f0c2e7e0f5e25a8f100..."`<br />&nbsp;&nbsp;&nbsp;`]`<br />&nbsp;&nbsp;`],`<br />&nbsp;`"id": null`<br />`}` |
  1039  [Return to Overview](#NotificationOverview)<br />
  1040  
  1041  ***
  1042  
  1043  <a name="filteredblockdisconnected"/>
  1044  
  1045  |             |                                                                                                                                                                                                                                                                                                                                                                                                                                     |
  1046  | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  1047  | Method      | filteredblockdisconnected                                                                                                                                                                                                                                                                                                                                                                                                           |
  1048  | Request     | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter)                                                                                                                                                                                                                                                                                                                                                                        |
  1049  | Parameters  | 1. BlockHeight (numeric) height of the disconnected block<br />2. Header (string) hex-encoded serialized header of the disconnected block                                                                                                                                                                                                                                                                                           |
  1050  | Description | Notifies when a block has been removed from the main chain.  Notification is sent to all connected clients.                                                                                                                                                                                                                                                                                                                         |
  1051  | Example     | Example blockdisconnected notification for mainnet block 280330 (newlines added for readability):<br />`{`<br />&nbsp;`"jsonrpc": "1.0",`<br />&nbsp;`"method": "blockdisconnected",`<br />&nbsp;`"params":`<br />&nbsp;&nbsp;`[`<br />&nbsp;&nbsp;&nbsp;`280330,`<br />&nbsp;&nbsp;&nbsp;`"0200000052d1e8813f697293e41942aa230e7e4fcc44832d78a1372202000000000000006aa..."`<br />&nbsp;&nbsp;`],`<br />&nbsp;`"id": null`<br />`}` |
  1052  [Return to Overview](#NotificationOverview)<br />
  1053  
  1054  
  1055  <a name="ExampleCode" />
  1056  
  1057  ### 9. Example Code
  1058  
  1059  This section provides example code for interacting with the JSON-RPC API in
  1060  various languages.
  1061  
  1062  * [Go](#ExampleGoApp)
  1063  * [node.js](#ExampleNodeJsCode)
  1064  
  1065  <a name="ExampleGoApp" />
  1066  
  1067  **9.1 Go**
  1068  
  1069  This section provides examples of using the RPC interface using Go and the
  1070  [rpcclient](https://github.com/lbryio/lbcd/tree/master/rpcclient) package.
  1071  
  1072  * [Using getblockcount to Retrieve the Current Block Height](#ExampleGetBlockCount)
  1073  * [Using getblock to Retrieve the Genesis Block](#ExampleGetBlock)
  1074  * [Using notifyblocks to Receive blockconnected and blockdisconnected Notifications (Websocket-specific)](#ExampleNotifyBlocks)
  1075  
  1076  
  1077  <a name="ExampleGetBlockCount" />
  1078  
  1079  **9.1.1 Using getblockcount to Retrieve the Current Block Height**<br />
  1080  
  1081  The following is an example Go application which uses the
  1082  [rpcclient](https://github.com/lbryio/lbcd/tree/master/rpcclient) package to connect with
  1083  a lbcd instance via Websockets, issues [getblockcount](#getblockcount) to
  1084  retrieve the current block height, and displays it.
  1085  
  1086  ```Go
  1087  package main
  1088  
  1089  import (
  1090  	"io/ioutil"
  1091  	"log"
  1092  	"path/filepath"
  1093  
  1094  	"github.com/lbryio/lbcd/rpcclient"
  1095  	btcutil "github.com/lbryio/lbcutil"
  1096  )
  1097  
  1098  func main() {
  1099  	// Load the certificate for the TLS connection which is automatically
  1100  	// generated by lbcd when it starts the RPC server and doesn't already
  1101  	// have one.
  1102  	lbcdHomeDir := btcutil.AppDataDir("lbcd", false)
  1103  	certs, err := ioutil.ReadFile(filepath.Join(lbcdHomeDir, "rpc.cert"))
  1104  	if err != nil {
  1105  		log.Fatal(err)
  1106  	}
  1107  
  1108  	// Create a new RPC client using websockets.  Since this example is
  1109  	// not long-lived, the connection will be closed as soon as the program
  1110  	// exits.
  1111  	connCfg := &btcrpcclient.ConnConfig{
  1112  		Host:         "localhost:9245",
  1113  		Endpoint:     "ws",
  1114  		User:         "yourrpcuser",
  1115  		Pass:         "yourrpcpass",
  1116  		Certificates: certs,
  1117  	}
  1118  	client, err := rpcclient.New(connCfg, nil)
  1119  	if err != nil {
  1120  		log.Fatal(err)
  1121  	}
  1122  	defer client.Shutdown()
  1123  
  1124  	// Query the RPC server for the current block count and display it.
  1125  	blockCount, err := client.GetBlockCount()
  1126  	if err != nil {
  1127  		log.Fatal(err)
  1128  	}
  1129  	log.Printf("Block count: %d", blockCount)
  1130  }
  1131  ```
  1132  
  1133  Which results in:
  1134  
  1135  ```bash
  1136  2018/08/27 11:17:27 Block count: 536027
  1137  ```
  1138  
  1139  <a name="ExampleGetBlock" />
  1140  
  1141  **9.1.2 Using getblock to Retrieve the Genesis Block**<br />
  1142  
  1143  The following is an example Go application which uses the
  1144  [rpcclient](https://github.com/lbryio/lbcd/tree/master/rpcclient) package to connect with
  1145  a lbcd instance via Websockets, issues [getblock](#getblock) to retrieve
  1146  information about the Genesis block, and display a few details about it.
  1147  
  1148  ```Go
  1149  package main
  1150  
  1151  import (
  1152  	"io/ioutil"
  1153  	"log"
  1154  	"path/filepath"
  1155  	"time"
  1156  
  1157  	"github.com/lbryio/lbcd/chaincfg/chainhash"
  1158  	"github.com/lbryio/lbcd/rpcclient"
  1159  	btcutil "github.com/lbryio/lbcutil"
  1160  )
  1161  
  1162  func main() {
  1163  	// Load the certificate for the TLS connection which is automatically
  1164  	// generated by lbcd when it starts the RPC server and doesn't already
  1165  	// have one.
  1166  	lbcdHomeDir := btcutil.AppDataDir("lbcd", false)
  1167  	certs, err := ioutil.ReadFile(filepath.Join(lbcdHomeDir, "rpc.cert"))
  1168  	if err != nil {
  1169  		log.Fatal(err)
  1170  	}
  1171  
  1172  	// Create a new RPC client using websockets.  Since this example is
  1173  	// not long-lived, the connection will be closed as soon as the program
  1174  	// exits.
  1175  	connCfg := &btcrpcclient.ConnConfig{
  1176  		Host:         "localhost:19245",
  1177  		Endpoint:     "ws",
  1178  		User:         "yourrpcuser",
  1179  		Pass:         "yourrpcpass",
  1180  		Certificates: certs,
  1181  	}
  1182  	client, err := rpcclient.New(connCfg, nil)
  1183  	if err != nil {
  1184  		log.Fatal(err)
  1185  	}
  1186  	defer client.Shutdown()
  1187  
  1188  	// Query the RPC server for the genesis block using the "getblock"
  1189  	// command with the verbose flag set to true and the verboseTx flag
  1190  	// set to false.
  1191  	genesisHashStr := "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
  1192  	blockHash, err := chainhash.NewHashFromStr(genesisHashStr)
  1193  	if err != nil {
  1194  		log.Fatal(err)
  1195  	}
  1196  	block, err := client.GetBlockVerbose(blockHash)
  1197  	if err != nil {
  1198  		log.Fatal(err)
  1199  	}
  1200  
  1201  	// Display some details about the returned block.
  1202  	log.Printf("Hash: %v\n", block.Hash)
  1203  	log.Printf("Previous Block: %v\n", block.PreviousHash)
  1204  	log.Printf("Next Block: %v\n", block.NextHash)
  1205  	log.Printf("Merkle root: %v\n", block.MerkleRoot)
  1206  	log.Printf("Timestamp: %v\n", time.Unix(block.Time, 0).UTC())
  1207  	log.Printf("Confirmations: %v\n", block.Confirmations)
  1208  	log.Printf("Difficulty: %f\n", block.Difficulty)
  1209  	log.Printf("Size (in bytes): %v\n", block.Size)
  1210  	log.Printf("Num transactions: %v\n", len(block.Tx))
  1211  }
  1212  ```
  1213  
  1214  Which results in:
  1215  
  1216  ```bash
  1217  Hash: 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
  1218  Previous Block: 0000000000000000000000000000000000000000000000000000000000000000
  1219  Next Block: 00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048
  1220  Merkle root: 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
  1221  Timestamp: 2009-01-03 18:15:05 +0000 UTC
  1222  Confirmations: 534323
  1223  Difficulty: 1.000000
  1224  Size (in bytes): 285
  1225  Num transactions: 1
  1226  ```
  1227  
  1228  <a name="ExampleNotifyBlocks" />
  1229  
  1230  **9.1.3 Using notifyblocks to Receive blockconnected and blockdisconnected
  1231  Notifications (Websocket-specific)**<br />
  1232  
  1233  The following is an example Go application which uses the
  1234  [rpcclient](https://github.com/lbryio/lbcd/tree/master/rpcclient) package to connect with
  1235  a lbcd instance via Websockets and registers for
  1236  [blockconnected](#blockconnected) and [blockdisconnected](#blockdisconnected)
  1237  notifications with [notifyblocks](#notifyblocks).  It also sets up handlers for
  1238  the notifications.
  1239  
  1240  ```Go
  1241  package main
  1242  
  1243  import (
  1244  	"io/ioutil"
  1245  	"log"
  1246  	"path/filepath"
  1247  	"time"
  1248  
  1249  	"github.com/lbryio/lbcd/chaincfg/chainhash"
  1250  	"github.com/lbryio/lbcd/rpcclient"
  1251  	btcutil "github.com/lbryio/lbcutil"
  1252  )
  1253  
  1254  func main() {
  1255  	// Setup handlers for blockconnected and blockdisconnected
  1256  	// notifications.
  1257  	ntfnHandlers := rpcclient.NotificationHandlers{
  1258  		OnBlockConnected: func(hash *chainhash.Hash, height int32, t time.Time) {
  1259  			log.Printf("Block connected: %v (%d) %s", hash, height, t)
  1260  		},
  1261  		OnBlockDisconnected: func(hash *chainhash.Hash, height int32, t time.Time) {
  1262  			log.Printf("Block disconnected: %v (%d) %s", hash, height, t)
  1263  		},
  1264  	}
  1265  
  1266  	// Load the certificate for the TLS connection which is automatically
  1267  	// generated by lbcd when it starts the RPC server and doesn't already
  1268  	// have one.
  1269  	lbcdHomeDir := btcutil.AppDataDir("lbcd", false)
  1270  	certs, err := ioutil.ReadFile(filepath.Join(lbcdHomeDir, "rpc.cert"))
  1271  	if err != nil {
  1272  		log.Fatal(err)
  1273  	}
  1274  
  1275  	// Create a new RPC client using websockets.
  1276  	connCfg := &btcrpcclient.ConnConfig{
  1277  		Host:         "localhost:9245",
  1278  		Endpoint:     "ws",
  1279  		User:         "yourrpcuser",
  1280  		Pass:         "yourrpcpass",
  1281  		Certificates: certs,
  1282  	}
  1283  	client, err := rpcclient.New(connCfg, &ntfnHandlers)
  1284  	if err != nil {
  1285  		log.Fatal(err)
  1286  	}
  1287  
  1288  	// Register for blockconnected and blockdisconneted notifications.
  1289  	if err := client.NotifyBlocks(); err != nil {
  1290  		client.Shutdown()
  1291  		log.Fatal(err)
  1292  	}
  1293  
  1294  	// For this example, gracefully shutdown the client after 10 seconds.
  1295  	// Ordinarily when to shutdown the client is highly application
  1296  	// specific.
  1297  	log.Println("Client shutdown in 10 seconds...")
  1298  	time.AfterFunc(time.Second*10, func() {
  1299  		log.Println("Client shutting down...")
  1300  		client.Shutdown()
  1301  		log.Println("Client shutdown complete.")
  1302  	})
  1303  
  1304  	// Wait until the client either shuts down gracefully (or the user
  1305  	// terminates the process with Ctrl+C).
  1306  	client.WaitForShutdown()
  1307  }
  1308  ```
  1309  
  1310  Example output:
  1311  
  1312  ```
  1313  2018/08/27 10:35:43 Client shutdown in 10 seconds...
  1314  2018/08/27 10:35:44 Block connected: 00000000000000000003321723557df58914658dc6fd963d547292a0a4797454 (534747) 2018-08-02 06:37:52 +0800 CST
  1315  2018/08/27 10:35:47 Block connected: 0000000000000000002e12773b798fc61dffe00ed5c3e89d3c306f8058c51e13 (534748) 2018-08-02 06:39:54 +0800 CST
  1316  2018/08/27 10:35:49 Block connected: 0000000000000000001bb311cd849839ce88499b91a201922f55a1cfafabe267 (534749) 2018-08-02 06:44:22 +0800 CST
  1317  2018/08/27 10:35:50 Block connected: 00000000000000000019d7296c9b5c175369ad337ec44b76bd4728021a09b864 (534750) 2018-08-02 06:55:44 +0800 CST
  1318  2018/08/27 10:35:53 Block connected: 00000000000000000022db98cf47e944ed58ca450c819e8fef8f8c71ca5d9901 (534751) 2018-08-02 06:57:39 +0800 CST
  1319  2018/08/27 10:35:53 Client shutting down...
  1320  2018/08/27 10:35:53 Client shutdown complete.
  1321  ```
  1322  
  1323  <a name="ExampleNodeJsCode" />
  1324  
  1325  ### 9.2. Example node.js Code
  1326  
  1327  <a name="ExampleNotifyBlocks" />
  1328  
  1329  **9.2.1 Using notifyblocks to be Notified of Block Connects and Disconnects**<br />
  1330  
  1331  The following is example node.js code which uses [ws](https://github.com/einaros/ws)
  1332  (can be installed with `npm install ws`) to connect with a lbcd instance,
  1333  issues [notifyblocks](#notifyblocks) to register for
  1334  [blockconnected](#blockconnected) and [blockdisconnected](#blockdisconnected)
  1335  notifications, and displays all incoming messages.
  1336  
  1337  ```javascript
  1338  var fs = require('fs');
  1339  var WebSocket = require('ws');
  1340  
  1341  // Load the certificate for the TLS connection which is automatically
  1342  // generated by lbcd when it starts the RPC server and doesn't already
  1343  // have one.
  1344  var cert = fs.readFileSync('/path/to/lbcd/appdata/rpc.cert');
  1345  var user = "yourusername";
  1346  var password = "yourpassword";
  1347  
  1348  
  1349  // Initiate the websocket connection.  The lbcd generated certificate acts as
  1350  // its own certificate authority, so it needs to be specified in the 'ca' array
  1351  // for the certificate to properly validate.
  1352  var ws = new WebSocket('wss://127.0.0.1:9245/ws', {
  1353    headers: {
  1354      'Authorization': 'Basic '+new Buffer(user+':'+password).toString('base64')
  1355    },
  1356    cert: cert,
  1357    ca: [cert]
  1358  });
  1359  ws.on('open', function() {
  1360      console.log('CONNECTED');
  1361      // Send a JSON-RPC command to be notified when blocks are connected and
  1362      // disconnected from the chain.
  1363      ws.send('{"jsonrpc":"1.0","id":"0","method":"notifyblocks","params":[]}');
  1364  });
  1365  ws.on('message', function(data, flags) {
  1366      console.log(data);
  1367  });
  1368  ws.on('error', function(derp) {
  1369    console.log('ERROR:' + derp);
  1370  })
  1371  ws.on('close', function(data) {
  1372    console.log('DISCONNECTED');
  1373  })
  1374  ```