<p>To run two full nodes on the same machine, they'll need to be bound to different ports. Luckily, bitcoind and bcoin run regtest on different ports already by default (<code>18444</code> and <code>48444</code> respectively). Just note this wouldn't be the case for testnet or main net.</p>

<p>Launch bitcoind</p>

<pre><code>$ bitcoind -daemon -regtest
</code></pre>

<p>Launch bcoin in SPV mode</p>

<pre><code>$ bcoin --spv --daemon --network=regtest
</code></pre>

<p>Connect bcoin to bitcoind:</p>

<pre><code>$ bcoin-cli --network=regtest rpc addnode 127.0.0.1:18444 add
</code></pre>

<p>Get a wallet address from bcoin:</p>

<pre><code>$ bwallet-cli --network=regtest account get default
{
  ...
  "receiveAddress": "n4C5ikvkn5HUNjqAPrPB1udnZPjm9p6xGY",
  ...
}
</code></pre>

<p>Generate a block with bitcoind, sending coinbase subsidy to the wallet address:</p>

<pre><code>$ bitcoin-cli -regtest generatetoaddress 1 n4C5ikvkn5HUNjqAPrPB1udnZPjm9p6xGY
</code></pre>

<p>Check bcoin wallet balance:</p>

<pre><code>$ bwallet-cli --network=regtest balance
{
  "account": -1,
  "tx": 1,
  "coin": 1,
  "unconfirmed": 5000000000,
  "confirmed": 5000000000
}
</code></pre>

CC BY-SA 4.0
2019-07-16T22:07:14.293Z
2019-07-16T22:07:14.293Z
pinhead
<p>I have <code>bitcoind</code> running in <code>regtest</code> mode. I want to connect my <code>bcoin</code> wallet to it and retrieve all UTXOs relevant to the sender's address.</p>

<p>How can I do that?</p>

<bitcoind><wallet><regtest><spv><bcoin>
How do I connect my `bcoin` wallet to `bitcoind`?
Deb
# How do I connect my `bcoin` wallet to `bitcoind`?

(Asked by: username_0 on 2019-02-18)

I have `bitcoind` running in `regtest` mode. I want to connect my `bcoin` wallet to it and retrieve all UTXOs relevant to the sender's address.

How can I do that?

**Tags:** bitcoind, wallet, regtest, spv, bcoin


---

## 1 answers

### Answer by username_1 on 2019-07-16. Score: 2

To run two full nodes on the same machine, they'll need to be bound to different ports. Luckily, bitcoind and bcoin run regtest on different ports already by default (`18444` and `48444` respectively). Just note this wouldn't be the case for testnet or main net.

Launch bitcoind

```
$ bitcoind -daemon -regtest

```

Launch bcoin in SPV mode

```
$ bcoin --spv --daemon --network=regtest

```

Connect bcoin to bitcoind:

```
$ bcoin-cli --network=regtest rpc addnode 127.0.0.1:18444 add

```

Get a wallet address from bcoin:

```
$ bwallet-cli --network=regtest account get default
{
  ...
  "receiveAddress": "n4C5ikvkn5HUNjqAPrPB1udnZPjm9p6xGY",
  ...
}

```

Generate a block with bitcoind, sending coinbase subsidy to the wallet address:

```
$ bitcoin-cli -regtest generatetoaddress 1 n4C5ikvkn5HUNjqAPrPB1udnZPjm9p6xGY

```

Check bcoin wallet balance:

```
$ bwallet-cli --network=regtest balance
{
  "account": -1,
  "tx": 1,
  "coin": 1,
  "unconfirmed": 5000000000,
  "confirmed": 5000000000
}

```


---

