[lbry] misc: change RPC port from 8334 to 9245
This commit is contained in:
parent
7f5b9ae2fd
commit
3ad06bdcbb
6 changed files with 838 additions and 543 deletions
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
index.md
|
296
docs/README.md
Normal file
296
docs/README.md
Normal file
|
@ -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)
|
||||
|
||||
<a name="About" />
|
||||
|
||||
### 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.
|
||||
|
||||
<a name="GettingStarted" />
|
||||
|
||||
### 2. Getting Started
|
||||
|
||||
<a name="Installation" />
|
||||
|
||||
**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.
|
||||
|
||||
<a name="WindowsInstallation" />
|
||||
|
||||
**2.1.1 Windows Installation**<br />
|
||||
|
||||
* Install the MSI available at: https://github.com/btcsuite/btcd/releases
|
||||
* Launch btcd from the Start Menu
|
||||
|
||||
<a name="PosixInstallation" />
|
||||
|
||||
**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/...
|
||||
```
|
||||
|
||||
<a name="GentooInstallation" />
|
||||
|
||||
**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`
|
||||
|
||||
<a name="Configuration" />
|
||||
|
||||
**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`.
|
||||
|
||||
<a name="BtcctlConfig" />
|
||||
|
||||
**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`
|
||||
|
||||
<a name="Mining" />
|
||||
|
||||
**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`
|
||||
|
||||
<a name="Help" />
|
||||
|
||||
### 3. Help
|
||||
|
||||
<a name="Startup" />
|
||||
|
||||
**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.
|
||||
|
||||
<a name="BootstrapDat" />
|
||||
|
||||
**3.1.1 bootstrap.dat**
|
||||
|
||||
* [Using bootstrap.dat](https://github.com/btcsuite/btcd/tree/master/docs/using_bootstrap_dat.md)
|
||||
|
||||
<a name="NetworkConfig" />
|
||||
|
||||
**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)
|
||||
|
||||
<a name="Wallet" />
|
||||
|
||||
**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.
|
||||
|
||||
|
||||
<a name="Contact" />
|
||||
|
||||
### 4. Contact
|
||||
|
||||
<a name="ContactIRC" />
|
||||
|
||||
**4.1 IRC**
|
||||
|
||||
* [irc.freenode.net](irc://irc.freenode.net), channel `#btcd`
|
||||
|
||||
<a name="MailingLists" />
|
||||
|
||||
**4.2 Mailing Lists**
|
||||
|
||||
* <a href="mailto:btcd+subscribe@opensource.conformal.com">btcd</a>: discussion
|
||||
of btcd and its packages.
|
||||
* <a href="mailto:btcd-commits+subscribe@opensource.conformal.com">btcd-commits</a>:
|
||||
readonly mail-out of source code changes.
|
||||
|
||||
<a name="DeveloperResources" />
|
||||
|
||||
### 5. Developer Resources
|
||||
|
||||
<a name="ContributionGuidelines" />
|
||||
|
||||
* [Code Contribution Guidelines](https://github.com/btcsuite/btcd/tree/master/docs/code_contribution_guidelines.md)
|
||||
|
||||
<a name="JSONRPCReference" />
|
||||
|
||||
* [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)
|
||||
|
||||
<a name="GoPackages" />
|
||||
|
||||
* 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.
|
|
@ -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,13 +72,13 @@ 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 |
|
||||
|
@ -157,7 +157,7 @@ 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. |
|
||||
|
@ -196,7 +196,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="addnode"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | addnode |
|
||||
| Parameters | 1. peer (string, required) - ip address and port of the peer to operate on<br />2. command (string, required) - `add` to add a persistent peer, `remove` to remove a persistent peer, or `onetry` to try a single connection to a peer |
|
||||
| Description | Attempts to add or remove a persistent peer. |
|
||||
|
@ -207,7 +207,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="createrawtransaction"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | createrawtransaction |
|
||||
| Parameters | 1. transaction inputs (JSON array, required) - json array of json objects<br />`[`<br /> `{`<br /> `"txid": "hash", (string, required) the hash of the input transaction`<br /> `"vout": n (numeric, required) the specific output of the input transaction to redeem`<br /> `}, ...`<br />`]`<br />2. addresses and amounts (JSON object, required) - json object with addresses as keys and amounts as values<br />`{`<br /> `"address": n.nnn (numeric, required) the address to send to as the key and the amount in BTC as the value`<br /> `, ...`<br />`}`<br />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.<br />The transaction inputs are not signed in the created transaction.<br />The `signrawtransaction` RPC command provided by wallet must be used to sign the resulting transaction. |
|
||||
|
@ -220,7 +220,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="decoderawtransaction"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | decoderawtransaction |
|
||||
| Parameters | 1. data (string, required) - serialized, hex-encoded transaction |
|
||||
| Description | Returns a JSON object representing the provided serialized, hex-encoded transaction. |
|
||||
|
@ -232,7 +232,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="decodescript"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | decodescript |
|
||||
| Parameters | 1. script (string, required) - hex-encoded script |
|
||||
| Description | Returns a JSON object with information about the provided hex-encoded script. |
|
||||
|
@ -244,7 +244,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="getaddednodeinfo"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| 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<br />2. node (string, optional) - only return information about this specific peer instead of all added peers. |
|
||||
| Description | Returns information about manually added (persistent) peers. |
|
||||
|
@ -258,7 +258,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="getbestblockhash"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | ----------------------------------------------------------------------------------- |
|
||||
| Method | getbestblockhash |
|
||||
| Parameters | None |
|
||||
| Description | Returns the hash of the of the best (most recent) block in the longest block chain. |
|
||||
|
@ -270,9 +270,9 @@ the method name for further details such as parameter and return information.
|
|||
<a name="getblock"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | getblock |
|
||||
|Parameters|1. block hash (string, required) - the hash of the block<br />2. verbosity (int, optional, default=1) - Specifies whether the block data should be returned as a hex-encoded string (0), as parsed data with a slice of TXIDs (1), or as parsed data with parsed transaction data (2).
|
||||
| Parameters | 1. block hash (string, required) - the hash of the block<br />2. verbosity (int, optional, default=1) - Specifies whether the block data should be returned as a hex-encoded string (0), as parsed data with a slice of TXIDs (1), or as parsed data with parsed transaction data (2). |
|
||||
| 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)`<br /> `"hash": "blockhash", (string) the hash of the block (same as provided)`<br /> `"confirmations": n, (numeric) the number of confirmations`<br /> `"strippedsize", n (numeric) the size of the block without witness data`<br /> `"size": n, (numeric) the size of the block`<br /> `"weight": n, (numeric) value of the weight metric`<br /> `"height": n, (numeric) the height of the block in the block chain`<br /> `"version": n, (numeric) the block version`<br /> `"merkleroot": "hash", (string) root hash of the merkle tree`<br /> `"tx": [ (json array of string) the transaction hashes`<br /> `"transactionhash", (string) hash of the parent transaction`<br /> `...`<br /> `]`<br /> `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`<br /> `"nonce": n, (numeric) the block nonce`<br /> `"bits", n, (numeric) the bits which represent the block difficulty`<br /> `difficulty: n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`<br /> `"previousblockhash": "hash", (string) the hash of the previous block`<br /> `"nextblockhash": "hash", (string) the hash of the next block (only if there is one)`<br />`}` |
|
||||
|
@ -285,7 +285,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="getblockcount"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | -------------------------------------------------------- |
|
||||
| Method | getblockcount |
|
||||
| Parameters | None |
|
||||
| Description | Returns the number of blocks in the longest block chain. |
|
||||
|
@ -297,7 +297,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="getblockhash"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | ------------------------------------------------------------------ |
|
||||
| Method | getblockhash |
|
||||
| Parameters | 1. block height (numeric, required) |
|
||||
| Description | Returns hash of the block in best block chain at the given height. |
|
||||
|
@ -309,7 +309,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="getblockheader"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Method | getblockheader |
|
||||
| Parameters | 1. block hash (string, required) - the hash of the block<br />2. verbose (boolean, optional, default=true) - specifies the block header is returned as a JSON object instead of a hex-encoded string |
|
||||
| Description | Returns hex-encoded bytes of the serialized block header. |
|
||||
|
@ -323,7 +323,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="getconnectioncount"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | ------------------------------------------------------- |
|
||||
| Method | getconnectioncount |
|
||||
| Parameters | None |
|
||||
| Description | Returns the number of active connections to other peers |
|
||||
|
@ -335,7 +335,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="getdifficulty"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | ----------------------------------------------------------------------------- |
|
||||
| Method | getdifficulty |
|
||||
| Parameters | None |
|
||||
| Description | Returns the proof-of-work difficulty as a multiple of the minimum difficulty. |
|
||||
|
@ -347,7 +347,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="getgenerate"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ------------------------------------------------------------ |
|
||||
| Method | getgenerate |
|
||||
| Parameters | None |
|
||||
| Description | Return if the server is set to generate coins (mine) or not. |
|
||||
|
@ -358,7 +358,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="gethashespersec"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ------------------------------------------------------------------------------------------- |
|
||||
| Method | gethashespersec |
|
||||
| Parameters | None |
|
||||
| Description | Returns a recent hashes per second performance measurement while generating coins (mining). |
|
||||
|
@ -369,7 +369,7 @@ the method name for further details such as parameter and return information.
|
|||
<a name="getinfo"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Method | getinfo |
|
||||
| Parameters | None |
|
||||
| Description | Returns a JSON object containing various state info. |
|
||||
|
@ -382,19 +382,19 @@ the method name for further details such as parameter and return information.
|
|||
<a name="getmempoolinfo"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | getmempoolinfo |
|
||||
| Parameters | None |
|
||||
| Description | Returns a JSON object containing mempool-related information. |
|
||||
| Returns | `{ (json object)`<br /> `"bytes": n, (numeric) size in bytes of the mempool`<br /> `"size": n, (numeric) number of transactions in the mempool`<br />`}` |
|
||||
Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size": 157,`<br />`}`|
|
||||
| Example Return | `{`<br /> `"bytes": 310768,`<br /> `"size": 157,`<br />`}` |
|
||||
[Return to Overview](#MethodOverview)<br />
|
||||
|
||||
***
|
||||
<a name="getmininginfo"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | getmininginfo |
|
||||
| Parameters | None |
|
||||
| Description | Returns a JSON object containing mining-related information. |
|
||||
|
@ -406,7 +406,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="getnettotals"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | getnettotals |
|
||||
| Parameters | None |
|
||||
| Description | Returns a JSON object containing network traffic statistics. |
|
||||
|
@ -418,7 +418,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="getnetworkhashps"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | getnetworkhashps |
|
||||
| Parameters | 1. blocks (numeric, optional, default=120) - The number of blocks, or -1 for blocks since last difficulty change<br />2. height (numeric, optional, default=-1) - Perform estimate ending with this height or -1 for current best chain block height |
|
||||
| Description | Returns the estimated network hashes per second for the block heights provided by the parameters. |
|
||||
|
@ -430,7 +430,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="getpeerinfo"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | getpeerinfo |
|
||||
| Parameters | None |
|
||||
| Description | Returns data about each connected network peer as an array of json objects. |
|
||||
|
@ -442,7 +442,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="getrawtransaction"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | getrawtransaction |
|
||||
| Parameters | 1. transaction hash (string, required) - the hash of the transaction<br />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. |
|
||||
|
@ -456,7 +456,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="help"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| 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.<br />When no `command` parameter is specified, a list of avaialable commands is returned<br />When `command` is a valid method, the help text for that method is returned. |
|
||||
|
@ -468,7 +468,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="ping"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Method | ping |
|
||||
| Parameters | None |
|
||||
| Description | Queues a ping to be sent to each connected peer.<br />Ping times are provided by [getpeerinfo](#getpeerinfo) via the `pingtime` and `pingwait` fields. |
|
||||
|
@ -479,7 +479,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="getrawmempool"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| 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.<br />The `verbose` flag specifies that each transaction is returned as a JSON object. |
|
||||
|
@ -494,7 +494,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="setgenerate"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Method | setgenerate |
|
||||
| Parameters | 1. generate (boolean, required) - `true` to enable generation, `false` to disable it<br />2. genproclimit (numeric, optional) - the number of processors (cores) to limit generation to or `-1` for default |
|
||||
| Description | Set the server to generate coins (mine) or not. |
|
||||
|
@ -506,7 +506,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="sendrawtransaction"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Method | sendrawtransaction |
|
||||
| Parameters | 1. signedhex (string, required) serialized, hex-encoded signed transaction<br />2. allowhighfees (boolean, optional, default=false) whether or not to allow insanely high fees |
|
||||
| Description | Submits the serialized, hex-encoded transaction to the local peer and relays it to the network. |
|
||||
|
@ -519,7 +519,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="submitblock"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Method | submitblock |
|
||||
| Parameters | 1. data (string, required) serialized, hex-encoded block<br />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. |
|
||||
|
@ -530,7 +530,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="stop"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | --------------------------- |
|
||||
| Method | stop |
|
||||
| Parameters | None |
|
||||
| Description | Shutdown btcd. |
|
||||
|
@ -541,7 +541,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="validateaddress"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | validateaddress |
|
||||
| Parameters | 1. address (string, required) - bitcoin address |
|
||||
| Description | Verify an address is valid. |
|
||||
|
@ -552,7 +552,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"size":
|
|||
<a name="verifychain"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| 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)<br />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.<br />The actual checks performed by the `checklevel` parameter is implementation specific. For btcd this is:<br />`checklevel=0` - Look up each block and ensure it can be loaded from the database.<br />`checklevel=1` - Perform basic context-free sanity checks on each block. |
|
||||
|
@ -573,7 +573,7 @@ Example Return|`{`<br /> `"bytes": 310768,`<br /> `"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 |
|
||||
|
@ -591,7 +591,7 @@ The following is an overview of the RPC methods which are implemented by btcd, b
|
|||
<a name="debuglevel"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | debuglevel |
|
||||
| Parameters | 1. _levelspec_ (string) |
|
||||
| Description | Dynamically changes the debug logging level.<br />The levelspec can either a debug level or of the form `<subsystem>=<level>,<subsystem2>=<level2>,...`<br />The valid debug levels are `trace`, `debug`, `info`, `warn`, `error`, and `critical`.<br />The valid subsystems are `AMGR`, `ADXR`, `BCDB`, `BMGR`, `BTCD`, `CHAN`, `DISC`, `PEER`, `RPCS`, `SCRP`, `SRVR`, and `TXMP`.<br />Additionally, the special keyword `show` can be used to get a list of the available subsystems. |
|
||||
|
@ -605,7 +605,7 @@ The following is an overview of the RPC methods which are implemented by btcd, b
|
|||
<a name="getbestblock"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Method | getbestblock |
|
||||
| Parameters | None |
|
||||
| Description | Get block height and hash of best block in the main chain. |
|
||||
|
@ -617,7 +617,7 @@ The following is an overview of the RPC methods which are implemented by btcd, b
|
|||
<a name="getcurrentnet"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | -------------------------------------------------- |
|
||||
| Method | getcurrentnet |
|
||||
| Parameters | None |
|
||||
| Description | Get bitcoin network btcd is running on. |
|
||||
|
@ -630,7 +630,7 @@ The following is an overview of the RPC methods which are implemented by btcd, b
|
|||
<a name="searchrawtransactions"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | searchrawtransactions |
|
||||
| Parameters | 1. address (string, required) - bitcoin address <br /> 2. verbose (int, optional, default=true) - specifies the transaction is returned as a JSON object instead of hex-encoded string <br />3. skip (int, optional, default=0) - the number of leading transactions to leave out of the final response <br /> 4. count (int, optional, default=100) - the maximum number of transactions to return <br /> 5. vinextra (int, optional, default=0) - Specify that extra data from previous output will be returned in vin <br /> 6. reverse (boolean, optional, default=false) - Specifies that the transactions should be returned in reverse chronological order |
|
||||
| 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. |
|
||||
|
@ -643,7 +643,7 @@ The following is an overview of the RPC methods which are implemented by btcd, b
|
|||
<a name="node"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| 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 <br /> 2. peer (string, required) - ip address and port, or ID of the peer to operate on<br /> 3. connection type (string, optional) - `perm` indicates the peer should be added as a permanent peer, `temp` indicates a connection should only be attempted once. |
|
||||
| Description | Attempts to add or remove a peer. |
|
||||
|
@ -655,7 +655,7 @@ The following is an overview of the RPC methods which are implemented by btcd, b
|
|||
<a name="generate"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| 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. |
|
||||
|
@ -667,7 +667,7 @@ The following is an overview of the RPC methods which are implemented by btcd, b
|
|||
<a name="version"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | version |
|
||||
| Parameters | None |
|
||||
| Description | Returns the version of the JSON-RPC API built into this release of btcd. |
|
||||
|
@ -680,7 +680,7 @@ The following is an overview of the RPC methods which are implemented by btcd, b
|
|||
<a name="getheaders"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | getheaders |
|
||||
| Parameters | 1. Block Locators (JSON array, required)<br /> `[ (json array of strings)`<br /> `"blocklocator", (string) the known block hash`<br /> `...`<br /> `]`<br />2. hashstop (string) - last desired block's hash |
|
||||
| Description | Returns block headers starting with the first known block hash from the request. |
|
||||
|
@ -702,7 +702,7 @@ The following is an overview of the RPC method requests available exclusively to
|
|||
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.<br /><font color="orange">NOTE: This is only required if an HTTP Authorization header is not being used.</font> | 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 |
|
||||
|
@ -724,7 +724,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="authenticate"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | authenticate |
|
||||
| Parameters | 1. username (string, required)<br />2. passphrase (string, required) |
|
||||
| Description | Authenticate the connection against the username and password configured for the RPC server.<br /> Invoking any other method before authenticating with this command will close the connection.<br /><font color="orange">NOTE: This is only required if an HTTP Authorization header is not being used.</font> |
|
||||
|
@ -736,7 +736,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="notifyblocks"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | notifyblocks |
|
||||
| Notifications | [blockconnected](#blockconnected), [blockdisconnected](#blockdisconnected), [filteredblockconnected](#filteredblockconnected), and [filteredblockdisconnected](#filteredblockdisconnected) |
|
||||
| Parameters | None |
|
||||
|
@ -749,7 +749,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="stopnotifyblocks"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
| Method | stopnotifyblocks |
|
||||
| Notifications | None |
|
||||
| Parameters | None |
|
||||
|
@ -762,7 +762,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="notifyreceived"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Method | notifyreceived |
|
||||
| Notifications | [recvtx](#recvtx) and [redeemingtx](#redeemingtx) |
|
||||
| Parameters | 1. Addresses (JSON array, required)<br /> `[ (json array of strings)`<br /> `"bitcoinaddress", (string) the bitcoin address`<br /> `...`<br /> `]` |
|
||||
|
@ -775,7 +775,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="stopnotifyreceived"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | stopnotifyreceived |
|
||||
| Notifications | None |
|
||||
| Parameters | 1. Addresses (JSON array, required)<br /> `[ (json array of strings)`<br /> `"bitcoinaddress", (string) the bitcoin address`<br /> `...`<br /> `]` |
|
||||
|
@ -788,7 +788,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="notifyspent"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | notifyspent |
|
||||
| Notifications | [redeemingtx](#redeemingtx) |
|
||||
| Parameters | 1. Outpoints (JSON array, required)<br /> `[ (JSON array)`<br /> `{ (JSON object)`<br /> `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`<br /> `"index":n (numeric) the txout index of the outpoint`<br /> `},`<br /> `...`<br /> `]` |
|
||||
|
@ -801,7 +801,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="stopnotifyspent"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | stopnotifyspent |
|
||||
| Notifications | None |
|
||||
| Parameters | 1. Outpoints (JSON array, required)<br /> `[ (JSON array)`<br /> `{ (JSON object)`<br /> `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`<br /> `"index":n (numeric) the txout index of the outpoint`<br /> `},`<br /> `...`<br /> `]` |
|
||||
|
@ -814,7 +814,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="rescan"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | rescan |
|
||||
| Notifications | [recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished) |
|
||||
| Parameters | 1. BeginBlock (string, required) block hash to begin rescanning from<br />2. Addresses (JSON array, required)<br /> `[ (json array of strings)`<br /> `"bitcoinaddress", (string) the bitcoin address`<br /> `...` <br /> `]`<br />3. Outpoints (JSON array, required)<br /> `[ (JSON array)`<br /> `{ (JSON object)`<br /> `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`<br /> `"index":n (numeric) the txout index of the outpoint`<br /> `},`<br /> `...`<br /> `]`<br />4. EndBlock (string, optional) hash of final block to rescan |
|
||||
|
@ -827,7 +827,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="notifynewtransactions"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| 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) |
|
||||
|
@ -840,7 +840,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="stopnotifynewtransactions"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | stopnotifynewtransactions |
|
||||
| Notifications | None |
|
||||
| Parameters | None |
|
||||
|
@ -853,7 +853,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="session"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | session |
|
||||
| Notifications | None |
|
||||
| Parameters | None |
|
||||
|
@ -867,7 +867,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="loadtxfilter"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | loadtxfilter |
|
||||
| Notifications | [relevanttxaccepted](#relevanttxaccepted) |
|
||||
| Parameters | 1. Reload (boolean, required) - Load a new filter instead of adding data to an existing one<br />2. Addresses (JSON array, required) - Array of addresses to add to the transaction filter<br />3. Outpoints (JSON array, required) - Array of outpoints to add to the transaction filter |
|
||||
|
@ -880,7 +880,7 @@ user. Click the method name for further details such as parameter and return in
|
|||
<a name="rescanblocks"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| 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. |
|
||||
|
@ -902,7 +902,7 @@ 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)*<br />Block connected to the main chain. | [notifyblocks](#notifyblocks) |
|
||||
| 2 | [blockdisconnected](#blockdisconnected) | *DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*<br />Block disconnected from the main chain. | [notifyblocks](#notifyblocks) |
|
||||
| 3 | [recvtx](#recvtx) | *DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*<br />Processed a transaction output spending to a wallet address. | [notifyreceived](#notifyreceived) and [rescan](#rescan) |
|
||||
|
@ -922,7 +922,7 @@ The following is an overview of the JSON-RPC notifications used for Websocket co
|
|||
<a name="blockconnected"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | blockconnected |
|
||||
| Request | [notifyblocks](#notifyblocks) |
|
||||
| Parameters | 1. BlockHash (string) hex-encoded bytes of the attached block hash<br />2. BlockHeight (numeric) height of the attached block<br />3. BlockTime (numeric) unix time of the attached block |
|
||||
|
@ -935,7 +935,7 @@ The following is an overview of the JSON-RPC notifications used for Websocket co
|
|||
<a name="blockdisconnected"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | blockdisconnected |
|
||||
| Request | [notifyblocks](#notifyblocks) |
|
||||
| Parameters | 1. BlockHash (string) hex-encoded bytes of the disconnected block hash<br />2. BlockHeight (numeric) height of the disconnected block<br />3. BlockTime (numeric) unix time of the disconnected block |
|
||||
|
@ -948,7 +948,7 @@ The following is an overview of the JSON-RPC notifications used for Websocket co
|
|||
<a name="recvtx"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Method | recvtx |
|
||||
| Request | [rescan](#rescan) or [notifyreceived](#notifyreceived) |
|
||||
| Parameters | 1. Transaction (string) full transaction encoded as a hex string<br />2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined |
|
||||
|
@ -961,7 +961,7 @@ The following is an overview of the JSON-RPC notifications used for Websocket co
|
|||
<a name="redeemingtx"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | redeemingtx |
|
||||
| Requests | [notifyspent](#notifyspent) and [rescan](#rescan) |
|
||||
| Parameters | 1. Transaction (string) full transaction encoded as a hex string<br />2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined |
|
||||
|
@ -974,7 +974,7 @@ The following is an overview of the JSON-RPC notifications used for Websocket co
|
|||
<a name="txaccepted"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Method | txaccepted |
|
||||
| Request | [notifynewtransactions](#notifynewtransactions) |
|
||||
| Parameters | 1. TxHash (string) hex-encoded bytes of the transaction hash<br />2. Amount (numeric) sum of the value of all the transaction outpoints |
|
||||
|
@ -987,7 +987,7 @@ The following is an overview of the JSON-RPC notifications used for Websocket co
|
|||
<a name="txacceptedverbose"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | txacceptedverbose |
|
||||
| Request | [notifynewtransactions](#notifynewtransactions) |
|
||||
| Parameters | 1. RawTx (json object) the transaction as a json object (see getrawtransaction json object details) |
|
||||
|
@ -1000,7 +1000,7 @@ The following is an overview of the JSON-RPC notifications used for Websocket co
|
|||
<a name="rescanprogress"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Method | rescanprogress |
|
||||
| Request | [rescan](#rescan) |
|
||||
| Parameters | 1. Hash (string) hash of the last processed block<br />2. Height (numeric) height of the last processed block<br />3. Time (numeric) UNIX time of the last processed block |
|
||||
|
@ -1013,7 +1013,7 @@ The following is an overview of the JSON-RPC notifications used for Websocket co
|
|||
<a name="rescanfinished"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Method | rescanfinished |
|
||||
| Request | [rescan](#rescan) |
|
||||
| Parameters | 1. Hash (string) hash of the last rescanned block<br />2. Height (numeric) height of the last rescanned block<br />3. Time (numeric) UNIX time of the last rescanned block |
|
||||
|
@ -1026,7 +1026,7 @@ The following is an overview of the JSON-RPC notifications used for Websocket co
|
|||
<a name="relevanttxaccepted"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | relevanttxaccepted |
|
||||
| Request | [loadtxfilter](#loadtxfilter) |
|
||||
| Parameters | 1. Transaction (string) hex-encoded serialized transaction matching the client's filter loaded ith [loadtxfilter](#loadtxfilter) |
|
||||
|
@ -1038,7 +1038,7 @@ The following is an overview of the JSON-RPC notifications used for Websocket co
|
|||
<a name="filteredblockconnected"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | filteredblockconnected |
|
||||
| Request | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter) |
|
||||
| Parameters | 1. BlockHeight (numeric) height of the attached block<br />2. Header (string) hex-encoded serialized header of the attached block<br />3. Transactions (JSON array) hex-encoded serialized transactions matching the filter for the client connection loaded with [loadtxfilter](#loadtxfilter) |
|
||||
|
@ -1051,7 +1051,7 @@ The following is an overview of the JSON-RPC notifications used for Websocket co
|
|||
<a name="filteredblockdisconnected"/>
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Method | filteredblockdisconnected |
|
||||
| Request | [notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter) |
|
||||
| Parameters | 1. BlockHeight (numeric) height of the disconnected block<br />2. Header (string) hex-encoded serialized header of the disconnected block |
|
||||
|
@ -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')
|
||||
},
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -38,7 +38,7 @@ func main() {
|
|||
log.Fatal(err)
|
||||
}
|
||||
connCfg := &rpcclient.ConnConfig{
|
||||
Host: "localhost:8334",
|
||||
Host: "localhost:9245",
|
||||
Endpoint: "ws",
|
||||
User: "yourrpcuser",
|
||||
Pass: "yourrpcpass",
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue