From 3ad06bdcbb766cef81879e1e3510fbb35a639271 Mon Sep 17 00:00:00 2001 From: Roy Lee Date: Tue, 14 Aug 2018 17:59:48 -0700 Subject: [PATCH] [lbry] misc: change RPC port from 8334 to 9245 --- cmd/btcctl/config.go | 4 +- docs/README.md | 297 +++++- docs/json_rpc_api.md | 1052 ++++++++++----------- params.go | 6 +- rpcclient/examples/btcdwebsockets/main.go | 2 +- sample-btcd.conf | 20 +- 6 files changed, 838 insertions(+), 543 deletions(-) mode change 120000 => 100644 docs/README.md diff --git a/cmd/btcctl/config.go b/cmd/btcctl/config.go index 1cc2a260..9caef192 100644 --- a/cmd/btcctl/config.go +++ b/cmd/btcctl/config.go @@ -123,7 +123,7 @@ func normalizeAddress(addr string, chain *chaincfg.Params, useWallet bool) (stri if useWallet { defaultPort = "18332" } else { - defaultPort = "18334" + defaultPort = "19245" } case &chaincfg.SimNetParams: if useWallet { @@ -149,7 +149,7 @@ func normalizeAddress(addr string, chain *chaincfg.Params, useWallet bool) (stri if useWallet { defaultPort = "8332" } else { - defaultPort = "8334" + defaultPort = "9245" } } diff --git a/docs/README.md b/docs/README.md deleted file mode 120000 index dd0ea36c..00000000 --- a/docs/README.md +++ /dev/null @@ -1 +0,0 @@ -index.md \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..c24ead53 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,296 @@ +### Table of Contents +1. [About](#About) +2. [Getting Started](#GettingStarted) + 1. [Installation](#Installation) + 1. [Windows](#WindowsInstallation) + 2. [Linux/BSD/MacOSX/POSIX](#PosixInstallation) + 1. [Gentoo Linux](#GentooInstallation) + 2. [Configuration](#Configuration) + 3. [Controlling and Querying btcd via btcctl](#BtcctlConfig) + 4. [Mining](#Mining) +3. [Help](#Help) + 1. [Startup](#Startup) + 1. [Using bootstrap.dat](#BootstrapDat) + 2. [Network Configuration](#NetworkConfig) + 3. [Wallet](#Wallet) +4. [Contact](#Contact) + 1. [IRC](#ContactIRC) + 2. [Mailing Lists](#MailingLists) +5. [Developer Resources](#DeveloperResources) + 1. [Code Contribution Guidelines](#ContributionGuidelines) + 2. [JSON-RPC Reference](#JSONRPCReference) + 3. [The btcsuite Bitcoin-related Go Packages](#GoPackages) + + + +### 1. About + +btcd is a full node bitcoin implementation written in [Go](http://golang.org), +licensed under the [copyfree](http://www.copyfree.org) ISC License. + +This project is currently under active development and is in a Beta state. It +is extremely stable and has been in production use since October 2013. + +It properly downloads, validates, and serves the block chain using the exact +rules (including consensus bugs) for block acceptance as Bitcoin Core. We have +taken great care to avoid btcd causing a fork to the block chain. It includes a +full block validation testing framework which contains all of the 'official' +block acceptance tests (and some additional ones) that is run on every pull +request to help ensure it properly follows consensus. Also, it passes all of +the JSON test data in the Bitcoin Core code. + +It also properly relays newly mined blocks, maintains a transaction pool, and +relays individual transactions that have not yet made it into a block. It +ensures all individual transactions admitted to the pool follow the rules +required by the block chain and also includes more strict checks which filter +transactions based on miner requirements ("standard" transactions). + +One key difference between btcd and Bitcoin Core is that btcd does *NOT* include +wallet functionality and this was a very intentional design decision. See the +blog entry [here](https://web.archive.org/web/20171125143919/https://blog.conformal.com/btcd-not-your-moms-bitcoin-daemon) +for more details. This means you can't actually make or receive payments +directly with btcd. That functionality is provided by the +[btcwallet](https://github.com/btcsuite/btcwallet) and +[Paymetheus](https://github.com/btcsuite/Paymetheus) (Windows-only) projects +which are both under active development. + + + +### 2. Getting Started + + + +**2.1 Installation** + +The first step is to install btcd. See one of the following sections for +details on how to install on the supported operating systems. + + + +**2.1.1 Windows Installation**
+ +* Install the MSI available at: https://github.com/btcsuite/btcd/releases +* Launch btcd from the Start Menu + +
+ +**2.1.2 Linux/BSD/MacOSX/POSIX Installation** + + +- Install Go according to the installation instructions here: + http://golang.org/doc/install + +- Ensure Go was installed properly and is a supported version: + +```bash +$ go version +$ go env GOROOT GOPATH +``` + +NOTE: The `GOROOT` and `GOPATH` above must not be the same path. It is +recommended that `GOPATH` is set to a directory in your home directory such as +`~/goprojects` to avoid write permission issues. It is also recommended to add +`$GOPATH/bin` to your `PATH` at this point. + +- Run the following commands to obtain btcd, all dependencies, and install it: + +```bash +$ git clone https://github.com/btcsuite/btcd $GOPATH/src/github.com/btcsuite/btcd +$ cd $GOPATH/src/github.com/btcsuite/btcd +$ GO111MODULE=on go install -v . ./cmd/... +``` + +- btcd (and utilities) will now be installed in ```$GOPATH/bin```. If you did + not already add the bin directory to your system path during Go installation, + we recommend you do so now. + +**Updating** + +- Run the following commands to update btcd, all dependencies, and install it: + +```bash +$ cd $GOPATH/src/github.com/btcsuite/btcd +$ git pull && GO111MODULE=on go install -v . ./cmd/... +``` + + + +**2.1.2.1 Gentoo Linux Installation** + +* Install Layman and enable the Bitcoin overlay. + * https://gitlab.com/bitcoin/gentoo +* Copy or symlink `/var/lib/layman/bitcoin/Documentation/package.keywords/btcd-live` to `/etc/portage/package.keywords/` +* Install btcd: `$ emerge net-p2p/btcd` + + + +**2.2 Configuration** + +btcd has a number of [configuration](http://godoc.org/github.com/btcsuite/btcd) +options, which can be viewed by running: `$ btcd --help`. + + + +**2.3 Controlling and Querying btcd via btcctl** + +btcctl is a command line utility that can be used to both control and query btcd +via [RPC](http://www.wikipedia.org/wiki/Remote_procedure_call). btcd does +**not** enable its RPC server by default; You must configure at minimum both an +RPC username and password or both an RPC limited username and password: + +* btcd.conf configuration file +``` +[Application Options] +rpcuser=myuser +rpcpass=SomeDecentp4ssw0rd +rpclimituser=mylimituser +rpclimitpass=Limitedp4ssw0rd +``` +* btcctl.conf configuration file +``` +[Application Options] +rpcuser=myuser +rpcpass=SomeDecentp4ssw0rd +``` +OR +``` +[Application Options] +rpclimituser=mylimituser +rpclimitpass=Limitedp4ssw0rd +``` +For a list of available options, run: `$ btcctl --help` + + + +**2.4 Mining** + +btcd supports the `getblocktemplate` RPC. +The limited user cannot access this RPC. + + +**1. Add the payment addresses with the `miningaddr` option.** + +``` +[Application Options] +rpcuser=myuser +rpcpass=SomeDecentp4ssw0rd +miningaddr=12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX +miningaddr=1M83ju3EChKYyysmM2FXtLNftbacagd8FR +``` + +**2. Add btcd's RPC TLS certificate to system Certificate Authority list.** + +`cgminer` uses [curl](http://curl.haxx.se/) to fetch data from the RPC server. +Since curl validates the certificate by default, we must install the `btcd` RPC +certificate into the default system Certificate Authority list. + +**Ubuntu** + +1. Copy rpc.cert to /usr/share/ca-certificates: `# cp /home/user/.btcd/rpc.cert /usr/share/ca-certificates/btcd.crt` +2. Add btcd.crt to /etc/ca-certificates.conf: `# echo btcd.crt >> /etc/ca-certificates.conf` +3. Update the CA certificate list: `# update-ca-certificates` + +**3. Set your mining software url to use https.** + +`$ cgminer -o https://127.0.0.1:9245 -u rpcuser -p rpcpassword` + + + +### 3. Help + + + +**3.1 Startup** + +Typically btcd will run and start downloading the block chain with no extra +configuration necessary, however, there is an optional method to use a +`bootstrap.dat` file that may speed up the initial block chain download process. + + + +**3.1.1 bootstrap.dat** + +* [Using bootstrap.dat](https://github.com/btcsuite/btcd/tree/master/docs/using_bootstrap_dat.md) + + + +**3.1.2 Network Configuration** + +* [What Ports Are Used by Default?](https://github.com/btcsuite/btcd/tree/master/docs/default_ports.md) +* [How To Listen on Specific Interfaces](https://github.com/btcsuite/btcd/tree/master/docs/configure_peer_server_listen_interfaces.md) +* [How To Configure RPC Server to Listen on Specific Interfaces](https://github.com/btcsuite/btcd/tree/master/docs/configure_rpc_server_listen_interfaces.md) +* [Configuring btcd with Tor](https://github.com/btcsuite/btcd/tree/master/docs/configuring_tor.md) + + + +**3.1 Wallet** + +btcd was intentionally developed without an integrated wallet for security +reasons. Please see [btcwallet](https://github.com/btcsuite/btcwallet) for more +information. + + + + +### 4. Contact + + + +**4.1 IRC** + +* [irc.freenode.net](irc://irc.freenode.net), channel `#btcd` + + + +**4.2 Mailing Lists** + +* btcd: discussion + of btcd and its packages. +* btcd-commits: + readonly mail-out of source code changes. + + + +### 5. Developer Resources + + + +* [Code Contribution Guidelines](https://github.com/btcsuite/btcd/tree/master/docs/code_contribution_guidelines.md) + + + +* [JSON-RPC Reference](https://github.com/btcsuite/btcd/tree/master/docs/json_rpc_api.md) + * [RPC Examples](https://github.com/btcsuite/btcd/tree/master/docs/json_rpc_api.md#ExampleCode) + + + +* The btcsuite Bitcoin-related Go Packages: + * [btcrpcclient](https://github.com/btcsuite/btcd/tree/master/rpcclient) - Implements a + robust and easy to use Websocket-enabled Bitcoin JSON-RPC client + * [btcjson](https://github.com/btcsuite/btcd/tree/master/btcjson) - Provides an extensive API + for the underlying JSON-RPC command and return values + * [wire](https://github.com/btcsuite/btcd/tree/master/wire) - Implements the + Bitcoin wire protocol + * [peer](https://github.com/btcsuite/btcd/tree/master/peer) - + Provides a common base for creating and managing Bitcoin network peers. + * [blockchain](https://github.com/btcsuite/btcd/tree/master/blockchain) - + Implements Bitcoin block handling and chain selection rules + * [blockchain/fullblocktests](https://github.com/btcsuite/btcd/tree/master/blockchain/fullblocktests) - + Provides a set of block tests for testing the consensus validation rules + * [txscript](https://github.com/btcsuite/btcd/tree/master/txscript) - + Implements the Bitcoin transaction scripting language + * [btcec](https://github.com/btcsuite/btcd/tree/master/btcec) - Implements + support for the elliptic curve cryptographic functions needed for the + Bitcoin scripts + * [database](https://github.com/btcsuite/btcd/tree/master/database) - + Provides a database interface for the Bitcoin block chain + * [mempool](https://github.com/btcsuite/btcd/tree/master/mempool) - + Package mempool provides a policy-enforced pool of unmined bitcoin + transactions. + * [btcutil](https://github.com/btcsuite/btcutil) - Provides Bitcoin-specific + convenience functions and types + * [chainhash](https://github.com/btcsuite/btcd/tree/master/chaincfg/chainhash) - + Provides a generic hash type and associated functions that allows the + specific hash algorithm to be abstracted. + * [connmgr](https://github.com/btcsuite/btcd/tree/master/connmgr) - + Package connmgr implements a generic Bitcoin network connection manager. diff --git a/docs/json_rpc_api.md b/docs/json_rpc_api.md index db292d2b..87ba4fec 100644 --- a/docs/json_rpc_api.md +++ b/docs/json_rpc_api.md @@ -47,7 +47,7 @@ differences between btcd and bitcoind as far as how RPCs are serviced: Websockets are the preferred transport for btcd RPC and are used by applications such as [btcwallet](https://github.com/btcsuite/btcwallet) for inter-process communication with btcd. The websocket connection endpoint for btcd is -`wss://your_ip_or_domain:8334/ws`. +`wss://your_ip_or_domain:9245/ws`. In addition to the [standard API](#Methods), an [extension API](#WSExtMethods) has been developed that is exclusive to clients using Websockets. In its current @@ -72,16 +72,16 @@ indicates, the [Websocket-specific extension](#WSExtMethods) methods can only be accessed when connected via Websockets. As mentioned in the [overview](#Overview), the websocket connection endpoint for -btcd is `wss://your_ip_or_domain:8334/ws`. +btcd is `wss://your_ip_or_domain:9245/ws`. The most important differences between the two transports as it pertains to the JSON-RPC API are: -| |HTTP POST Requests|Websockets| -|---|------------------|----------| -|Allows multiple requests across a single connection|No|Yes| -|Supports asynchronous notifications|No|Yes| -|Scales well with large numbers of requests|No|Yes| +| | HTTP POST Requests | Websockets | +| --------------------------------------------------- | ------------------ | ---------- | +| Allows multiple requests across a single connection | No | Yes | +| Supports asynchronous notifications | No | Yes | +| Scales well with large numbers of requests | No | Yes | @@ -156,38 +156,38 @@ API compatible with the original bitcoind/bitcoin-qt client. The following is an overview of the RPC methods and their current status. Click the method name for further details such as parameter and return information. -|#|Method|Safe for limited user?|Description| -|---|------|----------|-----------| -|1|[addnode](#addnode)|N|Attempts to add or remove a persistent peer.| -|2|[createrawtransaction](#createrawtransaction)|Y|Returns a new transaction spending the provided inputs and sending to the provided addresses.| -|3|[decoderawtransaction](#decoderawtransaction)|Y|Returns a JSON object representing the provided serialized, hex-encoded transaction.| -|4|[decodescript](#decodescript)|Y|Returns a JSON object with information about the provided hex-encoded script.| -|5|[getaddednodeinfo](#getaddednodeinfo)|N|Returns information about manually added (persistent) peers.| -|6|[getbestblockhash](#getbestblockhash)|Y|Returns the hash of the of the best (most recent) block in the longest block chain.| -|7|[getblock](#getblock)|Y|Returns information about a block given its hash.| -|8|[getblockcount](#getblockcount)|Y|Returns the number of blocks in the longest block chain.| -|9|[getblockhash](#getblockhash)|Y|Returns hash of the block in best block chain at the given height.| -|10|[getblockheader](#getblockheader)|Y|Returns the block header of the block.| -|11|[getconnectioncount](#getconnectioncount)|N|Returns the number of active connections to other peers.| -|12|[getdifficulty](#getdifficulty)|Y|Returns the proof-of-work difficulty as a multiple of the minimum difficulty.| -|13|[getgenerate](#getgenerate)|N|Return if the server is set to generate coins (mine) or not.| -|14|[gethashespersec](#gethashespersec)|N|Returns a recent hashes per second performance measurement while generating coins (mining).| -|15|[getinfo](#getinfo)|Y|Returns a JSON object containing various state info.| -|16|[getmempoolinfo](#getmempoolinfo)|N|Returns a JSON object containing mempool-related information.| -|17|[getmininginfo](#getmininginfo)|N|Returns a JSON object containing mining-related information.| -|18|[getnettotals](#getnettotals)|Y|Returns a JSON object containing network traffic statistics.| -|19|[getnetworkhashps](#getnetworkhashps)|Y|Returns the estimated network hashes per second for the block heights provided by the parameters.| -|20|[getpeerinfo](#getpeerinfo)|N|Returns information about each connected network peer as an array of json objects.| -|21|[getrawmempool](#getrawmempool)|Y|Returns an array of hashes for all of the transactions currently in the memory pool.| -|22|[getrawtransaction](#getrawtransaction)|Y|Returns information about a transaction given its hash.| -|23|[help](#help)|Y|Returns a list of all commands or help for a specified command.| -|24|[ping](#ping)|N|Queues a ping to be sent to each connected peer.| -|25|[sendrawtransaction](#sendrawtransaction)|Y|Submits the serialized, hex-encoded transaction to the local peer and relays it to the network.
btcd does not yet implement the `allowhighfees` parameter, so it has no effect| -|26|[setgenerate](#setgenerate) |N|Set the server to generate coins (mine) or not.
NOTE: Since btcd does not have the wallet integrated to provide payment addresses, btcd must be configured via the `--miningaddr` option to provide which payment addresses to pay created blocks to for this RPC to function.| -|27|[stop](#stop)|N|Shutdown btcd.| -|28|[submitblock](#submitblock)|Y|Attempts to submit a new serialized, hex-encoded block to the network.| -|29|[validateaddress](#validateaddress)|Y|Verifies the given address is valid. NOTE: Since btcd does not have a wallet integrated, btcd will only return whether the address is valid or not.| -|30|[verifychain](#verifychain)|N|Verifies the block chain database.| +| # | Method | Safe for limited user? | Description | +| --- | --------------------------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 1 | [addnode](#addnode) | N | Attempts to add or remove a persistent peer. | +| 2 | [createrawtransaction](#createrawtransaction) | Y | Returns a new transaction spending the provided inputs and sending to the provided addresses. | +| 3 | [decoderawtransaction](#decoderawtransaction) | Y | Returns a JSON object representing the provided serialized, hex-encoded transaction. | +| 4 | [decodescript](#decodescript) | Y | Returns a JSON object with information about the provided hex-encoded script. | +| 5 | [getaddednodeinfo](#getaddednodeinfo) | N | Returns information about manually added (persistent) peers. | +| 6 | [getbestblockhash](#getbestblockhash) | Y | Returns the hash of the of the best (most recent) block in the longest block chain. | +| 7 | [getblock](#getblock) | Y | Returns information about a block given its hash. | +| 8 | [getblockcount](#getblockcount) | Y | Returns the number of blocks in the longest block chain. | +| 9 | [getblockhash](#getblockhash) | Y | Returns hash of the block in best block chain at the given height. | +| 10 | [getblockheader](#getblockheader) | Y | Returns the block header of the block. | +| 11 | [getconnectioncount](#getconnectioncount) | N | Returns the number of active connections to other peers. | +| 12 | [getdifficulty](#getdifficulty) | Y | Returns the proof-of-work difficulty as a multiple of the minimum difficulty. | +| 13 | [getgenerate](#getgenerate) | N | Return if the server is set to generate coins (mine) or not. | +| 14 | [gethashespersec](#gethashespersec) | N | Returns a recent hashes per second performance measurement while generating coins (mining). | +| 15 | [getinfo](#getinfo) | Y | Returns a JSON object containing various state info. | +| 16 | [getmempoolinfo](#getmempoolinfo) | N | Returns a JSON object containing mempool-related information. | +| 17 | [getmininginfo](#getmininginfo) | N | Returns a JSON object containing mining-related information. | +| 18 | [getnettotals](#getnettotals) | Y | Returns a JSON object containing network traffic statistics. | +| 19 | [getnetworkhashps](#getnetworkhashps) | Y | Returns the estimated network hashes per second for the block heights provided by the parameters. | +| 20 | [getpeerinfo](#getpeerinfo) | N | Returns information about each connected network peer as an array of json objects. | +| 21 | [getrawmempool](#getrawmempool) | Y | Returns an array of hashes for all of the transactions currently in the memory pool. | +| 22 | [getrawtransaction](#getrawtransaction) | Y | Returns information about a transaction given its hash. | +| 23 | [help](#help) | Y | Returns a list of all commands or help for a specified command. | +| 24 | [ping](#ping) | N | Queues a ping to be sent to each connected peer. | +| 25 | [sendrawtransaction](#sendrawtransaction) | Y | Submits the serialized, hex-encoded transaction to the local peer and relays it to the network.
btcd does not yet implement the `allowhighfees` parameter, so it has no effect | +| 26 | [setgenerate](#setgenerate) | N | Set the server to generate coins (mine) or not.
NOTE: Since btcd does not have the wallet integrated to provide payment addresses, btcd must be configured via the `--miningaddr` option to provide which payment addresses to pay created blocks to for this RPC to function. | +| 27 | [stop](#stop) | N | Shutdown btcd. | +| 28 | [submitblock](#submitblock) | Y | Attempts to submit a new serialized, hex-encoded block to the network. | +| 29 | [validateaddress](#validateaddress) | Y | Verifies the given address is valid. NOTE: Since btcd does not have a wallet integrated, btcd will only return whether the address is valid or not. | +| 30 | [verifychain](#verifychain) | N | Verifies the block chain database. |
@@ -195,370 +195,370 @@ the method name for further details such as parameter and return information. -| | | -|---|---| -|Method|addnode| -|Parameters|1. peer (string, required) - ip address and port of the peer to operate on
2. command (string, required) - `add` to add a persistent peer, `remove` to remove a persistent peer, or `onetry` to try a single connection to a peer| -|Description|Attempts to add or remove a persistent peer.| -|Returns|Nothing| +| | | +| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | addnode | +| Parameters | 1. peer (string, required) - ip address and port of the peer to operate on
2. command (string, required) - `add` to add a persistent peer, `remove` to remove a persistent peer, or `onetry` to try a single connection to a peer | +| Description | Attempts to add or remove a persistent peer. | +| Returns | Nothing | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|createrawtransaction| -|Parameters|1. transaction inputs (JSON array, required) - json array of json objects
`[`
  `{`
    `"txid": "hash", (string, required) the hash of the input transaction`
    `"vout": n (numeric, required) the specific output of the input transaction to redeem`
  `}, ...`
`]`
2. addresses and amounts (JSON object, required) - json object with addresses as keys and amounts as values
`{`
  `"address": n.nnn (numeric, required) the address to send to as the key and the amount in BTC as the value`
  `, ...`
`}`
3. locktime (int64, optional, default=0) - specifies the transaction locktime. If non-zero, the inputs will also have their locktimes activated. | -|Description|Returns a new transaction spending the provided inputs and sending to the provided addresses.
The transaction inputs are not signed in the created transaction.
The `signrawtransaction` RPC command provided by wallet must be used to sign the resulting transaction.| -|Returns|`"transaction" (string) hex-encoded bytes of the serialized transaction`| -|Example Parameters|1. transaction inputs `[{"txid":"e6da89de7a6b8508ce8f371a3d0535b04b5e108cb1a6e9284602d3bfd357c018","vout":1}]`
2. addresses and amounts `{"13cgrTP7wgbZYWrY9BZ22BV6p82QXQT3nY": 0.49213337}`
3. locktime `0`| -|Example Return|`010000000118c057d3bfd3024628e9a6b18c105e4bb035053d1a378fce08856b7ade89dae6010000`
`0000ffffffff0199efee02000000001976a9141cb013db35ecccc156fdfd81d03a11c51998f99388`
`ac00000000`
**Newlines added for display purposes. The actual return does not contain newlines.**| +| | | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | createrawtransaction | +| Parameters | 1. transaction inputs (JSON array, required) - json array of json objects
`[`
  `{`
    `"txid": "hash", (string, required) the hash of the input transaction`
    `"vout": n (numeric, required) the specific output of the input transaction to redeem`
  `}, ...`
`]`
2. addresses and amounts (JSON object, required) - json object with addresses as keys and amounts as values
`{`
  `"address": n.nnn (numeric, required) the address to send to as the key and the amount in BTC as the value`
  `, ...`
`}`
3. locktime (int64, optional, default=0) - specifies the transaction locktime. If non-zero, the inputs will also have their locktimes activated. | +| Description | Returns a new transaction spending the provided inputs and sending to the provided addresses.
The transaction inputs are not signed in the created transaction.
The `signrawtransaction` RPC command provided by wallet must be used to sign the resulting transaction. | +| Returns | `"transaction" (string) hex-encoded bytes of the serialized transaction` | +| Example Parameters | 1. transaction inputs `[{"txid":"e6da89de7a6b8508ce8f371a3d0535b04b5e108cb1a6e9284602d3bfd357c018","vout":1}]`
2. addresses and amounts `{"13cgrTP7wgbZYWrY9BZ22BV6p82QXQT3nY": 0.49213337}`
3. locktime `0` | +| Example Return | `010000000118c057d3bfd3024628e9a6b18c105e4bb035053d1a378fce08856b7ade89dae6010000`
`0000ffffffff0199efee02000000001976a9141cb013db35ecccc156fdfd81d03a11c51998f99388`
`ac00000000`
**Newlines added for display purposes. The actual return does not contain newlines.** | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|decoderawtransaction| -|Parameters|1. data (string, required) - serialized, hex-encoded transaction| -|Description|Returns a JSON object representing the provided serialized, hex-encoded transaction.| -|Returns|`{ (json object)`
  `"txid": "hash", (string) the hash of the transaction`
  `"version": n, (numeric) the transaction version`
  `"locktime": n, (numeric) the transaction lock time`
  `"vin": [ (array of json objects) the transaction inputs as json objects`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "data", (string) the hex-encoded bytes of the signature script`
      `"sequence": n, (numeric) the script sequence number`
    `}`
  For non-coinbase transactions:
    `{ (json object)`
      `"txid": "hash", (string) the hash of the origin transaction`
      `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`
      `"scriptSig": { (json object) the signature script used to redeem the origin transaction`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
      `}`
      `"sequence": n, (numeric) the script sequence number`
    `}, ...`
  `]`
  `"vout": [ (array of json objects) the transaction outputs as json objects`
    `{ (json object)`
      `"value": n, (numeric) the value in BTC`
      `"n": n, (numeric) the index of this transaction output`
      `"scriptPubKey": { (json object) the public key script used to pay coins`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
        `"reqSigs": n, (numeric) the number of required signatures`
        `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`
        `"addresses": [ (json array of string) the bitcoin addresses associated with this output`
          `"bitcoinaddress", (string) the bitcoin address`
          `...`
        `]`
      `}`
    `}, ...`
  `]`
`}`| -|Example Return|`{`
  `"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",`
  `"version": 1,`
  `"locktime": 0,`
  `"vin": [`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6...",`
      `"sequence": 4294967295,`
    `}`
  For non-coinbase transactions:
    `{`
      `"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`
      `"vout": 0,`
      `"scriptSig": {`
        `"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`
        `"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`
      `}`
      `"sequence": 4294967295,`
    `}`
  `]`
  `"vout": [`
    `{`
      `"value": 50,`
      `"n": 0,`
      `"scriptPubKey": {`
        `"asm": "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4ce...",`
        `"hex": "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4...",`
        `"reqSigs": 1,`
        `"type": "pubkey"`
        `"addresses": [`
          `"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",`
        `]`
      `}`
    `}`
  `]`
`}`| +| | | +| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | decoderawtransaction | +| Parameters | 1. data (string, required) - serialized, hex-encoded transaction | +| Description | Returns a JSON object representing the provided serialized, hex-encoded transaction. | +| Returns | `{ (json object)`
  `"txid": "hash", (string) the hash of the transaction`
  `"version": n, (numeric) the transaction version`
  `"locktime": n, (numeric) the transaction lock time`
  `"vin": [ (array of json objects) the transaction inputs as json objects`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "data", (string) the hex-encoded bytes of the signature script`
      `"sequence": n, (numeric) the script sequence number`
    `}`
  For non-coinbase transactions:
    `{ (json object)`
      `"txid": "hash", (string) the hash of the origin transaction`
      `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`
      `"scriptSig": { (json object) the signature script used to redeem the origin transaction`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
      `}`
      `"sequence": n, (numeric) the script sequence number`
    `}, ...`
  `]`
  `"vout": [ (array of json objects) the transaction outputs as json objects`
    `{ (json object)`
      `"value": n, (numeric) the value in BTC`
      `"n": n, (numeric) the index of this transaction output`
      `"scriptPubKey": { (json object) the public key script used to pay coins`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
        `"reqSigs": n, (numeric) the number of required signatures`
        `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`
        `"addresses": [ (json array of string) the bitcoin addresses associated with this output`
          `"bitcoinaddress", (string) the bitcoin address`
          `...`
        `]`
      `}`
    `}, ...`
  `]`
`}` | +| Example Return | `{`
  `"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",`
  `"version": 1,`
  `"locktime": 0,`
  `"vin": [`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6...",`
      `"sequence": 4294967295,`
    `}`
  For non-coinbase transactions:
    `{`
      `"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`
      `"vout": 0,`
      `"scriptSig": {`
        `"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`
        `"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`
      `}`
      `"sequence": 4294967295,`
    `}`
  `]`
  `"vout": [`
    `{`
      `"value": 50,`
      `"n": 0,`
      `"scriptPubKey": {`
        `"asm": "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4ce...",`
        `"hex": "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4...",`
        `"reqSigs": 1,`
        `"type": "pubkey"`
        `"addresses": [`
          `"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",`
        `]`
      `}`
    `}`
  `]`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|decodescript| -|Parameters|1. script (string, required) - hex-encoded script| -|Description|Returns a JSON object with information about the provided hex-encoded script.| -|Returns|`{ (json object)`
  `"asm": "asm", (string) disassembly of the script`
  `"reqSigs": n, (numeric) the number of required signatures`
  `"type": "scripttype", (string) the type of the script (e.g. 'pubkeyhash')`
  `"addresses": [ (json array of string) the bitcoin addresses associated with this script`
    `"bitcoinaddress", (string) the bitcoin address`
    `...`
  `]`
  `"p2sh": "scripthash", (string) the script hash for use in pay-to-script-hash transactions`
`}`| -|Example Return|`{`
  `"asm": "OP_DUP OP_HASH160 b0a4d8a91981106e4ed85165a66748b19f7b7ad4 OP_EQUALVERIFY OP_CHECKSIG",`
  `"reqSigs": 1,`
  `"type": "pubkeyhash",`
  `"addresses": [`
    `"1H71QVBpzuLTNUh5pewaH3UTLTo2vWgcRJ"`
  `]`
  `"p2sh": "359b84ff799f48231990ff0298206f54117b08b6"`
`}`| +| | | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | decodescript | +| Parameters | 1. script (string, required) - hex-encoded script | +| Description | Returns a JSON object with information about the provided hex-encoded script. | +| Returns | `{ (json object)`
  `"asm": "asm", (string) disassembly of the script`
  `"reqSigs": n, (numeric) the number of required signatures`
  `"type": "scripttype", (string) the type of the script (e.g. 'pubkeyhash')`
  `"addresses": [ (json array of string) the bitcoin addresses associated with this script`
    `"bitcoinaddress", (string) the bitcoin address`
    `...`
  `]`
  `"p2sh": "scripthash", (string) the script hash for use in pay-to-script-hash transactions`
`}` | +| Example Return | `{`
  `"asm": "OP_DUP OP_HASH160 b0a4d8a91981106e4ed85165a66748b19f7b7ad4 OP_EQUALVERIFY OP_CHECKSIG",`
  `"reqSigs": 1,`
  `"type": "pubkeyhash",`
  `"addresses": [`
    `"1H71QVBpzuLTNUh5pewaH3UTLTo2vWgcRJ"`
  `]`
  `"p2sh": "359b84ff799f48231990ff0298206f54117b08b6"`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getaddednodeinfo| -|Parameters|1. dns (boolean, required) - specifies whether the returned data is a JSON object including DNS and connection information, or just a list of added peers
2. node (string, optional) - only return information about this specific peer instead of all added peers.| -|Description|Returns information about manually added (persistent) peers.| -|Returns (dns=false)|`["ip:port", ...]`| -|Returns (dns=true)|`[ (json array of objects)`
  `{ (json object)`
    `"addednode": "ip_or_domain", (string) the ip address or domain of the added peer`
    `"connected": true or false, (boolean) whether or not the peer is currently connected`
    `"addresses": [ (json array or objects) DNS lookup and connection information about the peer`
      `{ (json object)`
        `"address": "ip", (string) the ip address for this DNS entry`
        `"connected": "inbound/outbound/false" (string) the connection 'direction' (if connected)`
      `}, ...`
    `]`
  `}, ...`
`]`| -|Example Return (dns=false)|`["192.168.0.10:8333", "mydomain.org:8333"]`| -|Example Return (dns=true)|`[`
  `{`
    `"addednode": "mydomain.org:8333",`
    `"connected": true,`
    `"addresses": [`
      `{`
        `"address": "1.2.3.4",`
        `"connected": "outbound"`
      `},`
      `{`
        `"address": "5.6.7.8",`
        `"connected": "false"`
      `}`
    `]`
  `}`
`]`| +| | | +| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getaddednodeinfo | +| Parameters | 1. dns (boolean, required) - specifies whether the returned data is a JSON object including DNS and connection information, or just a list of added peers
2. node (string, optional) - only return information about this specific peer instead of all added peers. | +| Description | Returns information about manually added (persistent) peers. | +| Returns (dns=false) | `["ip:port", ...]` | +| Returns (dns=true) | `[ (json array of objects)`
  `{ (json object)`
    `"addednode": "ip_or_domain", (string) the ip address or domain of the added peer`
    `"connected": true or false, (boolean) whether or not the peer is currently connected`
    `"addresses": [ (json array or objects) DNS lookup and connection information about the peer`
      `{ (json object)`
        `"address": "ip", (string) the ip address for this DNS entry`
        `"connected": "inbound/outbound/false" (string) the connection 'direction' (if connected)`
      `}, ...`
    `]`
  `}, ...`
`]` | +| Example Return (dns=false) | `["192.168.0.10:8333", "mydomain.org:8333"]` | +| Example Return (dns=true) | `[`
  `{`
    `"addednode": "mydomain.org:8333",`
    `"connected": true,`
    `"addresses": [`
      `{`
        `"address": "1.2.3.4",`
        `"connected": "outbound"`
      `},`
      `{`
        `"address": "5.6.7.8",`
        `"connected": "false"`
      `}`
    `]`
  `}`
`]` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getbestblockhash| -|Parameters|None| -|Description|Returns the hash of the of the best (most recent) block in the longest block chain.| -|Returns|string| -|Example Return|`0000000000000001f356adc6b29ab42b59f913a396e170f80190dba615bd1e60`| +| | | +| -------------- | ----------------------------------------------------------------------------------- | +| Method | getbestblockhash | +| Parameters | None | +| Description | Returns the hash of the of the best (most recent) block in the longest block chain. | +| Returns | string | +| Example Return | `0000000000000001f356adc6b29ab42b59f913a396e170f80190dba615bd1e60` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getblock| -|Parameters|1. block hash (string, required) - the hash of the block
2. verbosity (int, optional, default=1) - Specifies whether the block data should be returned as a hex-encoded string (0), as parsed data with a slice of TXIDs (1), or as parsed data with parsed transaction data (2). -|Description|Returns information about a block given its hash.| -|Returns (verbosity=0)|`"data" (string) hex-encoded bytes of the serialized block`| -|Returns (verbosity=1)|`{ (json object)`
  `"hash": "blockhash", (string) the hash of the block (same as provided)`
  `"confirmations": n, (numeric) the number of confirmations`
  `"strippedsize", n (numeric) the size of the block without witness data`
  `"size": n, (numeric) the size of the block`
  `"weight": n, (numeric) value of the weight metric`
  `"height": n, (numeric) the height of the block in the block chain`
  `"version": n, (numeric) the block version`
  `"merkleroot": "hash", (string) root hash of the merkle tree`
  `"tx": [ (json array of string) the transaction hashes`
    `"transactionhash", (string) hash of the parent transaction`
    `...`
  `]`
  `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`
  `"nonce": n, (numeric) the block nonce`
  `"bits", n, (numeric) the bits which represent the block difficulty`
  `difficulty: n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`
  `"previousblockhash": "hash", (string) the hash of the previous block`
  `"nextblockhash": "hash", (string) the hash of the next block (only if there is one)`
`}`| -|Returns (verbosity=2)|`{ (json object)`
  `"hash": "blockhash", (string) the hash of the block (same as provided)`
  `"confirmations": n, (numeric) the number of confirmations`
  `"strippedsize", n (numeric) the size of the block without witness data`
  `"size": n, (numeric) the size of the block`
  `"weight": n, (numeric) value of the weight metric`
  `"height": n, (numeric) the height of the block in the block chain`
  `"version": n, (numeric) the block version`
  `"merkleroot": "hash", (string) root hash of the merkle tree`
  `"rawtx": [ (array of json objects) the transactions as json objects`
    `(see getrawtransaction json object details)`
  `]`
  `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`
  `"nonce": n, (numeric) the block nonce`
  `"bits", n, (numeric) the bits which represent the block difficulty`
  `difficulty: n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`
  `"previousblockhash": "hash", (string) the hash of the previous block`
  `"nextblockhash": "hash", (string) the hash of the next block`
`}`| -|Example Return (verbosity=0)|`"010000000000000000000000000000000000000000000000000000000000000000000000`
`3ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49`
`ffff001d1dac2b7c01010000000100000000000000000000000000000000000000000000`
`00000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f`
`4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f`
`6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104`
`678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f`
`4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"`
**Newlines added for display purposes. The actual return does not contain newlines.**| -|Example Return (verbosity=1)|`{`
  `"hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",`
  `"confirmations": 277113,`
  `"size": 285,`
  `"height": 0,`
  `"version": 1,`
  `"merkleroot": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",`
  `"tx": [`
    `"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"`
  `],`
  `"time": 1231006505,`
  `"nonce": 2083236893,`
  `"bits": "1d00ffff",`
  `"difficulty": 1,`
  `"previousblockhash": "0000000000000000000000000000000000000000000000000000000000000000",`
  `"nextblockhash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048"`
`}`| +| | | +| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getblock | +| Parameters | 1. block hash (string, required) - the hash of the block
2. verbosity (int, optional, default=1) - Specifies whether the block data should be returned as a hex-encoded string (0), as parsed data with a slice of TXIDs (1), or as parsed data with parsed transaction data (2). | +| Description | Returns information about a block given its hash. | +| Returns (verbosity=0) | `"data" (string) hex-encoded bytes of the serialized block` | +| Returns (verbosity=1) | `{ (json object)`
  `"hash": "blockhash", (string) the hash of the block (same as provided)`
  `"confirmations": n, (numeric) the number of confirmations`
  `"strippedsize", n (numeric) the size of the block without witness data`
  `"size": n, (numeric) the size of the block`
  `"weight": n, (numeric) value of the weight metric`
  `"height": n, (numeric) the height of the block in the block chain`
  `"version": n, (numeric) the block version`
  `"merkleroot": "hash", (string) root hash of the merkle tree`
  `"tx": [ (json array of string) the transaction hashes`
    `"transactionhash", (string) hash of the parent transaction`
    `...`
  `]`
  `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`
  `"nonce": n, (numeric) the block nonce`
  `"bits", n, (numeric) the bits which represent the block difficulty`
  `difficulty: n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`
  `"previousblockhash": "hash", (string) the hash of the previous block`
  `"nextblockhash": "hash", (string) the hash of the next block (only if there is one)`
`}` | +| Returns (verbosity=2) | `{ (json object)`
  `"hash": "blockhash", (string) the hash of the block (same as provided)`
  `"confirmations": n, (numeric) the number of confirmations`
  `"strippedsize", n (numeric) the size of the block without witness data`
  `"size": n, (numeric) the size of the block`
  `"weight": n, (numeric) value of the weight metric`
  `"height": n, (numeric) the height of the block in the block chain`
  `"version": n, (numeric) the block version`
  `"merkleroot": "hash", (string) root hash of the merkle tree`
  `"rawtx": [ (array of json objects) the transactions as json objects`
    `(see getrawtransaction json object details)`
  `]`
  `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`
  `"nonce": n, (numeric) the block nonce`
  `"bits", n, (numeric) the bits which represent the block difficulty`
  `difficulty: n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`
  `"previousblockhash": "hash", (string) the hash of the previous block`
  `"nextblockhash": "hash", (string) the hash of the next block`
`}` | +| Example Return (verbosity=0) | `"010000000000000000000000000000000000000000000000000000000000000000000000`
`3ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49`
`ffff001d1dac2b7c01010000000100000000000000000000000000000000000000000000`
`00000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f`
`4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f`
`6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104`
`678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f`
`4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"`
**Newlines added for display purposes. The actual return does not contain newlines.** | +| Example Return (verbosity=1) | `{`
  `"hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",`
  `"confirmations": 277113,`
  `"size": 285,`
  `"height": 0,`
  `"version": 1,`
  `"merkleroot": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",`
  `"tx": [`
    `"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"`
  `],`
  `"time": 1231006505,`
  `"nonce": 2083236893,`
  `"bits": "1d00ffff",`
  `"difficulty": 1,`
  `"previousblockhash": "0000000000000000000000000000000000000000000000000000000000000000",`
  `"nextblockhash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048"`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getblockcount| -|Parameters|None| -|Description|Returns the number of blocks in the longest block chain.| -|Returns|numeric| -|Example Return|`276820`| +| | | +| -------------- | -------------------------------------------------------- | +| Method | getblockcount | +| Parameters | None | +| Description | Returns the number of blocks in the longest block chain. | +| Returns | numeric | +| Example Return | `276820` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getblockhash| -|Parameters|1. block height (numeric, required)| -|Description|Returns hash of the block in best block chain at the given height.| -|Returns|string| -|Example Return|`000000000000000096579458d1c0f1531fcfc58d57b4fce51eb177d8d10e784d`| +| | | +| -------------- | ------------------------------------------------------------------ | +| Method | getblockhash | +| Parameters | 1. block height (numeric, required) | +| Description | Returns hash of the block in best block chain at the given height. | +| Returns | string | +| Example Return | `000000000000000096579458d1c0f1531fcfc58d57b4fce51eb177d8d10e784d` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getblockheader| -|Parameters|1. block hash (string, required) - the hash of the block
2. verbose (boolean, optional, default=true) - specifies the block header is returned as a JSON object instead of a hex-encoded string| -|Description|Returns hex-encoded bytes of the serialized block header.| -|Returns (verbose=false)|`"data" (string) hex-encoded bytes of the serialized block`| -|Returns (verbose=true)|`{ (json object)`
  `"hash": "blockhash", (string) the hash of the block (same as provided)`
  `"confirmations": n, (numeric) the number of confirmations`
  `"height": n, (numeric) the height of the block in the block chain`
  `"version": n, (numeric) the block version`
  `"merkleroot": "hash", (string) root hash of the merkle tree`
  `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`
  `"nonce": n, (numeric) the block nonce`
  `"bits": n, (numeric) the bits which represent the block difficulty`
  `"difficulty": n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`
  `"previousblockhash": "hash", (string) the hash of the previous block`
  `"nextblockhash": "hash", (string) the hash of the next block (only if there is one)`
`}`| -|Example Return (verbose=false)|`"0200000035ab154183570282ce9afc0b494c9fc6a3cfea05aa8c1add2ecc564900000000`
`38ba3d78e4500a5a7570dbe61960398add4410d278b21cd9708e6d9743f374d544fc0552`
`27f1001c29c1ea3b"`
**Newlines added for display purposes. The actual return does not contain newlines.**| -|Example Return (verbose=true)|`{`
  `"hash": "00000000009e2958c15ff9290d571bf9459e93b19765c6801ddeccadbb160a1e",`
  `"confirmations": 392076,`
  `"height": 100000,`
  `"version": 2,`
  `"merkleroot": "d574f343976d8e70d91cb278d21044dd8a396019e6db70755a0a50e4783dba38",`
  `"time": 1376123972,`
  `"nonce": 1005240617,`
  `"bits": "1c00f127",`
  `"difficulty": 271.75767393,`
  `"previousblockhash": "000000004956cc2edd1a8caa05eacfa3c69f4c490bfc9ace820257834115ab35",`
  `"nextblockhash": "0000000000629d100db387f37d0f37c51118f250fb0946310a8c37316cbc4028"`
`}`| +| | | +| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | getblockheader | +| Parameters | 1. block hash (string, required) - the hash of the block
2. verbose (boolean, optional, default=true) - specifies the block header is returned as a JSON object instead of a hex-encoded string | +| Description | Returns hex-encoded bytes of the serialized block header. | +| Returns (verbose=false) | `"data" (string) hex-encoded bytes of the serialized block` | +| Returns (verbose=true) | `{ (json object)`
  `"hash": "blockhash", (string) the hash of the block (same as provided)`
  `"confirmations": n, (numeric) the number of confirmations`
  `"height": n, (numeric) the height of the block in the block chain`
  `"version": n, (numeric) the block version`
  `"merkleroot": "hash", (string) root hash of the merkle tree`
  `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`
  `"nonce": n, (numeric) the block nonce`
  `"bits": n, (numeric) the bits which represent the block difficulty`
  `"difficulty": n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`
  `"previousblockhash": "hash", (string) the hash of the previous block`
  `"nextblockhash": "hash", (string) the hash of the next block (only if there is one)`
`}` | +| Example Return (verbose=false) | `"0200000035ab154183570282ce9afc0b494c9fc6a3cfea05aa8c1add2ecc564900000000`
`38ba3d78e4500a5a7570dbe61960398add4410d278b21cd9708e6d9743f374d544fc0552`
`27f1001c29c1ea3b"`
**Newlines added for display purposes. The actual return does not contain newlines.** | +| Example Return (verbose=true) | `{`
  `"hash": "00000000009e2958c15ff9290d571bf9459e93b19765c6801ddeccadbb160a1e",`
  `"confirmations": 392076,`
  `"height": 100000,`
  `"version": 2,`
  `"merkleroot": "d574f343976d8e70d91cb278d21044dd8a396019e6db70755a0a50e4783dba38",`
  `"time": 1376123972,`
  `"nonce": 1005240617,`
  `"bits": "1c00f127",`
  `"difficulty": 271.75767393,`
  `"previousblockhash": "000000004956cc2edd1a8caa05eacfa3c69f4c490bfc9ace820257834115ab35",`
  `"nextblockhash": "0000000000629d100db387f37d0f37c51118f250fb0946310a8c37316cbc4028"`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getconnectioncount| -|Parameters|None| -|Description|Returns the number of active connections to other peers| -|Returns|numeric| -|Example Return|`8`| +| | | +| -------------- | ------------------------------------------------------- | +| Method | getconnectioncount | +| Parameters | None | +| Description | Returns the number of active connections to other peers | +| Returns | numeric | +| Example Return | `8` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getdifficulty| -|Parameters|None| -|Description|Returns the proof-of-work difficulty as a multiple of the minimum difficulty.| -|Returns|numeric| -|Example Return|`1180923195.260000`| +| | | +| -------------- | ----------------------------------------------------------------------------- | +| Method | getdifficulty | +| Parameters | None | +| Description | Returns the proof-of-work difficulty as a multiple of the minimum difficulty. | +| Returns | numeric | +| Example Return | `1180923195.260000` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getgenerate| -|Parameters|None| -|Description|Return if the server is set to generate coins (mine) or not.| -|Returns|`false` (boolean)| +| | | +| ----------- | ------------------------------------------------------------ | +| Method | getgenerate | +| Parameters | None | +| Description | Return if the server is set to generate coins (mine) or not. | +| Returns | `false` (boolean) | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|gethashespersec| -|Parameters|None| -|Description|Returns a recent hashes per second performance measurement while generating coins (mining).| -|Returns|`0` (numeric)| +| | | +| ----------- | ------------------------------------------------------------------------------------------- | +| Method | gethashespersec | +| Parameters | None | +| Description | Returns a recent hashes per second performance measurement while generating coins (mining). | +| Returns | `0` (numeric) | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getinfo| -|Parameters|None| -|Description|Returns a JSON object containing various state info.| -|Notes|NOTE: Since btcd does NOT contain wallet functionality, wallet-related fields are not returned. See getinfo in btcwallet for a version which includes that information.| -|Returns|`{ (json object)`
  `"version": n, (numeric) the version of the server`
  `"protocolversion": n, (numeric) the latest supported protocol version`
  `"blocks": n, (numeric) the number of blocks processed`
  `"timeoffset": n, (numeric) the time offset`
  `"connections": n, (numeric) the number of connected peers`
  `"proxy": "host:port", (string) the proxy used by the server`
  `"difficulty": n.nn, (numeric) the current target difficulty`
  `"testnet": true or false, (boolean) whether or not server is using testnet`
  `"relayfee": n.nn, (numeric) the minimum relay fee for non-free transactions in BTC/KB`
`}`| -|Example Return|`{`
  `"version": 70000`
  `"protocolversion": 70001, `
  `"blocks": 298963,`
  `"timeoffset": 0,`
  `"connections": 17,`
  `"proxy": "",`
  `"difficulty": 8000872135.97,`
  `"testnet": false,`
  `"relayfee": 0.00001,`
`}`| +| | | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | getinfo | +| Parameters | None | +| Description | Returns a JSON object containing various state info. | +| Notes | NOTE: Since btcd does NOT contain wallet functionality, wallet-related fields are not returned. See getinfo in btcwallet for a version which includes that information. | +| Returns | `{ (json object)`
  `"version": n, (numeric) the version of the server`
  `"protocolversion": n, (numeric) the latest supported protocol version`
  `"blocks": n, (numeric) the number of blocks processed`
  `"timeoffset": n, (numeric) the time offset`
  `"connections": n, (numeric) the number of connected peers`
  `"proxy": "host:port", (string) the proxy used by the server`
  `"difficulty": n.nn, (numeric) the current target difficulty`
  `"testnet": true or false, (boolean) whether or not server is using testnet`
  `"relayfee": n.nn, (numeric) the minimum relay fee for non-free transactions in BTC/KB`
`}` | +| Example Return | `{`
  `"version": 70000`
  `"protocolversion": 70001, `
  `"blocks": 298963,`
  `"timeoffset": 0,`
  `"connections": 17,`
  `"proxy": "",`
  `"difficulty": 8000872135.97,`
  `"testnet": false,`
  `"relayfee": 0.00001,`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getmempoolinfo| -|Parameters|None| -|Description|Returns a JSON object containing mempool-related information.| -|Returns|`{ (json object)`
  `"bytes": n, (numeric) size in bytes of the mempool`
  `"size": n, (numeric) number of transactions in the mempool`
`}`| -Example Return|`{`
  `"bytes": 310768,`
  `"size": 157,`
`}`| +| | | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getmempoolinfo | +| Parameters | None | +| Description | Returns a JSON object containing mempool-related information. | +| Returns | `{ (json object)`
  `"bytes": n, (numeric) size in bytes of the mempool`
  `"size": n, (numeric) number of transactions in the mempool`
`}` | +| Example Return | `{`
  `"bytes": 310768,`
  `"size": 157,`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getmininginfo| -|Parameters|None| -|Description|Returns a JSON object containing mining-related information.| -|Returns|`{ (json object)`
  `"blocks": n, (numeric) latest best block`
  `"currentblocksize": n, (numeric) size of the latest best block`
  `"currentblockweight": n, (numeric) weight of the latest best block`
  `"currentblocktx": n, (numeric) number of transactions in the latest best block`
  `"difficulty": n.nn, (numeric) current target difficulty`
  `"errors": "errors", (string) any current errors`
  `"generate": true or false, (boolean) whether or not server is set to generate coins`
  `"genproclimit": n, (numeric) number of processors to use for coin generation (-1 when disabled)`
  `"hashespersec": n, (numeric) recent hashes per second performance measurement while generating coins`
  `"networkhashps": n, (numeric) estimated network hashes per second for the most recent blocks`
  `"pooledtx": n, (numeric) number of transactions in the memory pool`
  `"testnet": true or false, (boolean) whether or not server is using testnet`
`}`| -|Example Return|`{`
  `"blocks": 236526,`
  `"currentblocksize": 185,`
  `"currentblockweight": 740,`
  `"currentblocktx": 1,`
  `"difficulty": 256,`
  `"errors": "",`
  `"generate": false,`
  `"genproclimit": -1,`
  `"hashespersec": 0,`
  `"networkhashps": 33081554756,`
  `"pooledtx": 8,`
  `"testnet": true,`
`}`| +| | | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getmininginfo | +| Parameters | None | +| Description | Returns a JSON object containing mining-related information. | +| Returns | `{ (json object)`
  `"blocks": n, (numeric) latest best block`
  `"currentblocksize": n, (numeric) size of the latest best block`
  `"currentblockweight": n, (numeric) weight of the latest best block`
  `"currentblocktx": n, (numeric) number of transactions in the latest best block`
  `"difficulty": n.nn, (numeric) current target difficulty`
  `"errors": "errors", (string) any current errors`
  `"generate": true or false, (boolean) whether or not server is set to generate coins`
  `"genproclimit": n, (numeric) number of processors to use for coin generation (-1 when disabled)`
  `"hashespersec": n, (numeric) recent hashes per second performance measurement while generating coins`
  `"networkhashps": n, (numeric) estimated network hashes per second for the most recent blocks`
  `"pooledtx": n, (numeric) number of transactions in the memory pool`
  `"testnet": true or false, (boolean) whether or not server is using testnet`
`}` | +| Example Return | `{`
  `"blocks": 236526,`
  `"currentblocksize": 185,`
  `"currentblockweight": 740,`
  `"currentblocktx": 1,`
  `"difficulty": 256,`
  `"errors": "",`
  `"generate": false,`
  `"genproclimit": -1,`
  `"hashespersec": 0,`
  `"networkhashps": 33081554756,`
  `"pooledtx": 8,`
  `"testnet": true,`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getnettotals| -|Parameters|None| -|Description|Returns a JSON object containing network traffic statistics.| -|Returns|`{`
  `"totalbytesrecv": n, (numeric) total bytes received`
  `"totalbytessent": n, (numeric) total bytes sent`
  `"timemillis": n (numeric) number of milliseconds since 1 Jan 1970 GMT`
`}`| -|Example Return|`{`
  `"totalbytesrecv": 1150990,`
  `"totalbytessent": 206739,`
  `"timemillis": 1391626433845`
`}`| +| | | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getnettotals | +| Parameters | None | +| Description | Returns a JSON object containing network traffic statistics. | +| Returns | `{`
  `"totalbytesrecv": n, (numeric) total bytes received`
  `"totalbytessent": n, (numeric) total bytes sent`
  `"timemillis": n (numeric) number of milliseconds since 1 Jan 1970 GMT`
`}` | +| Example Return | `{`
  `"totalbytesrecv": 1150990,`
  `"totalbytessent": 206739,`
  `"timemillis": 1391626433845`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getnetworkhashps| -|Parameters|1. blocks (numeric, optional, default=120) - The number of blocks, or -1 for blocks since last difficulty change
2. height (numeric, optional, default=-1) - Perform estimate ending with this height or -1 for current best chain block height| -|Description|Returns the estimated network hashes per second for the block heights provided by the parameters.| -|Returns|numeric| -|Example Return|`6573971939`| +| | | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getnetworkhashps | +| Parameters | 1. blocks (numeric, optional, default=120) - The number of blocks, or -1 for blocks since last difficulty change
2. height (numeric, optional, default=-1) - Perform estimate ending with this height or -1 for current best chain block height | +| Description | Returns the estimated network hashes per second for the block heights provided by the parameters. | +| Returns | numeric | +| Example Return | `6573971939` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getpeerinfo| -|Parameters|None| -|Description|Returns data about each connected network peer as an array of json objects.| -|Returns|`[`
  `{`
    `"addr": "host:port", (string) the ip address and port of the peer`
    `"services": "00000001", (string) the services supported by the peer`
    `"lastrecv": n, (numeric) time the last message was received in seconds since 1 Jan 1970 GMT`
    `"lastsend": n, (numeric) time the last message was sent in seconds since 1 Jan 1970 GMT`
    `"bytessent": n, (numeric) total bytes sent`
    `"bytesrecv": n, (numeric) total bytes received`
    `"conntime": n, (numeric) time the connection was made in seconds since 1 Jan 1970 GMT`
    `"pingtime": n, (numeric) number of microseconds the last ping took`
    `"pingwait": n, (numeric) number of microseconds a queued ping has been waiting for a response`
    `"version": n, (numeric) the protocol version of the peer`
    `"subver": "useragent", (string) the user agent of the peer`
    `"inbound": true_or_false, (boolean) whether or not the peer is an inbound connection`
    `"startingheight": n, (numeric) the latest block height the peer knew about when the connection was established`
    `"currentheight": n, (numeric) the latest block height the peer is known to have relayed since connected`
    `"syncnode": true_or_false, (boolean) whether or not the peer is the sync peer`
  `}, ...`
`]`| -|Example Return|`[`
  `{`
    `"addr": "178.172.xxx.xxx:8333",`
    `"services": "00000001",`
    `"lastrecv": 1388183523,`
    `"lastsend": 1388185470,`
    `"bytessent": 287592965,`
    `"bytesrecv": 780340,`
    `"conntime": 1388182973,`
    `"pingtime": 405551,`
    `"pingwait": 183023,`
    `"version": 70001,`
    `"subver": "/btcd:0.4.0/",`
    `"inbound": false,`
    `"startingheight": 276921,`
    `"currentheight": 276955,`
    `"syncnode": true,`
  `}`
`]`| +| | | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getpeerinfo | +| Parameters | None | +| Description | Returns data about each connected network peer as an array of json objects. | +| Returns | `[`
  `{`
    `"addr": "host:port", (string) the ip address and port of the peer`
    `"services": "00000001", (string) the services supported by the peer`
    `"lastrecv": n, (numeric) time the last message was received in seconds since 1 Jan 1970 GMT`
    `"lastsend": n, (numeric) time the last message was sent in seconds since 1 Jan 1970 GMT`
    `"bytessent": n, (numeric) total bytes sent`
    `"bytesrecv": n, (numeric) total bytes received`
    `"conntime": n, (numeric) time the connection was made in seconds since 1 Jan 1970 GMT`
    `"pingtime": n, (numeric) number of microseconds the last ping took`
    `"pingwait": n, (numeric) number of microseconds a queued ping has been waiting for a response`
    `"version": n, (numeric) the protocol version of the peer`
    `"subver": "useragent", (string) the user agent of the peer`
    `"inbound": true_or_false, (boolean) whether or not the peer is an inbound connection`
    `"startingheight": n, (numeric) the latest block height the peer knew about when the connection was established`
    `"currentheight": n, (numeric) the latest block height the peer is known to have relayed since connected`
    `"syncnode": true_or_false, (boolean) whether or not the peer is the sync peer`
  `}, ...`
`]` | +| Example Return | `[`
  `{`
    `"addr": "178.172.xxx.xxx:8333",`
    `"services": "00000001",`
    `"lastrecv": 1388183523,`
    `"lastsend": 1388185470,`
    `"bytessent": 287592965,`
    `"bytesrecv": 780340,`
    `"conntime": 1388182973,`
    `"pingtime": 405551,`
    `"pingwait": 183023,`
    `"version": 70001,`
    `"subver": "/btcd:0.4.0/",`
    `"inbound": false,`
    `"startingheight": 276921,`
    `"currentheight": 276955,`
    `"syncnode": true,`
  `}`
`]` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getrawtransaction| -|Parameters|1. transaction hash (string, required) - the hash of the transaction
2. verbose (int, optional, default=0) - specifies the transaction is returned as a JSON object instead of hex-encoded string| -|Description|Returns information about a transaction given its hash.| -|Returns (verbose=0)|`"data" (string) hex-encoded bytes of the serialized transaction`| -|Returns (verbose=1)|`{ (json object)`
  `"hex": "data", (string) hex-encoded transaction`
  `"txid": "hash", (string) the hash of the transaction`
  `"version": n, (numeric) the transaction version`
  `"locktime": n, (numeric) the transaction lock time`
  `"vin": [ (array of json objects) the transaction inputs as json objects`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "data", (string) the hex-encoded bytes of the signature script`
      `"sequence": n, (numeric) the script sequence number`
    `"txinwitness": “data", (string) the witness stack for the input`
    `}`
  For non-coinbase transactions:
    `{ (json object)`
      `"txid": "hash", (string) the hash of the origin transaction`
      `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`
      `"scriptSig": { (json object) the signature script used to redeem the origin transaction`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
      `}`
      `"sequence": n, (numeric) the script sequence number`
    `"txinwitness": “data", (string) the witness stack for the input`
    `}, ...`
  `]`
  `"vout": [ (array of json objects) the transaction outputs as json objects`
    `{ (json object)`
      `"value": n, (numeric) the value in BTC`
      `"n": n, (numeric) the index of this transaction output`
      `"scriptPubKey": { (json object) the public key script used to pay coins`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
        `"reqSigs": n, (numeric) the number of required signatures`
        `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`
        `"addresses": [ (json array of string) the bitcoin addresses associated with this output`
          `"bitcoinaddress", (string) the bitcoin address`
          `...`
        `]`
      `}`
    `}, ...`
  `]`
`}`| -|Example Return (verbose=0)|`"010000000104be666c7053ef26c6110597dad1c1e81b5e6be53d17a8b9d0b34772054bac60000000`
`008c493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f`
`022100fbce8d84fcf2839127605818ac6c3e7a1531ebc69277c504599289fb1e9058df0141045a33`
`76eeb85e494330b03c1791619d53327441002832f4bd618fd9efa9e644d242d5e1145cb9c2f71965`
`656e276633d4ff1a6db5e7153a0a9042745178ebe0f5ffffffff0280841e00000000001976a91406`
`f1b6703d3f56427bfcfd372f952d50d04b64bd88ac4dd52700000000001976a9146b63f291c295ee`
`abd9aee6be193ab2d019e7ea7088ac00000000`
**Newlines added for display purposes. The actual return does not contain newlines.**| -|Example Return (verbose=1)|`{`
  `"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000f...",`
  `"txid": "90743aad855880e517270550d2a881627d84db5265142fd1e7fb7add38b08be9",`
  `"version": 1,`
  `"locktime": 0,`
  `"vin": [`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "03708203062f503253482f04066d605108f800080100000ea2122f6f7a636f696e4065757374726174756d2f",`
      `"sequence": 0,`
    `}`
  For non-coinbase transactions:
    `{`
      `"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`
      `"vout": 0,`
      `"scriptSig": {`
        `"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`
        `"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`
      `}`
      `"sequence": 4294967295,`
    `}`
  `]`
  `"vout": [`
    `{`
      `"value": 25.1394,`
      `"n": 0,`
      `"scriptPubKey": {`
        `"asm": "OP_DUP OP_HASH160 ea132286328cfc819457b9dec386c4b5c84faa5c OP_EQUALVERIFY OP_CHECKSIG",`
        `"hex": "76a914ea132286328cfc819457b9dec386c4b5c84faa5c88ac",`
        `"reqSigs": 1,`
        `"type": "pubkeyhash"`
        `"addresses": [`
          `"1NLg3QJMsMQGM5KEUaEu5ADDmKQSLHwmyh",`
        `]`
      `}`
    `}`
  `]`
`}`| +| | | +| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getrawtransaction | +| Parameters | 1. transaction hash (string, required) - the hash of the transaction
2. verbose (int, optional, default=0) - specifies the transaction is returned as a JSON object instead of hex-encoded string | +| Description | Returns information about a transaction given its hash. | +| Returns (verbose=0) | `"data" (string) hex-encoded bytes of the serialized transaction` | +| Returns (verbose=1) | `{ (json object)`
  `"hex": "data", (string) hex-encoded transaction`
  `"txid": "hash", (string) the hash of the transaction`
  `"version": n, (numeric) the transaction version`
  `"locktime": n, (numeric) the transaction lock time`
  `"vin": [ (array of json objects) the transaction inputs as json objects`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "data", (string) the hex-encoded bytes of the signature script`
      `"sequence": n, (numeric) the script sequence number`
    `"txinwitness": “data", (string) the witness stack for the input`
    `}`
  For non-coinbase transactions:
    `{ (json object)`
      `"txid": "hash", (string) the hash of the origin transaction`
      `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`
      `"scriptSig": { (json object) the signature script used to redeem the origin transaction`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
      `}`
      `"sequence": n, (numeric) the script sequence number`
    `"txinwitness": “data", (string) the witness stack for the input`
    `}, ...`
  `]`
  `"vout": [ (array of json objects) the transaction outputs as json objects`
    `{ (json object)`
      `"value": n, (numeric) the value in BTC`
      `"n": n, (numeric) the index of this transaction output`
      `"scriptPubKey": { (json object) the public key script used to pay coins`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
        `"reqSigs": n, (numeric) the number of required signatures`
        `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`
        `"addresses": [ (json array of string) the bitcoin addresses associated with this output`
          `"bitcoinaddress", (string) the bitcoin address`
          `...`
        `]`
      `}`
    `}, ...`
  `]`
`}` | +| Example Return (verbose=0) | `"010000000104be666c7053ef26c6110597dad1c1e81b5e6be53d17a8b9d0b34772054bac60000000`
`008c493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f`
`022100fbce8d84fcf2839127605818ac6c3e7a1531ebc69277c504599289fb1e9058df0141045a33`
`76eeb85e494330b03c1791619d53327441002832f4bd618fd9efa9e644d242d5e1145cb9c2f71965`
`656e276633d4ff1a6db5e7153a0a9042745178ebe0f5ffffffff0280841e00000000001976a91406`
`f1b6703d3f56427bfcfd372f952d50d04b64bd88ac4dd52700000000001976a9146b63f291c295ee`
`abd9aee6be193ab2d019e7ea7088ac00000000`
**Newlines added for display purposes. The actual return does not contain newlines.** | +| Example Return (verbose=1) | `{`
  `"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000f...",`
  `"txid": "90743aad855880e517270550d2a881627d84db5265142fd1e7fb7add38b08be9",`
  `"version": 1,`
  `"locktime": 0,`
  `"vin": [`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "03708203062f503253482f04066d605108f800080100000ea2122f6f7a636f696e4065757374726174756d2f",`
      `"sequence": 0,`
    `}`
  For non-coinbase transactions:
    `{`
      `"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`
      `"vout": 0,`
      `"scriptSig": {`
        `"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`
        `"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`
      `}`
      `"sequence": 4294967295,`
    `}`
  `]`
  `"vout": [`
    `{`
      `"value": 25.1394,`
      `"n": 0,`
      `"scriptPubKey": {`
        `"asm": "OP_DUP OP_HASH160 ea132286328cfc819457b9dec386c4b5c84faa5c OP_EQUALVERIFY OP_CHECKSIG",`
        `"hex": "76a914ea132286328cfc819457b9dec386c4b5c84faa5c88ac",`
        `"reqSigs": 1,`
        `"type": "pubkeyhash"`
        `"addresses": [`
          `"1NLg3QJMsMQGM5KEUaEu5ADDmKQSLHwmyh",`
        `]`
      `}`
    `}`
  `]`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|help| -|Parameters|1. command (string, optional) - the command to get help for| -|Description|Returns a list of all commands or help for a specified command.
When no `command` parameter is specified, a list of avaialable commands is returned
When `command` is a valid method, the help text for that method is returned.| -|Returns|string| -|Example Return|getblockcount
Returns a numeric for the number of blocks in the longest block chain.| +| | | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | help | +| Parameters | 1. command (string, optional) - the command to get help for | +| Description | Returns a list of all commands or help for a specified command.
When no `command` parameter is specified, a list of avaialable commands is returned
When `command` is a valid method, the help text for that method is returned. | +| Returns | string | +| Example Return | getblockcount
Returns a numeric for the number of blocks in the longest block chain. | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|ping| -|Parameters|None| -|Description|Queues a ping to be sent to each connected peer.
Ping times are provided by [getpeerinfo](#getpeerinfo) via the `pingtime` and `pingwait` fields.| -|Returns|Nothing| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | ping | +| Parameters | None | +| Description | Queues a ping to be sent to each connected peer.
Ping times are provided by [getpeerinfo](#getpeerinfo) via the `pingtime` and `pingwait` fields. | +| Returns | Nothing | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getrawmempool| -|Parameters|1. verbose (boolean, optional, default=false)| -|Description|Returns an array of hashes for all of the transactions currently in the memory pool.
The `verbose` flag specifies that each transaction is returned as a JSON object.| -|Notes|Since btcd does not perform any mining, the priority related fields `startingpriority` and `currentpriority` that are available when the `verbose` flag is set are always 0.| -|Returns (verbose=false)|`[ (json array of string)`
  `"transactionhash", (string) hash of the transaction`
  `...`
`]`| -|Returns (verbose=true)|`{ (json object)`
  `"transactionhash": { (json object)`
    `"size": n, (numeric) transaction size in bytes`
    `"vsize": n, (numeric) transaction virtual size`
    `"weight": n, (numeric) The transaction's weight (between vsize*4-3 and vsize*4)`
    `"fee" : n, (numeric) transaction fee in bitcoins`
    `"time": n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT`
    `"height": n, (numeric) block height when transaction entered the pool`
    `"startingpriority": n, (numeric) priority when transaction entered the pool`
    `"currentpriority": n, (numeric) current priority`
    `"depends": [ (json array) unconfirmed transactions used as inputs for this transaction`
      `"transactionhash", (string) hash of the parent transaction`
      `...`
    `]`
  `}, ...`
`}`| -|Example Return (verbose=false)|`[`
  `"3480058a397b6ffcc60f7e3345a61370fded1ca6bef4b58156ed17987f20d4e7",`
  `"cbfe7c056a358c3a1dbced5a22b06d74b8650055d5195c1c2469e6b63a41514a"`
`]`| -|Example Return (verbose=true)|`{`
  `"1697a19cede08694278f19584e8dcc87945f40c6b59a942dd8906f133ad3f9cc": {`
    `"size": 226,`
    `"fee" : 0.0001,`
    `"time": 1387992789,`
    `"height": 276836,`
    `"startingpriority": 0,`
    `"currentpriority": 0,`
    `"depends": [`
      `"aa96f672fcc5a1ec6a08a94aa46d6b789799c87bd6542967da25a96b2dee0afb",`
    `]`
`}`| +| | | +| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getrawmempool | +| Parameters | 1. verbose (boolean, optional, default=false) | +| Description | Returns an array of hashes for all of the transactions currently in the memory pool.
The `verbose` flag specifies that each transaction is returned as a JSON object. | +| Notes | Since btcd does not perform any mining, the priority related fields `startingpriority` and `currentpriority` that are available when the `verbose` flag is set are always 0. | +| Returns (verbose=false) | `[ (json array of string)`
  `"transactionhash", (string) hash of the transaction`
  `...`
`]` | +| Returns (verbose=true) | `{ (json object)`
  `"transactionhash": { (json object)`
    `"size": n, (numeric) transaction size in bytes`
    `"vsize": n, (numeric) transaction virtual size`
    `"weight": n, (numeric) The transaction's weight (between vsize*4-3 and vsize*4)`
    `"fee" : n, (numeric) transaction fee in bitcoins`
    `"time": n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT`
    `"height": n, (numeric) block height when transaction entered the pool`
    `"startingpriority": n, (numeric) priority when transaction entered the pool`
    `"currentpriority": n, (numeric) current priority`
    `"depends": [ (json array) unconfirmed transactions used as inputs for this transaction`
      `"transactionhash", (string) hash of the parent transaction`
      `...`
    `]`
  `}, ...`
`}` | +| Example Return (verbose=false) | `[`
  `"3480058a397b6ffcc60f7e3345a61370fded1ca6bef4b58156ed17987f20d4e7",`
  `"cbfe7c056a358c3a1dbced5a22b06d74b8650055d5195c1c2469e6b63a41514a"`
`]` | +| Example Return (verbose=true) | `{`
  `"1697a19cede08694278f19584e8dcc87945f40c6b59a942dd8906f133ad3f9cc": {`
    `"size": 226,`
    `"fee" : 0.0001,`
    `"time": 1387992789,`
    `"height": 276836,`
    `"startingpriority": 0,`
    `"currentpriority": 0,`
    `"depends": [`
      `"aa96f672fcc5a1ec6a08a94aa46d6b789799c87bd6542967da25a96b2dee0afb",`
    `]`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|setgenerate| -|Parameters|1. generate (boolean, required) - `true` to enable generation, `false` to disable it
2. genproclimit (numeric, optional) - the number of processors (cores) to limit generation to or `-1` for default| -|Description|Set the server to generate coins (mine) or not.| -|Notes|NOTE: Since btcd does not have the wallet integrated to provide payment addresses, btcd must be configured via the `--miningaddr` option to provide which payment addresses to pay created blocks to for this RPC to function.| -|Returns|Nothing| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | setgenerate | +| Parameters | 1. generate (boolean, required) - `true` to enable generation, `false` to disable it
2. genproclimit (numeric, optional) - the number of processors (cores) to limit generation to or `-1` for default | +| Description | Set the server to generate coins (mine) or not. | +| Notes | NOTE: Since btcd does not have the wallet integrated to provide payment addresses, btcd must be configured via the `--miningaddr` option to provide which payment addresses to pay created blocks to for this RPC to function. | +| Returns | Nothing | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|sendrawtransaction| -|Parameters|1. signedhex (string, required) serialized, hex-encoded signed transaction
2. allowhighfees (boolean, optional, default=false) whether or not to allow insanely high fees| -|Description|Submits the serialized, hex-encoded transaction to the local peer and relays it to the network.| -|Notes|btcd does not yet implement the `allowhighfees` parameter, so it has no effect| -|Returns|`"hash" (string) the hash of the transaction`| -|Example Return|`"1697a19cede08694278f19584e8dcc87945f40c6b59a942dd8906f133ad3f9cc"`| +| | | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | sendrawtransaction | +| Parameters | 1. signedhex (string, required) serialized, hex-encoded signed transaction
2. allowhighfees (boolean, optional, default=false) whether or not to allow insanely high fees | +| Description | Submits the serialized, hex-encoded transaction to the local peer and relays it to the network. | +| Notes | btcd does not yet implement the `allowhighfees` parameter, so it has no effect | +| Returns | `"hash" (string) the hash of the transaction` | +| Example Return | `"1697a19cede08694278f19584e8dcc87945f40c6b59a942dd8906f133ad3f9cc"` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|submitblock| -|Parameters|1. data (string, required) serialized, hex-encoded block
2. params (json object, optional, default=nil) this parameter is currently ignored| -|Description|Attempts to submit a new serialized, hex-encoded block to the network.| -|Returns (success)|Success: Nothing
Failure: `"rejected: reason"` (string)| +| | | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | submitblock | +| Parameters | 1. data (string, required) serialized, hex-encoded block
2. params (json object, optional, default=nil) this parameter is currently ignored | +| Description | Attempts to submit a new serialized, hex-encoded block to the network. | +| Returns (success) | Success: Nothing
Failure: `"rejected: reason"` (string) | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|stop| -|Parameters|None| -|Description|Shutdown btcd.| -|Returns|`"btcd stopping."` (string)| +| | | +| ----------- | --------------------------- | +| Method | stop | +| Parameters | None | +| Description | Shutdown btcd. | +| Returns | `"btcd stopping."` (string) | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|validateaddress| -|Parameters|1. address (string, required) - bitcoin address| -|Description|Verify an address is valid.| -|Returns|`{ (json object)`
  `"isvalid": true or false, (bool) whether or not the address is valid.`
  `"address": "bitcoinaddress", (string) the bitcoin address validated.`
}| +| | | +| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | validateaddress | +| Parameters | 1. address (string, required) - bitcoin address | +| Description | Verify an address is valid. | +| Returns | `{ (json object)`
  `"isvalid": true or false, (bool) whether or not the address is valid.`
  `"address": "bitcoinaddress", (string) the bitcoin address validated.`
} | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|verifychain| -|Parameters|1. checklevel (numeric, optional, default=3) - how in-depth the verification is (0=least amount of checks, higher levels are clamped to the highest supported level)
2. numblocks (numeric, optional, default=288) - the number of blocks starting from the end of the chain to verify| -|Description|Verifies the block chain database.
The actual checks performed by the `checklevel` parameter is implementation specific. For btcd this is:
`checklevel=0` - Look up each block and ensure it can be loaded from the database.
`checklevel=1` - Perform basic context-free sanity checks on each block.| -|Notes|Btcd currently only supports `checklevel` 0 and 1, but the default is still 3 for compatibility. Per the information in the Parameters section above, higher levels are automatically clamped to the highest supported level, so this means the default is effectively 1 for btcd.| -|Returns|`true` or `false` (boolean)| -|Example Return|`true`| +| | | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | verifychain | +| Parameters | 1. checklevel (numeric, optional, default=3) - how in-depth the verification is (0=least amount of checks, higher levels are clamped to the highest supported level)
2. numblocks (numeric, optional, default=288) - the number of blocks starting from the end of the chain to verify | +| Description | Verifies the block chain database.
The actual checks performed by the `checklevel` parameter is implementation specific. For btcd this is:
`checklevel=0` - Look up each block and ensure it can be loaded from the database.
`checklevel=1` - Perform basic context-free sanity checks on each block. | +| Notes | Btcd currently only supports `checklevel` 0 and 1, but the default is still 3 for compatibility. Per the information in the Parameters section above, higher levels are automatically clamped to the highest supported level, so this means the default is effectively 1 for btcd. | +| Returns | `true` or `false` (boolean) | +| Example Return | `true` | [Return to Overview](#MethodOverview)
@@ -572,16 +572,16 @@ Example Return|`{`
  `"bytes": 310768,`
  `"size": The following is an overview of the RPC methods which are implemented by btcd, but not the original bitcoind client. Click the method name for further details such as parameter and return information. -|#|Method|Safe for limited user?|Description| -|---|------|----------|-----------| -|1|[debuglevel](#debuglevel)|N|Dynamically changes the debug logging level.| -|2|[getbestblock](#getbestblock)|Y|Get block height and hash of best block in the main chain.|None| -|3|[getcurrentnet](#getcurrentnet)|Y|Get bitcoin network btcd is running on.|None| -|4|[searchrawtransactions](#searchrawtransactions)|Y|Query for transactions related to a particular address.|None| -|5|[node](#node)|N|Attempts to add or remove a peer. |None| -|6|[generate](#generate)|N|When in simnet or regtest mode, generate a set number of blocks. |None| -|7|[version](#version)|Y|Returns the JSON-RPC API version.| -|8|[getheaders](#getheaders)|Y|Returns block headers starting with the first known block hash from the request.| +| # | Method | Safe for limited user? | Description | +| --- | ----------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------- | +| 1 | [debuglevel](#debuglevel) | N | Dynamically changes the debug logging level. | +| 2 | [getbestblock](#getbestblock) | Y | Get block height and hash of best block in the main chain. | None | +| 3 | [getcurrentnet](#getcurrentnet) | Y | Get bitcoin network btcd is running on. | None | +| 4 | [searchrawtransactions](#searchrawtransactions) | Y | Query for transactions related to a particular address. | None | +| 5 | [node](#node) | N | Attempts to add or remove a peer. | None | +| 6 | [generate](#generate) | N | When in simnet or regtest mode, generate a set number of blocks. | None | +| 7 | [version](#version) | Y | Returns the JSON-RPC API version. | +| 8 | [getheaders](#getheaders) | Y | Returns block headers starting with the first known block hash from the request. |
@@ -590,102 +590,102 @@ The following is an overview of the RPC methods which are implemented by btcd, b -| | | -|---|---| -|Method|debuglevel| -|Parameters|1. _levelspec_ (string)| -|Description|Dynamically changes the debug logging level.
The levelspec can either a debug level or of the form `=,=,...`
The valid debug levels are `trace`, `debug`, `info`, `warn`, `error`, and `critical`.
The valid subsystems are `AMGR`, `ADXR`, `BCDB`, `BMGR`, `BTCD`, `CHAN`, `DISC`, `PEER`, `RPCS`, `SCRP`, `SRVR`, and `TXMP`.
Additionally, the special keyword `show` can be used to get a list of the available subsystems.| -|Returns|string| -|Example Return|`Done.`| -|Example `show` Return|`Supported subsystems [AMGR ADXR BCDB BMGR BTCD CHAN DISC PEER RPCS SCRP SRVR TXMP]`| +| | | +| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | debuglevel | +| Parameters | 1. _levelspec_ (string) | +| Description | Dynamically changes the debug logging level.
The levelspec can either a debug level or of the form `=,=,...`
The valid debug levels are `trace`, `debug`, `info`, `warn`, `error`, and `critical`.
The valid subsystems are `AMGR`, `ADXR`, `BCDB`, `BMGR`, `BTCD`, `CHAN`, `DISC`, `PEER`, `RPCS`, `SCRP`, `SRVR`, and `TXMP`.
Additionally, the special keyword `show` can be used to get a list of the available subsystems. | +| Returns | string | +| Example Return | `Done.` | +| Example `show` Return | `Supported subsystems [AMGR ADXR BCDB BMGR BTCD CHAN DISC PEER RPCS SCRP SRVR TXMP]` | [Return to Overview](#ExtMethodOverview)
***
-| | | -|---|---| -|Method|getbestblock| -|Parameters|None| -|Description|Get block height and hash of best block in the main chain.| -|Returns|`{ (json object)`
 `"hash": "data", (string) the hex-encoded bytes of the best block hash`
 `"height": n (numeric) the block height of the best block`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | getbestblock | +| Parameters | None | +| Description | Get block height and hash of best block in the main chain. | +| Returns | `{ (json object)`
 `"hash": "data", (string) the hex-encoded bytes of the best block hash`
 `"height": n (numeric) the block height of the best block`
`}` | [Return to Overview](#ExtMethodOverview)
***
-| | | -|---|---| -|Method|getcurrentnet| -|Parameters|None| -|Description|Get bitcoin network btcd is running on.| -|Returns|numeric| -|Example Return|`3652501241` (mainnet)
`118034699` (testnet3)| +| | | +| -------------- | -------------------------------------------------- | +| Method | getcurrentnet | +| Parameters | None | +| Description | Get bitcoin network btcd is running on. | +| Returns | numeric | +| Example Return | `3652501241` (mainnet)
`118034699` (testnet3) | [Return to Overview](#ExtMethodOverview)
***
-| | | -|---|---| -|Method|searchrawtransactions| -|Parameters|1. address (string, required) - bitcoin address
2. verbose (int, optional, default=true) - specifies the transaction is returned as a JSON object instead of hex-encoded string
3. skip (int, optional, default=0) - the number of leading transactions to leave out of the final response
4. count (int, optional, default=100) - the maximum number of transactions to return
5. vinextra (int, optional, default=0) - Specify that extra data from previous output will be returned in vin
6. reverse (boolean, optional, default=false) - Specifies that the transactions should be returned in reverse chronological order| -|Description|Returns raw data for transactions involving the passed address. Returned transactions are pulled from both the database, and transactions currently in the mempool. Transactions pulled from the mempool will have the `"confirmations"` field set to 0. Usage of this RPC requires the optional `--addrindex` flag to be activated, otherwise all responses will simply return with an error stating the address index has not yet been built up. Similarly, until the address index has caught up with the current best height, all requests will return an error response in order to avoid serving stale data.| -|Returns (verbose=0)|`[ (json array of strings)`
   `"serializedtx", ... hex-encoded bytes of the serialized transaction`
`]` | -|Returns (verbose=1)|`[ (array of json objects)`
   `{ (json object)`
  `"hex": "data", (string) hex-encoded transaction`
  `"txid": "hash", (string) the hash of the transaction`
  `"version": n, (numeric) the transaction version`
  `"locktime": n, (numeric) the transaction lock time`
  `"vin": [ (array of json objects) the transaction inputs as json objects`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "data", (string) the hex-encoded bytes of the signature script`
      `"txinwitness": “data", (string) the witness stack for the input`
    `"sequence": n, (numeric) the script sequence number`
    `}`
  For non-coinbase transactions:
    `{ (json object)`
      `"txid": "hash", (string) the hash of the origin transaction`
      `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`
      `"scriptSig": { (json object) the signature script used to redeem the origin transaction`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
      `}`
      `"prevOut": { (json object) Data from the origin transaction output with index vout.`
        `"addresses": ["value",...], (array of string) previous output addresses`
        `"value": n.nnn, (numeric) previous output value`
      `}`
      `"txinwitness": “data", (string) the witness stack for the input`
    `"sequence": n, (numeric) the script sequence number`
    `}, ...`
  `]`
  `"vout": [ (array of json objects) the transaction outputs as json objects`
    `{ (json object)`
      `"value": n, (numeric) the value in BTC`
      `"n": n, (numeric) the index of this transaction output`
      `"scriptPubKey": { (json object) the public key script used to pay coins`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
        `"reqSigs": n, (numeric) the number of required signatures`
        `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`
        `"addresses": [ (json array of string) the bitcoin addresses associated with this output`
          `"address", (string) the bitcoin address`
          `...`
        `]`
      `}`
    `}, ...`
   `]`
   `"blockhash":"hash" Hash of the block the transaction is part of.`
   `"confirmations":n, Number of numeric confirmations of block.`
   `"time":t, Transaction time in seconds since the epoch.`
   `"blocktime":t, Block time in seconds since the epoch.`
`},...`
`]`| +| | | +| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | searchrawtransactions | +| Parameters | 1. address (string, required) - bitcoin address
2. verbose (int, optional, default=true) - specifies the transaction is returned as a JSON object instead of hex-encoded string
3. skip (int, optional, default=0) - the number of leading transactions to leave out of the final response
4. count (int, optional, default=100) - the maximum number of transactions to return
5. vinextra (int, optional, default=0) - Specify that extra data from previous output will be returned in vin
6. reverse (boolean, optional, default=false) - Specifies that the transactions should be returned in reverse chronological order | +| Description | Returns raw data for transactions involving the passed address. Returned transactions are pulled from both the database, and transactions currently in the mempool. Transactions pulled from the mempool will have the `"confirmations"` field set to 0. Usage of this RPC requires the optional `--addrindex` flag to be activated, otherwise all responses will simply return with an error stating the address index has not yet been built up. Similarly, until the address index has caught up with the current best height, all requests will return an error response in order to avoid serving stale data. | +| Returns (verbose=0) | `[ (json array of strings)`
   `"serializedtx", ... hex-encoded bytes of the serialized transaction`
`]` | +| Returns (verbose=1) | `[ (array of json objects)`
   `{ (json object)`
  `"hex": "data", (string) hex-encoded transaction`
  `"txid": "hash", (string) the hash of the transaction`
  `"version": n, (numeric) the transaction version`
  `"locktime": n, (numeric) the transaction lock time`
  `"vin": [ (array of json objects) the transaction inputs as json objects`
  For coinbase transactions:
    `{ (json object)`
      `"coinbase": "data", (string) the hex-encoded bytes of the signature script`
      `"txinwitness": “data", (string) the witness stack for the input`
    `"sequence": n, (numeric) the script sequence number`
    `}`
  For non-coinbase transactions:
    `{ (json object)`
      `"txid": "hash", (string) the hash of the origin transaction`
      `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`
      `"scriptSig": { (json object) the signature script used to redeem the origin transaction`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
      `}`
      `"prevOut": { (json object) Data from the origin transaction output with index vout.`
        `"addresses": ["value",...], (array of string) previous output addresses`
        `"value": n.nnn, (numeric) previous output value`
      `}`
      `"txinwitness": “data", (string) the witness stack for the input`
    `"sequence": n, (numeric) the script sequence number`
    `}, ...`
  `]`
  `"vout": [ (array of json objects) the transaction outputs as json objects`
    `{ (json object)`
      `"value": n, (numeric) the value in BTC`
      `"n": n, (numeric) the index of this transaction output`
      `"scriptPubKey": { (json object) the public key script used to pay coins`
        `"asm": "asm", (string) disassembly of the script`
        `"hex": "data", (string) hex-encoded bytes of the script`
        `"reqSigs": n, (numeric) the number of required signatures`
        `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`
        `"addresses": [ (json array of string) the bitcoin addresses associated with this output`
          `"address", (string) the bitcoin address`
          `...`
        `]`
      `}`
    `}, ...`
   `]`
   `"blockhash":"hash" Hash of the block the transaction is part of.`
   `"confirmations":n, Number of numeric confirmations of block.`
   `"time":t, Transaction time in seconds since the epoch.`
   `"blocktime":t, Block time in seconds since the epoch.`
`},...`
`]` | [Return to Overview](#ExtMethodOverview)
***
-| | | -|---|---| -|Method|node| -|Parameters|1. command (string, required) - `connect` to add a peer (defaults to temporary), `remove` to remove a persistent peer, or `disconnect` to remove all matching non-persistent peers
2. peer (string, required) - ip address and port, or ID of the peer to operate on
3. connection type (string, optional) - `perm` indicates the peer should be added as a permanent peer, `temp` indicates a connection should only be attempted once. | -|Description|Attempts to add or remove a peer.| -|Returns|Nothing| +| | | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | node | +| Parameters | 1. command (string, required) - `connect` to add a peer (defaults to temporary), `remove` to remove a persistent peer, or `disconnect` to remove all matching non-persistent peers
2. peer (string, required) - ip address and port, or ID of the peer to operate on
3. connection type (string, optional) - `perm` indicates the peer should be added as a permanent peer, `temp` indicates a connection should only be attempted once. | +| Description | Attempts to add or remove a peer. | +| Returns | Nothing | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|generate| -|Parameters|1. numblocks (int, required) - The number of blocks to generate | -|Description|When in simnet or regtest mode, generates `numblocks` blocks. If blocks arrive from elsewhere, they are built upon but don't count toward the number of blocks to generate. Only generated blocks are returned. This RPC call will exit with an error if the server is already CPU mining, and will prevent the server from CPU mining for another command while it runs. | -|Returns|`[ (json array of strings)`
   `"blockhash", ... hash of the generated block`
`]` | +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | generate | +| Parameters | 1. numblocks (int, required) - The number of blocks to generate | +| Description | When in simnet or regtest mode, generates `numblocks` blocks. If blocks arrive from elsewhere, they are built upon but don't count toward the number of blocks to generate. Only generated blocks are returned. This RPC call will exit with an error if the server is already CPU mining, and will prevent the server from CPU mining for another command while it runs. | +| Returns | `[ (json array of strings)`
   `"blockhash", ... hash of the generated block`
`]` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|version| -|Parameters|None| -|Description|Returns the version of the JSON-RPC API built into this release of btcd.| -|Returns|`{ (json object)`
  `"btcdjsonrpcapi": {`
    `"versionstring": "x.y.z", (string) the version of the JSON-RPC API`
    `"major": x, (numeric) the major version of the JSON-RPC API`
    `"minor": y, (numeric) the minor version of the JSON-RPC API`
    `"patch": z, (numeric) the patch version of the JSON-RPC API`
    `"prerelease": "", (string) prerelease info for the JSON-RPC API`
    `"buildmetadata": "" (string) metadata about the server build`
  `}`
`}`| -|Example Return|`{`
  `"btcdjsonrpcapi": {`
    `"versionstring": "1.0.0",`
    `"major": 1, `
    `"minor": 0,`
    `"patch": 0,`
    `"prerelease": "",`
    `"buildmetadata": ""`
  `}`
`}`| +| | | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | version | +| Parameters | None | +| Description | Returns the version of the JSON-RPC API built into this release of btcd. | +| Returns | `{ (json object)`
  `"btcdjsonrpcapi": {`
    `"versionstring": "x.y.z", (string) the version of the JSON-RPC API`
    `"major": x, (numeric) the major version of the JSON-RPC API`
    `"minor": y, (numeric) the minor version of the JSON-RPC API`
    `"patch": z, (numeric) the patch version of the JSON-RPC API`
    `"prerelease": "", (string) prerelease info for the JSON-RPC API`
    `"buildmetadata": "" (string) metadata about the server build`
  `}`
`}` | +| Example Return | `{`
  `"btcdjsonrpcapi": {`
    `"versionstring": "1.0.0",`
    `"major": 1, `
    `"minor": 0,`
    `"patch": 0,`
    `"prerelease": "",`
    `"buildmetadata": ""`
  `}`
`}` | [Return to Overview](#MethodOverview)
***
-| | | -|---|---| -|Method|getheaders| -|Parameters|1. Block Locators (JSON array, required)
 `[ (json array of strings)`
  `"blocklocator", (string) the known block hash`
  `...`
 `]`
2. hashstop (string) - last desired block's hash| -|Description|Returns block headers starting with the first known block hash from the request.| -|Returns|`[ (json array of strings)`
  `"blockheader",`
  `...`
`]`| -|Example Return|`[`
  `"0000002099417930b2ae09feda10e38b58c0f6bb44b4d60fa33f0e000000000000000000d53...",`
  `"000000203ba25a173bfd24d09e0c76002a910b685ca297bd09a17b020000000000000000702..."`
`]`| +| | | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | getheaders | +| Parameters | 1. Block Locators (JSON array, required)
 `[ (json array of strings)`
  `"blocklocator", (string) the known block hash`
  `...`
 `]`
2. hashstop (string) - last desired block's hash | +| Description | Returns block headers starting with the first known block hash from the request. | +| Returns | `[ (json array of strings)`
  `"blockheader",`
  `...`
`]` | +| Example Return | `[`
  `"0000002099417930b2ae09feda10e38b58c0f6bb44b4d60fa33f0e000000000000000000d53...",`
  `"000000203ba25a173bfd24d09e0c76002a910b685ca297bd09a17b020000000000000000702..."`
`]` | [Return to Overview](#MethodOverview)
*** @@ -701,21 +701,21 @@ The following is an overview of the RPC methods which are implemented by btcd, b The following is an overview of the RPC method requests available exclusively to Websocket clients. All of these RPC methods are available to the limited user. Click the method name for further details such as parameter and return information. -|#|Method|Description|Notifications| -|---|------|-----------|-------------| -|1|[authenticate](#authenticate)|Authenticate the connection against the username and passphrase configured for the RPC server.
NOTE: This is only required if an HTTP Authorization header is not being used.|None| -|2|[notifyblocks](#notifyblocks)|Send notifications when a block is connected or disconnected from the best chain.|[blockconnected](#blockconnected), [blockdisconnected](#blockdisconnected), [filteredblockconnected](#filteredblockconnected), and [filteredblockdisconnected](#filteredblockdisconnected)| -|3|[stopnotifyblocks](#stopnotifyblocks)|Cancel registered notifications for whenever a block is connected or disconnected from the main (best) chain. |None| -|4|[notifyreceived](#notifyreceived)|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send notifications when a txout spends to an address.|[recvtx](#recvtx) and [redeemingtx](#redeemingtx)| -|5|[stopnotifyreceived](#stopnotifyreceived)|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered notifications for when a txout spends to any of the passed addresses.|None| -|6|[notifyspent](#notifyspent)|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send notification when a txout is spent.|[redeemingtx](#redeemingtx)| -|7|[stopnotifyspent](#stopnotifyspent)|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered spending notifications for each passed outpoint.|None| -|8|[rescan](#rescan)|*DEPRECATED, for similar functionality see [rescanblocks](#rescanblocks)*
Rescan block chain for transactions to addresses and spent transaction outpoints.|[recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished) | -|9|[notifynewtransactions](#notifynewtransactions)|Send notifications for all new transactions as they are accepted into the mempool.|[txaccepted](#txaccepted) or [txacceptedverbose](#txacceptedverbose)| -|10|[stopnotifynewtransactions](#stopnotifynewtransactions)|Stop sending either a txaccepted or a txacceptedverbose notification when a new transaction is accepted into the mempool.|None| -|11|[session](#session)|Return details regarding a websocket client's current connection.|None| -|12|[loadtxfilter](#loadtxfilter)|Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and rescanblocks.|[relevanttxaccepted](#relevanttxaccepted)| -|13|[rescanblocks](#rescanblocks)|Rescan blocks for transactions matching the loaded transaction filter.|None| +| # | Method | Description | Notifications | +| --- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| 1 | [authenticate](#authenticate) | Authenticate the connection against the username and passphrase configured for the RPC server.
NOTE: This is only required if an HTTP Authorization header is not being used. | None | +| 2 | [notifyblocks](#notifyblocks) | Send notifications when a block is connected or disconnected from the best chain. | [blockconnected](#blockconnected), [blockdisconnected](#blockdisconnected), [filteredblockconnected](#filteredblockconnected), and [filteredblockdisconnected](#filteredblockdisconnected) | +| 3 | [stopnotifyblocks](#stopnotifyblocks) | Cancel registered notifications for whenever a block is connected or disconnected from the main (best) chain. | None | +| 4 | [notifyreceived](#notifyreceived) | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send notifications when a txout spends to an address. | [recvtx](#recvtx) and [redeemingtx](#redeemingtx) | +| 5 | [stopnotifyreceived](#stopnotifyreceived) | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered notifications for when a txout spends to any of the passed addresses. | None | +| 6 | [notifyspent](#notifyspent) | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send notification when a txout is spent. | [redeemingtx](#redeemingtx) | +| 7 | [stopnotifyspent](#stopnotifyspent) | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered spending notifications for each passed outpoint. | None | +| 8 | [rescan](#rescan) | *DEPRECATED, for similar functionality see [rescanblocks](#rescanblocks)*
Rescan block chain for transactions to addresses and spent transaction outpoints. | [recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished) | +| 9 | [notifynewtransactions](#notifynewtransactions) | Send notifications for all new transactions as they are accepted into the mempool. | [txaccepted](#txaccepted) or [txacceptedverbose](#txacceptedverbose) | +| 10 | [stopnotifynewtransactions](#stopnotifynewtransactions) | Stop sending either a txaccepted or a txacceptedverbose notification when a new transaction is accepted into the mempool. | None | +| 11 | [session](#session) | Return details regarding a websocket client's current connection. | None | +| 12 | [loadtxfilter](#loadtxfilter) | Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and rescanblocks. | [relevanttxaccepted](#relevanttxaccepted) | +| 13 | [rescanblocks](#rescanblocks) | Rescan blocks for transactions matching the loaded transaction filter. | None |
@@ -723,170 +723,170 @@ user. Click the method name for further details such as parameter and return in -| | | -|---|---| -|Method|authenticate| -|Parameters|1. username (string, required)
2. passphrase (string, required)| -|Description|Authenticate the connection against the username and password configured for the RPC server.
Invoking any other method before authenticating with this command will close the connection.
NOTE: This is only required if an HTTP Authorization header is not being used.| -|Returns|Success: Nothing
Failure: Nothing (websocket disconnected)| +| | | +| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | authenticate | +| Parameters | 1. username (string, required)
2. passphrase (string, required) | +| Description | Authenticate the connection against the username and password configured for the RPC server.
Invoking any other method before authenticating with this command will close the connection.
NOTE: This is only required if an HTTP Authorization header is not being used. | +| Returns | Success: Nothing
Failure: Nothing (websocket disconnected) | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|notifyblocks| -|Notifications|[blockconnected](#blockconnected), [blockdisconnected](#blockdisconnected), [filteredblockconnected](#filteredblockconnected), and [filteredblockdisconnected](#filteredblockdisconnected)| -|Parameters|None| -|Description|Request notifications for whenever a block is connected or disconnected from the main (best) chain.
NOTE: If a client subscribes to both block and transaction (recvtx and redeemingtx) notifications, the blockconnected notification will be sent after all transaction notifications have been sent. This allows clients to know when all relevant transactions for a block have been received.| -|Returns|Nothing| +| | | +| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | notifyblocks | +| Notifications | [blockconnected](#blockconnected), [blockdisconnected](#blockdisconnected), [filteredblockconnected](#filteredblockconnected), and [filteredblockdisconnected](#filteredblockdisconnected) | +| Parameters | None | +| Description | Request notifications for whenever a block is connected or disconnected from the main (best) chain.
NOTE: If a client subscribes to both block and transaction (recvtx and redeemingtx) notifications, the blockconnected notification will be sent after all transaction notifications have been sent. This allows clients to know when all relevant transactions for a block have been received. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|stopnotifyblocks| -|Notifications|None| -|Parameters|None| -|Description|Cancel sending notifications for whenever a block is connected or disconnected from the main (best) chain.| -|Returns|Nothing| +| | | +| ------------- | ---------------------------------------------------------------------------------------------------------- | +| Method | stopnotifyblocks | +| Notifications | None | +| Parameters | None | +| Description | Cancel sending notifications for whenever a block is connected or disconnected from the main (best) chain. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|notifyreceived| -|Notifications|[recvtx](#recvtx) and [redeemingtx](#redeemingtx)| -|Parameters|1. Addresses (JSON array, required)
 `[ (json array of strings)`
  `"bitcoinaddress", (string) the bitcoin address`
  `...`
 `]`| -|Description|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send a recvtx notification when a transaction added to mempool or appears in a newly-attached block contains a txout pkScript sending to any of the passed addresses. Matching outpoints are automatically registered for redeemingtx notifications.| -|Returns|Nothing| +| | | +| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | notifyreceived | +| Notifications | [recvtx](#recvtx) and [redeemingtx](#redeemingtx) | +| Parameters | 1. Addresses (JSON array, required)
 `[ (json array of strings)`
  `"bitcoinaddress", (string) the bitcoin address`
  `...`
 `]` | +| Description | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send a recvtx notification when a transaction added to mempool or appears in a newly-attached block contains a txout pkScript sending to any of the passed addresses. Matching outpoints are automatically registered for redeemingtx notifications. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|stopnotifyreceived| -|Notifications|None| -|Parameters|1. Addresses (JSON array, required)
 `[ (json array of strings)`
  `"bitcoinaddress", (string) the bitcoin address`
  `...`
 `]`| -|Description|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered receive notifications for each passed address.| -|Returns|Nothing| +| | | +| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | stopnotifyreceived | +| Notifications | None | +| Parameters | 1. Addresses (JSON array, required)
 `[ (json array of strings)`
  `"bitcoinaddress", (string) the bitcoin address`
  `...`
 `]` | +| Description | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered receive notifications for each passed address. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|notifyspent| -|Notifications|[redeemingtx](#redeemingtx)| -|Parameters|1. Outpoints (JSON array, required)
 `[ (JSON array)`
  `{ (JSON object)`
   `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`
   `"index":n (numeric) the txout index of the outpoint`
  `},`
  `...`
 `]`| -|Description|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send a redeemingtx notification when a transaction spending an outpoint appears in mempool (if relayed to this btcd instance) and when such a transaction first appears in a newly-attached block.| -|Returns|Nothing| +| | | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | notifyspent | +| Notifications | [redeemingtx](#redeemingtx) | +| Parameters | 1. Outpoints (JSON array, required)
 `[ (JSON array)`
  `{ (JSON object)`
   `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`
   `"index":n (numeric) the txout index of the outpoint`
  `},`
  `...`
 `]` | +| Description | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Send a redeemingtx notification when a transaction spending an outpoint appears in mempool (if relayed to this btcd instance) and when such a transaction first appears in a newly-attached block. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|stopnotifyspent| -|Notifications|None| -|Parameters|1. Outpoints (JSON array, required)
 `[ (JSON array)`
  `{ (JSON object)`
   `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`
   `"index":n (numeric) the txout index of the outpoint`
  `},`
  `...`
 `]`| -|Description|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered spending notifications for each passed outpoint.| -|Returns|Nothing| +| | | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | stopnotifyspent | +| Notifications | None | +| Parameters | 1. Outpoints (JSON array, required)
 `[ (JSON array)`
  `{ (JSON object)`
   `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`
   `"index":n (numeric) the txout index of the outpoint`
  `},`
  `...`
 `]` | +| Description | *DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*
Cancel registered spending notifications for each passed outpoint. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|rescan| -|Notifications|[recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished)| -|Parameters|1. BeginBlock (string, required) block hash to begin rescanning from
2. Addresses (JSON array, required)
 `[ (json array of strings)`
  `"bitcoinaddress", (string) the bitcoin address`
  `...`
 `]`
3. Outpoints (JSON array, required)
 `[ (JSON array)`
  `{ (JSON object)`
   `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`
   `"index":n (numeric) the txout index of the outpoint`
  `},`
  `...`
 `]`
4. EndBlock (string, optional) hash of final block to rescan| -|Description|*DEPRECATED, for similar functionality see [rescanblocks](#rescanblocks)*
Rescan block chain for transactions to addresses, starting at block BeginBlock and ending at EndBlock. The current known UTXO set for all passed addresses at height BeginBlock should included in the Outpoints argument. If EndBlock is omitted, the rescan continues through the best block in the main chain. Additionally, if no EndBlock is provided, the client is automatically registered for transaction notifications for all rescanned addresses and the final UTXO set. Rescan results are sent as recvtx and redeemingtx notifications. This call returns once the rescan completes.| -|Returns|Nothing| +| | | +| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | rescan | +| Notifications | [recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished) | +| Parameters | 1. BeginBlock (string, required) block hash to begin rescanning from
2. Addresses (JSON array, required)
 `[ (json array of strings)`
  `"bitcoinaddress", (string) the bitcoin address`
  `...`
 `]`
3. Outpoints (JSON array, required)
 `[ (JSON array)`
  `{ (JSON object)`
   `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`
   `"index":n (numeric) the txout index of the outpoint`
  `},`
  `...`
 `]`
4. EndBlock (string, optional) hash of final block to rescan | +| Description | *DEPRECATED, for similar functionality see [rescanblocks](#rescanblocks)*
Rescan block chain for transactions to addresses, starting at block BeginBlock and ending at EndBlock. The current known UTXO set for all passed addresses at height BeginBlock should included in the Outpoints argument. If EndBlock is omitted, the rescan continues through the best block in the main chain. Additionally, if no EndBlock is provided, the client is automatically registered for transaction notifications for all rescanned addresses and the final UTXO set. Rescan results are sent as recvtx and redeemingtx notifications. This call returns once the rescan completes. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|notifynewtransactions| -|Notifications|[txaccepted](#txaccepted) or [txacceptedverbose](#txacceptedverbose)| -|Parameters|1. verbose (boolean, optional, default=false) - specifies which type of notification to receive. If verbose is true, then the caller receives [txacceptedverbose](#txacceptedverbose), otherwise the caller receives [txaccepted](#txaccepted)| -|Description|Send either a [txaccepted](#txaccepted) or a [txacceptedverbose](#txacceptedverbose) notification when a new transaction is accepted into the mempool.| -|Returns|Nothing| +| | | +| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | notifynewtransactions | +| Notifications | [txaccepted](#txaccepted) or [txacceptedverbose](#txacceptedverbose) | +| Parameters | 1. verbose (boolean, optional, default=false) - specifies which type of notification to receive. If verbose is true, then the caller receives [txacceptedverbose](#txacceptedverbose), otherwise the caller receives [txaccepted](#txaccepted) | +| Description | Send either a [txaccepted](#txaccepted) or a [txacceptedverbose](#txacceptedverbose) notification when a new transaction is accepted into the mempool. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|stopnotifynewtransactions| -|Notifications|None| -|Parameters|None| -|Description|Stop sending either a [txaccepted](#txaccepted) or a [txacceptedverbose](#txacceptedverbose) notification when a new transaction is accepted into the mempool.| -|Returns|Nothing| +| | | +| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | stopnotifynewtransactions | +| Notifications | None | +| Parameters | None | +| Description | Stop sending either a [txaccepted](#txaccepted) or a [txacceptedverbose](#txacceptedverbose) notification when a new transaction is accepted into the mempool. | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|session| -|Notifications|None| -|Parameters|None| -|Description|Return a JSON object with details regarding a websocket client's current connection to the RPC server. This currently only includes the session ID, a random unsigned 64-bit integer that is created for each newly connected client. Session IDs may be used to verify that the current connection was not lost and subsequently reestablished.| -|Returns|`{ (json object)`
  `"sessionid": n (numeric) the session ID`
`}`| -|Example Return|`{`
  `"sessionid": 67089679842`
`}`| +| | | +| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | session | +| Notifications | None | +| Parameters | None | +| Description | Return a JSON object with details regarding a websocket client's current connection to the RPC server. This currently only includes the session ID, a random unsigned 64-bit integer that is created for each newly connected client. Session IDs may be used to verify that the current connection was not lost and subsequently reestablished. | +| Returns | `{ (json object)`
  `"sessionid": n (numeric) the session ID`
`}` | +| Example Return | `{`
  `"sessionid": 67089679842`
`}` | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|loadtxfilter| -|Notifications|[relevanttxaccepted](#relevanttxaccepted)| -|Parameters|1. Reload (boolean, required) - Load a new filter instead of adding data to an existing one
2. Addresses (JSON array, required) - Array of addresses to add to the transaction filter
3. Outpoints (JSON array, required) - Array of outpoints to add to the transaction filter| -|Description|Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and [rescanblocks](#rescanblocks).| -|Returns|Nothing| +| | | +| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | loadtxfilter | +| Notifications | [relevanttxaccepted](#relevanttxaccepted) | +| Parameters | 1. Reload (boolean, required) - Load a new filter instead of adding data to an existing one
2. Addresses (JSON array, required) - Array of addresses to add to the transaction filter
3. Outpoints (JSON array, required) - Array of outpoints to add to the transaction filter | +| Description | Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and [rescanblocks](#rescanblocks). | +| Returns | Nothing | [Return to Overview](#WSExtMethodOverview)
***
-| | | -|---|---| -|Method|rescanblocks| -|Notifications|None| -|Parameters|1. Blockhashes (JSON array, required) - List of hashes to rescan. Each next block must be a child of the previous.| -|Description|Rescan blocks for transactions matching the loaded transaction filter.| -|Returns|`[ (JSON array)`
  `{ (JSON object)`
    `"hash": "data", (string) Hash of the matching block.`
    `"transactions": [ (JSON array) List of matching transactions, serialized and hex-encoded.`
      `"serializedtx" (string) Serialized and hex-encoded transaction.`
    `]`
  `}`
`]`| -|Example Return|`[`
  `{`
    `"hash": "0000002099417930b2ae09feda10e38b58c0f6bb44b4d60fa33f0e000000000000000000d53...",`
    `"transactions": [`
      `"493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8..."`
    `]`
  `}`
`]`| +| | | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | rescanblocks | +| Notifications | None | +| Parameters | 1. Blockhashes (JSON array, required) - List of hashes to rescan. Each next block must be a child of the previous. | +| Description | Rescan blocks for transactions matching the loaded transaction filter. | +| Returns | `[ (JSON array)`
  `{ (JSON object)`
    `"hash": "data", (string) Hash of the matching block.`
    `"transactions": [ (JSON array) List of matching transactions, serialized and hex-encoded.`
      `"serializedtx" (string) Serialized and hex-encoded transaction.`
    `]`
  `}`
`]` | +| Example Return | `[`
  `{`
    `"hash": "0000002099417930b2ae09feda10e38b58c0f6bb44b4d60fa33f0e000000000000000000d53...",`
    `"transactions": [`
      `"493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8..."`
    `]`
  `}`
`]` |
@@ -901,19 +901,19 @@ btcd uses standard JSON-RPC notifications to notify clients of changes, rather t The following is an overview of the JSON-RPC notifications used for Websocket connections. Click the method name for further details of the context(s) in which they are sent and their parameters. -|#|Method|Description|Request| -|---|------|-----------|-------| -|1|[blockconnected](#blockconnected)|*DEPRECATED, for similar functionality see [filteredblockconnected](#filteredblockconnected)*
Block connected to the main chain.|[notifyblocks](#notifyblocks)| -|2|[blockdisconnected](#blockdisconnected)|*DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*
Block disconnected from the main chain.|[notifyblocks](#notifyblocks)| -|3|[recvtx](#recvtx)|*DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Processed a transaction output spending to a wallet address.|[notifyreceived](#notifyreceived) and [rescan](#rescan)| -|4|[redeemingtx](#redeemingtx)|*DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Processed a transaction that spends a registered outpoint.|[notifyspent](#notifyspent) and [rescan](#rescan)| -|5|[txaccepted](#txaccepted)|Received a new transaction after requesting simple notifications of all new transactions accepted into the mempool.|[notifynewtransactions](#notifynewtransactions)| -|6|[txacceptedverbose](#txacceptedverbose)|Received a new transaction after requesting verbose notifications of all new transactions accepted into the mempool.|[notifynewtransactions](#notifynewtransactions)| -|7|[rescanprogress](#rescanprogress)|*DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
A rescan operation that is underway has made progress.|[rescan](#rescan)| -|8|[rescanfinished](#rescanfinished)|*DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
A rescan operation has completed.|[rescan](#rescan)| -|9|[relevanttxaccepted](#relevanttxaccepted)|A transaction matching the tx filter has been accepted into the mempool.|[loadtxfilter](#loadtxfilter)| -|10|[filteredblockconnected](#filteredblockconnected)|Block connected to the main chain; contains any transactions that match the client's tx filter.|[notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter)| -|11|[filteredblockdisconnected](#filteredblockdisconnected)|Block disconnected from the main chain.|[notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter)| +| # | Method | Description | Request | +| --- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | +| 1 | [blockconnected](#blockconnected) | *DEPRECATED, for similar functionality see [filteredblockconnected](#filteredblockconnected)*
Block connected to the main chain. | [notifyblocks](#notifyblocks) | +| 2 | [blockdisconnected](#blockdisconnected) | *DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*
Block disconnected from the main chain. | [notifyblocks](#notifyblocks) | +| 3 | [recvtx](#recvtx) | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Processed a transaction output spending to a wallet address. | [notifyreceived](#notifyreceived) and [rescan](#rescan) | +| 4 | [redeemingtx](#redeemingtx) | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Processed a transaction that spends a registered outpoint. | [notifyspent](#notifyspent) and [rescan](#rescan) | +| 5 | [txaccepted](#txaccepted) | Received a new transaction after requesting simple notifications of all new transactions accepted into the mempool. | [notifynewtransactions](#notifynewtransactions) | +| 6 | [txacceptedverbose](#txacceptedverbose) | Received a new transaction after requesting verbose notifications of all new transactions accepted into the mempool. | [notifynewtransactions](#notifynewtransactions) | +| 7 | [rescanprogress](#rescanprogress) | *DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
A rescan operation that is underway has made progress. | [rescan](#rescan) | +| 8 | [rescanfinished](#rescanfinished) | *DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
A rescan operation has completed. | [rescan](#rescan) | +| 9 | [relevanttxaccepted](#relevanttxaccepted) | A transaction matching the tx filter has been accepted into the mempool. | [loadtxfilter](#loadtxfilter) | +| 10 | [filteredblockconnected](#filteredblockconnected) | Block connected to the main chain; contains any transactions that match the client's tx filter. | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter) | +| 11 | [filteredblockdisconnected](#filteredblockdisconnected) | Block disconnected from the main chain. | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter) |
@@ -921,142 +921,142 @@ The following is an overview of the JSON-RPC notifications used for Websocket co -| | | -|---|---| -|Method|blockconnected| -|Request|[notifyblocks](#notifyblocks)| -|Parameters|1. BlockHash (string) hex-encoded bytes of the attached block hash
2. BlockHeight (numeric) height of the attached block
3. BlockTime (numeric) unix time of the attached block| -|Description|*DEPRECATED, for similar functionality see [filteredblockconnected](#filteredblockconnected)*
Notifies when a block has been added to the main chain. Notification is sent to all connected clients.| -|Example|Example blockconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "blockconnected",`
 `"params":`
  `[`
   `"000000000000000004cbdfe387f4df44b914e464ca79838a8ab777b3214dbffd",`
   `280330,`
   `1389636265`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | blockconnected | +| Request | [notifyblocks](#notifyblocks) | +| Parameters | 1. BlockHash (string) hex-encoded bytes of the attached block hash
2. BlockHeight (numeric) height of the attached block
3. BlockTime (numeric) unix time of the attached block | +| Description | *DEPRECATED, for similar functionality see [filteredblockconnected](#filteredblockconnected)*
Notifies when a block has been added to the main chain. Notification is sent to all connected clients. | +| Example | Example blockconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "blockconnected",`
 `"params":`
  `[`
   `"000000000000000004cbdfe387f4df44b914e464ca79838a8ab777b3214dbffd",`
   `280330,`
   `1389636265`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|blockdisconnected| -|Request|[notifyblocks](#notifyblocks)| -|Parameters|1. BlockHash (string) hex-encoded bytes of the disconnected block hash
2. BlockHeight (numeric) height of the disconnected block
3. BlockTime (numeric) unix time of the disconnected block| -|Description|*DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*
Notifies when a block has been removed from the main chain. Notification is sent to all connected clients.| -|Example|Example blockdisconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "blockdisconnected",`
 `"params":`
  `[`
   `"000000000000000004cbdfe387f4df44b914e464ca79838a8ab777b3214dbffd",`
   `280330,`
   `1389636265`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | blockdisconnected | +| Request | [notifyblocks](#notifyblocks) | +| Parameters | 1. BlockHash (string) hex-encoded bytes of the disconnected block hash
2. BlockHeight (numeric) height of the disconnected block
3. BlockTime (numeric) unix time of the disconnected block | +| Description | *DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*
Notifies when a block has been removed from the main chain. Notification is sent to all connected clients. | +| Example | Example blockdisconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "blockdisconnected",`
 `"params":`
  `[`
   `"000000000000000004cbdfe387f4df44b914e464ca79838a8ab777b3214dbffd",`
   `280330,`
   `1389636265`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|recvtx| -|Request|[rescan](#rescan) or [notifyreceived](#notifyreceived)| -|Parameters|1. Transaction (string) full transaction encoded as a hex string
2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined| -|Description|*DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Notifies a client when a transaction is processed that contains at least a single output with a pkScript sending to a requested address. If multiple outputs send to requested addresses, a single notification is sent. If a mempool (unmined) transaction is processed, the block details object (second parameter) is excluded.| -|Example|Example recvtx notification for mainnet transaction 61d3696de4c888730cbe06b0ad8ecb6d72d6108e893895aa9bc067bd7eba3fad when processed by mempool (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "recvtx",`
 `"params":`
  `[`
   `"010000000114d9ff358894c486b4ae11c2a8cf7851b1df64c53d2e511278eff17c22fb737300000000..."`
  `],`
 `"id": null`
`}`
The recvtx notification for the same txout, after the transaction was mined into block 276425:
`{`
 `"jsonrpc": "1.0",`
 `"method": "recvtx",`
 `"params":`
  `[`
   `"010000000114d9ff358894c486b4ae11c2a8cf7851b1df64c53d2e511278eff17c22fb737300000000...",`
   `{`
    `"height": 276425,`
    `"hash": "000000000000000325474bb799b9e591f965ca4461b72cb7012b808db92bb2fc",`
    `"index": 684,`
    `"time": 1387737310`
   `}`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | recvtx | +| Request | [rescan](#rescan) or [notifyreceived](#notifyreceived) | +| Parameters | 1. Transaction (string) full transaction encoded as a hex string
2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined | +| Description | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Notifies a client when a transaction is processed that contains at least a single output with a pkScript sending to a requested address. If multiple outputs send to requested addresses, a single notification is sent. If a mempool (unmined) transaction is processed, the block details object (second parameter) is excluded. | +| Example | Example recvtx notification for mainnet transaction 61d3696de4c888730cbe06b0ad8ecb6d72d6108e893895aa9bc067bd7eba3fad when processed by mempool (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "recvtx",`
 `"params":`
  `[`
   `"010000000114d9ff358894c486b4ae11c2a8cf7851b1df64c53d2e511278eff17c22fb737300000000..."`
  `],`
 `"id": null`
`}`
The recvtx notification for the same txout, after the transaction was mined into block 276425:
`{`
 `"jsonrpc": "1.0",`
 `"method": "recvtx",`
 `"params":`
  `[`
   `"010000000114d9ff358894c486b4ae11c2a8cf7851b1df64c53d2e511278eff17c22fb737300000000...",`
   `{`
    `"height": 276425,`
    `"hash": "000000000000000325474bb799b9e591f965ca4461b72cb7012b808db92bb2fc",`
    `"index": 684,`
    `"time": 1387737310`
   `}`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|redeemingtx| -|Requests|[notifyspent](#notifyspent) and [rescan](#rescan)| -|Parameters|1. Transaction (string) full transaction encoded as a hex string
2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined| -|Description|*DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Notifies a client when an registered outpoint is spent by a transaction accepted to mempool and/or mined into a block.| -|Example|Example redeemingtx notification for mainnet outpoint 61d3696de4c888730cbe06b0ad8ecb6d72d6108e893895aa9bc067bd7eba3fad:0 after being spent by transaction 4ad0c16ac973ff675dec1f3e5f1273f1c45be2a63554343f21b70240a1e43ece (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "redeemingtx",`
 `"params":`
  `[`
   `"0100000003ad3fba7ebd67c09baa9538898e10d6726dcb8eadb006be0c7388c8e46d69d3610000000..."`
  `],`
 `"id": null`
`}`
The redeemingtx notification for the same txout, after the spending transaction was mined into block 279143:
`{`
 `"jsonrpc": "1.0",`
 `"method": "recvtx",`
 `"params":`
  `[`
   `"0100000003ad3fba7ebd67c09baa9538898e10d6726dcb8eadb006be0c7388c8e46d69d3610000000...",`
   `{`
    `"height": 279143,`
    `"hash": "00000000000000017188b968a371bab95aa43522665353b646e41865abae02a4",`
    `"index": 6,`
    `"time": 1389115004`
   `}`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | redeemingtx | +| Requests | [notifyspent](#notifyspent) and [rescan](#rescan) | +| Parameters | 1. Transaction (string) full transaction encoded as a hex string
2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined | +| Description | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*
Notifies a client when an registered outpoint is spent by a transaction accepted to mempool and/or mined into a block. | +| Example | Example redeemingtx notification for mainnet outpoint 61d3696de4c888730cbe06b0ad8ecb6d72d6108e893895aa9bc067bd7eba3fad:0 after being spent by transaction 4ad0c16ac973ff675dec1f3e5f1273f1c45be2a63554343f21b70240a1e43ece (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "redeemingtx",`
 `"params":`
  `[`
   `"0100000003ad3fba7ebd67c09baa9538898e10d6726dcb8eadb006be0c7388c8e46d69d3610000000..."`
  `],`
 `"id": null`
`}`
The redeemingtx notification for the same txout, after the spending transaction was mined into block 279143:
`{`
 `"jsonrpc": "1.0",`
 `"method": "recvtx",`
 `"params":`
  `[`
   `"0100000003ad3fba7ebd67c09baa9538898e10d6726dcb8eadb006be0c7388c8e46d69d3610000000...",`
   `{`
    `"height": 279143,`
    `"hash": "00000000000000017188b968a371bab95aa43522665353b646e41865abae02a4",`
    `"index": 6,`
    `"time": 1389115004`
   `}`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|txaccepted| -|Request|[notifynewtransactions](#notifynewtransactions)| -|Parameters|1. TxHash (string) hex-encoded bytes of the transaction hash
2. Amount (numeric) sum of the value of all the transaction outpoints| -|Description|Notifies when a new transaction has been accepted and the client has requested standard transaction details.| -|Example|Example txaccepted notification for mainnet transaction id "16c54c9d02fe570b9d41b518c0daefae81cc05c69bbe842058e84c6ed5826261" (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "txaccepted",`
 `"params":`
  `[`
   `"16c54c9d02fe570b9d41b518c0daefae81cc05c69bbe842058e84c6ed5826261",`
   `55838384`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | txaccepted | +| Request | [notifynewtransactions](#notifynewtransactions) | +| Parameters | 1. TxHash (string) hex-encoded bytes of the transaction hash
2. Amount (numeric) sum of the value of all the transaction outpoints | +| Description | Notifies when a new transaction has been accepted and the client has requested standard transaction details. | +| Example | Example txaccepted notification for mainnet transaction id "16c54c9d02fe570b9d41b518c0daefae81cc05c69bbe842058e84c6ed5826261" (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "txaccepted",`
 `"params":`
  `[`
   `"16c54c9d02fe570b9d41b518c0daefae81cc05c69bbe842058e84c6ed5826261",`
   `55838384`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|txacceptedverbose| -|Request|[notifynewtransactions](#notifynewtransactions)| -|Parameters|1. RawTx (json object) the transaction as a json object (see getrawtransaction json object details)| -|Description|Notifies when a new transaction has been accepted and the client has requested verbose transaction details.| -|Example|Example txacceptedverbose notification (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "txacceptedverbose",`
 `"params":`
  `[`
   `{`
    `"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000f...",`
    `"txid": "90743aad855880e517270550d2a881627d84db5265142fd1e7fb7add38b08be9",`
    `"version": 1,`
    `"locktime": 0,`
    `"vin": [`
    For coinbase transactions:
      `{ (json object)`
        `"coinbase": "03708203062f503253482f04066d605108f800080100000ea2122f6f7a636f696e4065757374726174756d2f",`
        `"sequence": 0,`
      `}`
    For non-coinbase transactions:
      `{`
        `"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`
        `"vout": 0,`
        `"scriptSig": {`
          `"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`
          `"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`
        `}`
        `"sequence": 4294967295,`
      `}`
    `],`
    `"vout": [`
     `{`
      `"value": 25.1394,`
      `"n": 0,`
      `"scriptPubKey": {`
       `"asm": "OP_DUP OP_HASH160 ea132286328cfc819457b9dec386c4b5c84faa5c OP_EQUALVERIFY OP_CHECKSIG",`
       `"hex": "76a914ea132286328cfc819457b9dec386c4b5c84faa5c88ac",`
       `"reqSigs": 1,`
       `"type": "pubkeyhash"`
       `"addresses": [`
        `"1NLg3QJMsMQGM5KEUaEu5ADDmKQSLHwmyh",`
       `]`
     `}`
    `]`
   `}`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | txacceptedverbose | +| Request | [notifynewtransactions](#notifynewtransactions) | +| Parameters | 1. RawTx (json object) the transaction as a json object (see getrawtransaction json object details) | +| Description | Notifies when a new transaction has been accepted and the client has requested verbose transaction details. | +| Example | Example txacceptedverbose notification (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "txacceptedverbose",`
 `"params":`
  `[`
   `{`
    `"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000f...",`
    `"txid": "90743aad855880e517270550d2a881627d84db5265142fd1e7fb7add38b08be9",`
    `"version": 1,`
    `"locktime": 0,`
    `"vin": [`
    For coinbase transactions:
      `{ (json object)`
        `"coinbase": "03708203062f503253482f04066d605108f800080100000ea2122f6f7a636f696e4065757374726174756d2f",`
        `"sequence": 0,`
      `}`
    For non-coinbase transactions:
      `{`
        `"txid": "60ac4b057247b3d0b9a8173de56b5e1be8c1d1da970511c626ef53706c66be04",`
        `"vout": 0,`
        `"scriptSig": {`
          `"asm": "3046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f0...",`
          `"hex": "493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8...",`
        `}`
        `"sequence": 4294967295,`
      `}`
    `],`
    `"vout": [`
     `{`
      `"value": 25.1394,`
      `"n": 0,`
      `"scriptPubKey": {`
       `"asm": "OP_DUP OP_HASH160 ea132286328cfc819457b9dec386c4b5c84faa5c OP_EQUALVERIFY OP_CHECKSIG",`
       `"hex": "76a914ea132286328cfc819457b9dec386c4b5c84faa5c88ac",`
       `"reqSigs": 1,`
       `"type": "pubkeyhash"`
       `"addresses": [`
        `"1NLg3QJMsMQGM5KEUaEu5ADDmKQSLHwmyh",`
       `]`
     `}`
    `]`
   `}`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|rescanprogress| -|Request|[rescan](#rescan)| -|Parameters|1. Hash (string) hash of the last processed block
2. Height (numeric) height of the last processed block
3. Time (numeric) UNIX time of the last processed block| -|Description|*DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
Notifies a client with the current progress at periodic intervals when a long-running [rescan](#rescan) is underway.| -|Example|`{`
 `"jsonrpc": "1.0",`
 `"method": "rescanprogress",`
 `"params":`
  `[`
   `"0000000000000ea86b49e11843b2ad937ac89ae74a963c7edd36e0147079b89d",`
   `127213,`
   `1306533807`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | rescanprogress | +| Request | [rescan](#rescan) | +| Parameters | 1. Hash (string) hash of the last processed block
2. Height (numeric) height of the last processed block
3. Time (numeric) UNIX time of the last processed block | +| Description | *DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
Notifies a client with the current progress at periodic intervals when a long-running [rescan](#rescan) is underway. | +| Example | `{`
 `"jsonrpc": "1.0",`
 `"method": "rescanprogress",`
 `"params":`
  `[`
   `"0000000000000ea86b49e11843b2ad937ac89ae74a963c7edd36e0147079b89d",`
   `127213,`
   `1306533807`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|rescanfinished| -|Request|[rescan](#rescan)| -|Parameters|1. Hash (string) hash of the last rescanned block
2. Height (numeric) height of the last rescanned block
3. Time (numeric) UNIX time of the last rescanned block | -|Description|*DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
Notifies a client that the [rescan](#rescan) has completed and no further notifications will be sent.| -|Example|`{`
 `"jsonrpc": "1.0",`
 `"method": "rescanfinished",`
 `"params":`
  `[`
   `"0000000000000ea86b49e11843b2ad937ac89ae74a963c7edd36e0147079b89d",`
   `127213,`
   `1306533807`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Method | rescanfinished | +| Request | [rescan](#rescan) | +| Parameters | 1. Hash (string) hash of the last rescanned block
2. Height (numeric) height of the last rescanned block
3. Time (numeric) UNIX time of the last rescanned block | +| Description | *DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*
Notifies a client that the [rescan](#rescan) has completed and no further notifications will be sent. | +| Example | `{`
 `"jsonrpc": "1.0",`
 `"method": "rescanfinished",`
 `"params":`
  `[`
   `"0000000000000ea86b49e11843b2ad937ac89ae74a963c7edd36e0147079b89d",`
   `127213,`
   `1306533807`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|relevanttxaccepted| -|Request|[loadtxfilter](#loadtxfilter)| -|Parameters|1. Transaction (string) hex-encoded serialized transaction matching the client's filter loaded ith [loadtxfilter](#loadtxfilter)| -|Description|Notifies a client that a transaction matching the client's tx filter has been accepted into he mempool.| -|Example|Example `relevanttxaccepted` notification (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "relevanttxaccepted",`
 `"params": [`
  `"01000000014221abdcca25c8a3b0c044034875dece048c77d567a806f0c2e7e0f5e25a8f100..."`
 `],`
 `"id": null`
`}`| +| | | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | relevanttxaccepted | +| Request | [loadtxfilter](#loadtxfilter) | +| Parameters | 1. Transaction (string) hex-encoded serialized transaction matching the client's filter loaded ith [loadtxfilter](#loadtxfilter) | +| Description | Notifies a client that a transaction matching the client's tx filter has been accepted into he mempool. | +| Example | Example `relevanttxaccepted` notification (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "relevanttxaccepted",`
 `"params": [`
  `"01000000014221abdcca25c8a3b0c044034875dece048c77d567a806f0c2e7e0f5e25a8f100..."`
 `],`
 `"id": null`
`}` | ***
-| | | -|---|---| -|Method|filteredblockconnected| -|Request|[notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter)| -|Parameters|1. BlockHeight (numeric) height of the attached block
2. Header (string) hex-encoded serialized header of the attached block
3. Transactions (JSON array) hex-encoded serialized transactions matching the filter for the client connection loaded with [loadtxfilter](#loadtxfilter)| -|Description|Notifies when a block has been added to the main chain. Notification is sent to all connected clients.| -|Example|Example filteredblockconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "filteredblockconnected",`
 `"params":`
  `[`
   `280330,`
   `"0200000052d1e8813f697293e41942aa230e7e4fcc44832d78a1372202000000000000006aa...",`
   `[`
    `"01000000014221abdcca25c8a3b0c044034875dece048c77d567a806f0c2e7e0f5e25a8f100..."`
   `]`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | filteredblockconnected | +| Request | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter) | +| Parameters | 1. BlockHeight (numeric) height of the attached block
2. Header (string) hex-encoded serialized header of the attached block
3. Transactions (JSON array) hex-encoded serialized transactions matching the filter for the client connection loaded with [loadtxfilter](#loadtxfilter) | +| Description | Notifies when a block has been added to the main chain. Notification is sent to all connected clients. | +| Example | Example filteredblockconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "filteredblockconnected",`
 `"params":`
  `[`
   `280330,`
   `"0200000052d1e8813f697293e41942aa230e7e4fcc44832d78a1372202000000000000006aa...",`
   `[`
    `"01000000014221abdcca25c8a3b0c044034875dece048c77d567a806f0c2e7e0f5e25a8f100..."`
   `]`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
***
-| | | -|---|---| -|Method|filteredblockdisconnected| -|Request|[notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter)| -|Parameters|1. BlockHeight (numeric) height of the disconnected block
2. Header (string) hex-encoded serialized header of the disconnected block| -|Description|Notifies when a block has been removed from the main chain. Notification is sent to all connected clients.| -|Example|Example blockdisconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "blockdisconnected",`
 `"params":`
  `[`
   `280330,`
   `"0200000052d1e8813f697293e41942aa230e7e4fcc44832d78a1372202000000000000006aa..."`
  `],`
 `"id": null`
`}`| +| | | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Method | filteredblockdisconnected | +| Request | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter) | +| Parameters | 1. BlockHeight (numeric) height of the disconnected block
2. Header (string) hex-encoded serialized header of the disconnected block | +| Description | Notifies when a block has been removed from the main chain. Notification is sent to all connected clients. | +| Example | Example blockdisconnected notification for mainnet block 280330 (newlines added for readability):
`{`
 `"jsonrpc": "1.0",`
 `"method": "blockdisconnected",`
 `"params":`
  `[`
   `280330,`
   `"0200000052d1e8813f697293e41942aa230e7e4fcc44832d78a1372202000000000000006aa..."`
  `],`
 `"id": null`
`}` | [Return to Overview](#NotificationOverview)
@@ -1116,8 +1116,8 @@ func main() { // Create a new RPC client using websockets. Since this example is // not long-lived, the connection will be closed as soon as the program // exits. - connCfg := &rpcclient.ConnConfig{ - Host: "localhost:8334", + connCfg := &btcrpcclient.ConnConfig{ + Host: "localhost:9245", Endpoint: "ws", User: "yourrpcuser", Pass: "yourrpcpass", @@ -1180,8 +1180,8 @@ func main() { // Create a new RPC client using websockets. Since this example is // not long-lived, the connection will be closed as soon as the program // exits. - connCfg := &rpcclient.ConnConfig{ - Host: "localhost:18334", + connCfg := &btcrpcclient.ConnConfig{ + Host: "localhost:19245", Endpoint: "ws", User: "yourrpcuser", Pass: "yourrpcpass", @@ -1281,8 +1281,8 @@ func main() { } // Create a new RPC client using websockets. - connCfg := &rpcclient.ConnConfig{ - Host: "localhost:8334", + connCfg := &btcrpcclient.ConnConfig{ + Host: "localhost:9245", Endpoint: "ws", User: "yourrpcuser", Pass: "yourrpcpass", @@ -1357,7 +1357,7 @@ var password = "yourpassword"; // Initiate the websocket connection. The btcd generated certificate acts as // its own certificate authority, so it needs to be specified in the 'ca' array // for the certificate to properly validate. -var ws = new WebSocket('wss://127.0.0.1:8334/ws', { +var ws = new WebSocket('wss://127.0.0.1:9245/ws', { headers: { 'Authorization': 'Basic '+new Buffer(user+':'+password).toString('base64') }, diff --git a/params.go b/params.go index b4d1453d..1f85ebc7 100644 --- a/params.go +++ b/params.go @@ -28,7 +28,7 @@ type params struct { // to emulate the full reference implementation RPC API. var mainNetParams = params{ Params: &chaincfg.MainNetParams, - rpcPort: "8334", + rpcPort: "9245", } // regressionNetParams contains parameters specific to the regression test @@ -37,7 +37,7 @@ var mainNetParams = params{ // details. var regressionNetParams = params{ Params: &chaincfg.RegressionNetParams, - rpcPort: "18334", + rpcPort: "29245", } // testNet3Params contains parameters specific to the test network (version 3) @@ -45,7 +45,7 @@ var regressionNetParams = params{ // reference implementation - see the mainNetParams comment for details. var testNet3Params = params{ Params: &chaincfg.TestNet3Params, - rpcPort: "18334", + rpcPort: "19245", } // simNetParams contains parameters specific to the simulation test network diff --git a/rpcclient/examples/btcdwebsockets/main.go b/rpcclient/examples/btcdwebsockets/main.go index 56d12d82..89889dd5 100644 --- a/rpcclient/examples/btcdwebsockets/main.go +++ b/rpcclient/examples/btcdwebsockets/main.go @@ -38,7 +38,7 @@ func main() { log.Fatal(err) } connCfg := &rpcclient.ConnConfig{ - Host: "localhost:8334", + Host: "localhost:9245", Endpoint: "ws", User: "yourrpcuser", Pass: "yourrpcpass", diff --git a/sample-btcd.conf b/sample-btcd.conf index 0a765fca..70264f6e 100644 --- a/sample-btcd.conf +++ b/sample-btcd.conf @@ -198,16 +198,16 @@ ; rpclisten=0.0.0.0 ; All ipv6 interfaces on default port: ; rpclisten=:: -; All interfaces on port 8334: -; rpclisten=:8334 -; All ipv4 interfaces on port 8334: -; rpclisten=0.0.0.0:8334 -; All ipv6 interfaces on port 8334: -; rpclisten=[::]:8334 -; Only ipv4 localhost on port 8334: -; rpclisten=127.0.0.1:8334 -; Only ipv6 localhost on port 8334: -; rpclisten=[::1]:8334 +; All interfaces on port 9245: +; rpclisten=:9245 +; All ipv4 interfaces on port 9245: +; rpclisten=0.0.0.0:9245 +; All ipv6 interfaces on port 9245: +; rpclisten=[::]:9245 +; Only ipv4 localhost on port 9245: +; rpclisten=127.0.0.1:9245 +; Only ipv6 localhost on port 9245: +; rpclisten=[::1]:9245 ; Only ipv4 localhost on non-standard port 8337: ; rpclisten=127.0.0.1:8337 ; All interfaces on non-standard port 8337: